Contracts

Get Contract ABI for Verified Contract Source Codes

Returns the Contract Application Binary Interface ( ABI ) of a verified smart contract.
Find verified contracts
on our Verified Contracts Source Code page.
1
https://api-goerli.etherscan.io/api
2
?module=contract
3
&action=getabi
4
&address=0xfc724f3f942bbc63f14fe4dd4b9128c23c693909
5
&apikey=YourApiKeyToken
Copied!
Try this endpoint in your browser
🔗
Request
Response
Query Parameters
Parameter
Description
address
the contract address that has a verified source code
Sample Response
1
{
2
"status":"1",
3
"message":"OK",
4
"result":"[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]"
5
}
Copied!
A simple sample for retrieving the contractABI using Web3.js and Jquery to interact with a contract.
1
var Web3 = require('web3');
2
var web3 = new Web3(new Web3.providers.HttpProvider());
3
var version = web3.version.api;
4
5
$.getJSON('https://api-goerli.etherscan.io/api?module=contract&action=getabi&address=0xfc724f3f942bbc63f14fe4dd4b9128c23c693909&apikey=YourApiKeyToken', function (data) {
6
var contractABI = "";
7
contractABI = JSON.parse(data.result);
8
if (contractABI != ''){
9
var MyContract = web3.eth.contract(contractABI);
10
var myContractInstance = MyContract.at("0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359");
11
var result = myContractInstance.memberId("0xfe8ad7dd2f564a877cc23feea6c0a9cc2e783715");
12
console.log("result1 : " + result);
13
var result = myContractInstance.members(1);
14
console.log("result2 : " + result);
15
} else {
16
console.log("Error" );
17
}
18
});
Copied!

Get Contract Source Code for Verified Contract Source Codes

Returns the Solidity source code of a verified smart contract.
📩
Tip : You can also download a CSV list of verified contracts addresses of which the code publishers have provided a corresponding Open Source license for redistribution.
1
https://api-goerli.etherscan.io/api
2
?module=contract
3
&action=getsourcecode
4
&address=0x17c133e9e41b1b57699d226a73f1e7838fc1a730
5
&apikey=YourApiKeyToken
Copied!
Try this endpoint in your browser
🔗
Request
Response
Query Parameters
Parameter
Description
address
the contract address that has a verified source code
Sample Response
1
{
2
"status":"1",
3
"message":"OK",
4
"result":[
5
{
6
"SourceCode":"/**\r\n *Submitted for verification at BscScan.com on 2021-10-14\r\n*/\r\n\r\n/**⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\r\n⠀⠀⠀ ⣠⡶⡟⢟⠛⡳⠦⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\r\n⠀⠀⢠⡞⣹⡈⣷⣼⣻⡾⢁⡯⣷⡀⠀⠀⠀⠀⠀⠠⣤⣤⣤⣤⡄⠀⠀⠀⠀⠀⠀⢤⣤⣤⣤⣤⣤⣤⣤⣤⣄⠀⠀⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⡀⠠⣤⣤⣤⣤⡤⠀⠀⣤⣤⣤⡤⠀⢤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⠄⠀\r\n⠀⠀⣿⣧⣈⢿⣿⣿⣿⣷⣿⣠⡽⣧⠀⠀⠀⠀⠀⣰⣿⣿⣿⠟⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⠃⠀⣰⣿⣿⣿⠆⠀⠀⠀⢠⣾⣿⣿⡷⠀⠀⠀⠀⣠⣿⣿⣿⡟⠀⢀⣾⣿⣿⡟⠁⢀⣮⣿⣿⣿⣥⣤⣤⣿⣯⡭⠁⠀⠀\r\n⠀⠀⣿⠘⣿⣿⣿⣿⣿⣽⣿⡿⢠⡟⠀⠀⠀⠀⣴⣿⣿⣟⣋⣀⣠⣿⣿⣿⠄⠠⣾⣿⣿⣛⣁⣀⣴⣿⣿⣿⠃⠀⠀⠀⣠⣿⣿⣿⡟⠀⠀⠀⠀⣴⣿⣿⣟⣋⣀⣠⣾⣿⣿⠟⠀⢠⣭⣭⣿⣍⣉⣩⣿⣿⣿⠿⠁⠀⠀⠀\r\n⠀⠀⠘⣷⠬⢻⣿⣿⣿⣿⠟⢁⡾⠁⠀⠀⠀⠈⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠀⠀⠉⠉⠉⠉⠉⠉⠉⠉⠉⠁⠀⠀⠀⠀⠉⠉⠉⠉⠀⠀⠀⠀⠈⠉⠉⠉⠉⠉⠉⠉⠉⠉⠀⠀⠀⠉⠉⠉⠉⠉⠉⠉⠉⠉⠁⠀⠀⠀⠀⠀\r\n⠀⠀⠀⠈⠓⠦⣽⣯⣭⣴⠶⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\r\n⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\r\n// Social Media Handles Of LOTUS PEOJET \r\n\r\n// Website = https://lotusbsc.com/ \r\n// TG = https://t.me/lotustokenofficial\r\n// Twitter = https://twitter.com/\r\n\r\n// Lotus is a community-driven token that provides a use case,A PVP\r\n// Game and NFTs in a known market place, which entwine with the game.\r\n// We are targetting the gaming community, and have decided to launch\r\n// on the BSC Network, as gas fees are the cheapest and it's deemed the\r\n// most popular blockchain. You will be able to bring centralized money\r\n// into the decentralized space via our token, which will be implemented in our NFTs and Game!\r\n\r\n// Buy tax: 12%\r\n// 3% Marketing\r\n// 3% LP\r\n// 2% Reflections\r\n// 2% Game Development\r\n// 2% Dev team\r\n\r\n// Sell Tax: 12%\r\n// 3% Marketing\r\n// 4% LP\r\n// 2% Reflections\r\n// 2% Game Development \r\n// 2% Dev team\r\n\r\n*/\r\npragma solidity ^0.8.3;\r\n// SPDX-License-Identifier: Unlicensed\r\n/*\r\n * @dev Provides information about the current execution context, including the\r\n * sender of the transaction and its data. While these are generally available\r\n * via msg.sender and msg.data, they should not be accessed in such a direct\r\n * manner, since when dealing with meta-transactions the account sending and\r\n * paying for execution may not be the actual sender (as far as an application\r\n * is concerned).\r\n *\r\n * This contract is only required for intermediate, library-like contracts.\r\n */\r\nabstract contract Context {\r\n function _msgSender() internal view virtual returns (address) {\r\n return msg.sender;\r\n }\r\n\r\n function _msgData() internal view virtual returns (bytes calldata) {\r\n this; // silence state mutability warning without generating bytecode -\r\n return msg.data;\r\n }\r\n}\r\n\r\n/**\r\n * @dev Interface of the ERC20 standard as defined in the EIP.\r\n */\r\ninterface IERC20 {\r\n /**\r\n * @dev Returns the amount of tokens in existence.\r\n */\r\n function totalSupply() external view returns (uint256);\r\n\r\n /**\r\n * @dev Returns the amount of tokens owned by `account`.\r\n */\r\n function balanceOf(address account) external view returns (uint256);\r\n\r\n /**\r\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\r\n *\r\n * Returns a boolean value indicating whether the operation succeeded.\r\n *\r\n * Emits a {Transfer} event.\r\n */\r\n function transfer(address recipient, uint256 amount) external returns (bool);\r\n\r\n /**\r\n * @dev Returns the remaining number of tokens that `spender` will be\r\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\r\n * zero by default.\r\n *\r\n * This value changes when {approve} or {transferFrom} are called.\r\n */\r\n function allowance(address owner, address spender) external view returns (uint256);\r\n\r\n /**\r\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\r\n *\r\n * Returns a boolean value indicating whether the operation succeeded.\r\n *\r\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\r\n * that someone may use both the old and the new allowance by unfortunate\r\n * transaction ordering. One possible solution to mitigate this race\r\n * condition is to first reduce the spender's allowance to 0 and set the\r\n * desired value afterwards:\r\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\r\n *\r\n * Emits an {Approval} event.\r\n */\r\n function approve(address spender, uint256 amount) external returns (bool);\r\n\r\n /**\r\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\r\n * allowance mechanism. `amount` is then deducted from the caller's\r\n * allowance.\r\n *\r\n * Returns a boolean value indicating whether the operation succeeded.\r\n *\r\n * Emits a {Transfer} event.\r\n */\r\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\r\n\r\n /**\r\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\r\n * another (`to`).\r\n *\r\n * Note that `value` may be zero.\r\n */\r\n event Transfer(address indexed from, address indexed to, uint256 value);\r\n\r\n /**\r\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\r\n * a call to {approve}. `value` is the new allowance.\r\n */\r\n event Approval(address indexed owner, address indexed spender, uint256 value);\r\n}\r\n\r\n\r\n/**\r\n * @dev Collection of functions related to the address type\r\n */\r\nlibrary Address {\r\n /**\r\n * @dev Returns true if `account` is a contract.\r\n *\r\n * [IMPORTANT]\r\n * ====\r\n * It is unsafe to assume that an address for which this function returns\r\n * false is an externally-owned account (EOA) and not a contract.\r\n *\r\n * Among others, `isContract` will return false for the following\r\n * types of addresses:\r\n *\r\n * - an externally-owned account\r\n * - a contract in construction\r\n * - an address where a contract will be created\r\n * - an address where a contract lived, but was destroyed\r\n * ====\r\n */\r\n function isContract(address account) internal view returns (bool) {\r\n // This method relies on extcodesize, which returns 0 for contracts in\r\n // construction, since the code is only stored at the end of the\r\n // constructor execution.\r\n\r\n uint256 size;\r\n // solhint-disable-next-line no-inline-assembly\r\n assembly { size := extcodesize(account) }\r\n return size > 0;\r\n }\r\n\r\n /**\r\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\r\n * `recipient`, forwarding all available gas and reverting on errors.\r\n *\r\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\r\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\r\n * imposed by `transfer`, making them unable to receive funds via\r\n * `transfer`. {sendValue} removes this limitation.\r\n *\r\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\r\n *\r\n * IMPORTANT: because control is transferred to `recipient`, care must be\r\n * taken to not create reentrancy vulnerabilities. Consider using\r\n * {ReentrancyGuard} or the\r\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\r\n */\r\n function sendValue(address payable recipient, uint256 amount) internal {\r\n require(address(this).balance >= amount, \"Address: insufficient balance\");\r\n\r\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\r\n (bool success, ) = recipient.call{ value: amount }(\"\");\r\n require(success, \"Address: unable to send value, recipient may have reverted\");\r\n }\r\n\r\n /**\r\n * @dev Performs a Solidity function call using a low level `call`. A\r\n * plain`call` is an unsafe replacement for a function call: use this\r\n * function instead.\r\n *\r\n * If `target` reverts with a revert reason, it is bubbled up by this\r\n * function (like regular Solidity function calls).\r\n *\r\n * Returns the raw returned data. To convert to the expected return value,\r\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\r\n *\r\n * Requirements:\r\n *\r\n * - `target` must be a contract.\r\n * - calling `target` with `data` must not revert.\r\n *\r\n * _Available since v3.1._\r\n */\r\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\r\n return functionCall(target, data, \"Address: low-level call failed\");\r\n }\r\n\r\n /**\r\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\r\n * `errorMessage` as a fallback revert reason when `target` reverts.\r\n *\r\n * _Available since v3.1._\r\n */\r\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\r\n return functionCallWithValue(target, data, 0, errorMessage);\r\n }\r\n\r\n /**\r\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\r\n * but also transferring `value` wei to `target`.\r\n *\r\n * Requirements:\r\n *\r\n * - the calling contract must have an ETH balance of at least `value`.\r\n * - the called Solidity function must be `payable`.\r\n *\r\n * _Available since v3.1._\r\n */\r\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\r\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\r\n }\r\n\r\n /**\r\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\r\n * with `errorMessage` as a fallback revert reason when `target` reverts.\r\n *\r\n * _Available since v3.1._\r\n */\r\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\r\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\r\n require(isContract(target), \"Address: call to non-contract\");\r\n\r\n // solhint-disable-next-line avoid-low-level-calls\r\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\r\n return _verifyCallResult(success, returndata, errorMessage);\r\n }\r\n\r\n /**\r\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\r\n * but performing a static call.\r\n *\r\n * _Available since v3.3._\r\n */\r\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\r\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\r\n }\r\n\r\n /**\r\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\r\n * but performing a static call.\r\n *\r\n * _Available since v3.3._\r\n */\r\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\r\n require(isContract(target), \"Address: static call to non-contract\");\r\n\r\n // solhint-disable-next-line avoid-low-level-calls\r\n (bool success, bytes memory returndata) = target.staticcall(data);\r\n return _verifyCallResult(success, returndata, errorMessage);\r\n }\r\n\r\n /**\r\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\r\n * but performing a delegate call.\r\n *\r\n * _Available since v3.4._\r\n */\r\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\r\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\r\n }\r\n\r\n /**\r\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\r\n * but performing a delegate call.\r\n *\r\n * _Available since v3.4._\r\n */\r\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\r\n require(isContract(target), \"Address: delegate call to non-contract\");\r\n\r\n // solhint-disable-next-line avoid-low-level-calls\r\n (bool success, bytes memory returndata) = target.delegatecall(data);\r\n return _verifyCallResult(success, returndata, errorMessage);\r\n }\r\n\r\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\r\n if (success) {\r\n return returndata;\r\n } else {\r\n // Look for revert reason and bubble it up if present\r\n if (returndata.length > 0) {\r\n // The easiest way to bubble the revert reason is using memory via assembly\r\n\r\n // solhint-disable-next-line no-inline-assembly\r\n assembly {\r\n let returndata_size := mload(returndata)\r\n revert(add(32, returndata), returndata_size)\r\n }\r\n } else {\r\n revert(errorMessage);\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * @dev Contract module which provides a basic access control mechanism, where\r\n * there is an account (an owner) that can be granted exclusive access to\r\n * specific functions.\r\n *\r\n * By default, the owner account will be the one that deploys the contract. This\r\n * can later be changed with {transferOwnership}.\r\n *\r\n * This module is used through inheritance. It will make available the modifier\r\n * `onlyOwner`, which can be applied to your functions to restrict their use to\r\n * the owner.\r\n */\r\nabstract contract Ownable is Context {\r\n address private _owner;\r\n\r\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\r\n\r\n /**\r\n * @dev Initializes the contract setting the deployer as the initial owner.\r\n */\r\n constructor () {\r\n address msgSender = _msgSender();\r\n _owner = msgSender;\r\n emit OwnershipTransferred(address(0), msgSender);\r\n }\r\n\r\n /**\r\n * @dev Returns the address of the current owner.\r\n */\r\n function owner() public view virtual returns (address) {\r\n return _owner;\r\n }\r\n\r\n /**\r\n * @dev Throws if called by any account other than the owner.\r\n */\r\n modifier onlyOwner() {\r\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\r\n _;\r\n }\r\n\r\n /**\r\n * @dev Leaves the contract without owner. It will not be possible to call\r\n * `onlyOwner` functions anymore. Can only be called by the current owner.\r\n *\r\n * NOTE: Renouncing ownership will leave the contract without an owner,\r\n * thereby removing any functionality that is only available to the owner.\r\n */\r\n function renounceOwnership() public virtual onlyOwner {\r\n emit OwnershipTransferred(_owner, address(0));\r\n _owner = address(0);\r\n }\r\n\r\n /**\r\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\r\n * Can only be called by the current owner.\r\n */\r\n function transferOwnership(address newOwner) public virtual onlyOwner {\r\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\r\n emit OwnershipTransferred(_owner, newOwner);\r\n _owner = newOwner;\r\n }\r\n}\r\n\r\n\r\ninterface IUniswapV2Factory {\r\n event PairCreated(address indexed token0, address indexed token1, address pair, uint);\r\n\r\n function feeTo() external view returns (address);\r\n function feeToSetter() external view returns (address);\r\n\r\n function getPair(address tokenA, address tokenB) external view returns (address pair);\r\n function allPairs(uint) external view returns (address pair);\r\n function allPairsLength() external view returns (uint);\r\n\r\n function createPair(address tokenA, address tokenB) external returns (address pair);\r\n\r\n function setFeeTo(address) external;\r\n function setFeeToSetter(address) external;\r\n}\r\n\r\ninterface IUniswapV2Pair {\r\n event Approval(address indexed owner, address indexed spender, uint value);\r\n event Transfer(address indexed from, address indexed to, uint value);\r\n\r\n function name() external pure returns (string memory);\r\n function symbol() external pure returns (string memory);\r\n function decimals() external pure returns (uint8);\r\n function totalSupply() external view returns (uint);\r\n function balanceOf(address owner) external view returns (uint);\r\n function allowance(address owner, address spender) external view returns (uint);\r\n\r\n function approve(address spender, uint value) external returns (bool);\r\n function transfer(address to, uint value) external returns (bool);\r\n function transferFrom(address from, address to, uint value) external returns (bool);\r\n\r\n function DOMAIN_SEPARATOR() external view returns (bytes32);\r\n function PERMIT_TYPEHASH() external pure returns (bytes32);\r\n function nonces(address owner) external view returns (uint);\r\n\r\n function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;\r\n\r\n event Mint(address indexed sender, uint amount0, uint amount1);\r\n event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);\r\n event Swap(\r\n address indexed sender,\r\n uint amount0In,\r\n uint amount1In,\r\n uint amount0Out,\r\n uint amount1Out,\r\n address indexed to\r\n );\r\n event Sync(uint112 reserve0, uint112 reserve1);\r\n\r\n function MINIMUM_LIQUIDITY() external pure returns (uint);\r\n function factory() external view returns (address);\r\n function token0() external view returns (address);\r\n function token1() external view returns (address);\r\n function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);\r\n function price0CumulativeLast() external view returns (uint);\r\n function price1CumulativeLast() external view returns (uint);\r\n function kLast() external view returns (uint);\r\n\r\n function mint(address to) external returns (uint liquidity);\r\n function burn(address to) external returns (uint amount0, uint amount1);\r\n function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;\r\n function skim(address to) external;\r\n function sync() external;\r\n\r\n function initialize(address, address) external;\r\n}\r\n\r\ninterface IUniswapV2Router01 {\r\n function factory() external pure returns (address);\r\n function WETH() external pure returns (address);\r\n\r\n function addLiquidity(\r\n address tokenA,\r\n address tokenB,\r\n uint amountADesired,\r\n uint amountBDesired,\r\n uint amountAMin,\r\n uint amountBMin,\r\n address to,\r\n uint deadline\r\n ) external returns (uint amountA, uint amountB, uint liquidity);\r\n function addLiquidityETH(\r\n address token,\r\n uint amountTokenDesired,\r\n uint amountTokenMin,\r\n uint amountETHMin,\r\n address to,\r\n uint deadline\r\n ) external payable returns (uint amountToken, uint amountETH, uint liquidity);\r\n function removeLiquidity(\r\n address tokenA,\r\n address tokenB,\r\n uint liquidity,\r\n uint amountAMin,\r\n uint amountBMin,\r\n address to,\r\n uint deadline\r\n ) external returns (uint amountA, uint amountB);\r\n function removeLiquidityETH(\r\n address token,\r\n uint liquidity,\r\n uint amountTokenMin,\r\n uint amountETHMin,\r\n address to,\r\n uint deadline\r\n ) external returns (uint amountToken, uint amountETH);\r\n function removeLiquidityWithPermit(\r\n address tokenA,\r\n address tokenB,\r\n uint liquidity,\r\n uint amountAMin,\r\n uint amountBMin,\r\n address to,\r\n uint deadline,\r\n bool approveMax, uint8 v, bytes32 r, bytes32 s\r\n ) external returns (uint amountA, uint amountB);\r\n function removeLiquidityETHWithPermit(\r\n address token,\r\n uint liquidity,\r\n uint amountTokenMin,\r\n uint amountETHMin,\r\n address to,\r\n uint deadline,\r\n bool approveMax, uint8 v, bytes32 r, bytes32 s\r\n ) external returns (uint amountToken, uint amountETH);\r\n function swapExactTokensForTokens(\r\n uint amountIn,\r\n uint amountOutMin,\r\n address[] calldata path,\r\n address to,\r\n uint deadline\r\n ) external returns (uint[] memory amounts);\r\n function swapTokensForExactTokens(\r\n uint amountOut,\r\n uint amountInMax,\r\n address[] calldata path,\r\n address to,\r\n uint deadline\r\n ) external returns (uint[] memory amounts);\r\n function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)\r\n external\r\n payable\r\n returns (uint[] memory amounts);\r\n function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)\r\n external\r\n returns (uint[] memory amounts);\r\n function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)\r\n external\r\n returns (uint[] memory amounts);\r\n function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)\r\n external\r\n payable\r\n returns (uint[] memory amounts);\r\n\r\n function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);\r\n function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);\r\n function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);\r\n function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);\r\n function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);\r\n}\r\n\r\ninterface IUniswapV2Router02 is IUniswapV2Router01 {\r\n function removeLiquidityETHSupportingFeeOnTransferTokens(\r\n address token,\r\n uint liquidity,\r\n uint amountTokenMin,\r\n uint amountETHMin,\r\n address to,\r\n uint deadline\r\n ) external returns (uint amountETH);\r\n function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(\r\n address token,\r\n uint liquidity,\r\n uint amountTokenMin,\r\n uint amountETHMin,\r\n address to,\r\n uint deadline,\r\n bool approveMax, uint8 v, bytes32 r, bytes32 s\r\n ) external returns (uint amountETH);\r\n\r\n function swapExactTokensForTokensSupportingFeeOnTransferTokens(\r\n uint amountIn,\r\n uint amountOutMin,\r\n address[] calldata path,\r\n address to,\r\n uint deadline\r\n ) external;\r\n function swapExactETHForTokensSupportingFeeOnTransferTokens(\r\n uint amountOutMin,\r\n address[] calldata path,\r\n address to,\r\n uint deadline\r\n ) external payable;\r\n function swapExactTokensForETHSupportingFeeOnTransferTokens(\r\n uint amountIn,\r\n uint amountOutMin,\r\n address[] calldata path,\r\n address to,\r\n uint deadline\r\n ) external;\r\n}\r\n\r\ninterface IPinkAntiBot {\r\n function setTokenOwner(address owner) external;\r\n\r\n function onPreTransferCheck(\r\n address from,\r\n address to,\r\n uint256 amount\r\n ) external;\r\n}\r\n\r\n\r\ncontract LOTUS is Context, IERC20, Ownable { \r\n using Address for address;\r\n\r\n mapping (address => uint256) private _rOwned;\r\n mapping (address => uint256) private _tOwned;\r\n mapping (address => mapping (address => uint256)) private _allowances;\r\n\r\n mapping (address => bool) private _isExcludedFromFee;\r\n mapping (address => bool) public _exemptFromMaxWallet;\r\n\r\n mapping (address => bool) private _isExcluded;\r\n address[] private _excluded;\r\n\r\n address payable private _devWalletAddress = payable(0xb6da15a6D99fbbf159068303408DF9457f13E981);\r\n address payable private _marketingWalletAddress = payable(0xb6da15a6D99fbbf159068303408DF9457f13E981);\r\n address payable private _developmentWalletAddress = payable(0xb6da15a6D99fbbf159068303408DF9457f13E981);\r\n address constant private _burnAddress = 0x000000000000000000000000000000000000dEaD;\r\n \r\n uint256 private constant MAX = type(uint256).max;\r\n uint256 private _tTotal = 100000000000 * 10**9;\r\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\r\n uint256 private _tFeeTotal;\r\n\r\n string private _name = \"LOTUS\";\r\n string private _symbol = \"LOTUS\";\r\n uint8 private _decimals = 9;\r\n \r\n uint256 public _marketingfee = 3;\r\n uint256 public _developmentfee = 2;\r\n uint256 public _reflectionFee = 2;\r\n uint256 private _previousReflectionFee = _reflectionFee;\r\n uint256 public _devFee = 2;\r\n uint256 public _liquidityFee = 3;\r\n uint256 private _totalBNBFees = _marketingfee + _developmentfee + _devFee + _liquidityFee;\r\n uint256 private _previousTotalFee = _totalBNBFees;\r\n\r\n uint256 public maxWalletBalance = (totalSupply() * 1) / 100;\r\n \r\n IUniswapV2Router02 public immutable uniswapV2Router;\r\n address public uniswapV2Pair;\r\n \r\n bool inSwapAndLiquify;\r\n bool public swapAndLiquifyEnabled = true;\r\n bool public tradingIsEnabled = false;\r\n IPinkAntiBot public pinkAntiBot;\r\n bool public antiBotEnabled = false;\r\n \r\n uint256 public _maxTxAmount = 100000000000 * 10**9;\r\n uint256 private numTokensSellToAddToLiquidity = 400000 * 10**9;\r\n \r\n event MinTokensBeforeSwapUpdated(uint256 minTokensBeforeSwap);\r\n event SwapAndLiquifyEnabledUpdated(bool enabled);\r\n event SwapAndLiquify(\r\n uint256 tokensSwapped,\r\n uint256 ethReceived,\r\n uint256 tokensIntoLiqudity\r\n );\r\n \r\n modifier lockTheSwap {\r\n inSwapAndLiquify = true;\r\n _;\r\n inSwapAndLiquify = false;\r\n }\r\n \r\n constructor () {\r\n _tOwned[owner()] = _tTotal;\r\n _rOwned[owner()] = _rTotal;\r\n \r\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\r\n //IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3);\r\n // Create a uniswap pair for this new token\r\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\r\n .createPair(address(this), _uniswapV2Router.WETH());\r\n\r\n // set the rest of the contract variables\r\n uniswapV2Router = _uniswapV2Router;\r\n \r\n _maxTxAmount = _tTotal; // start off transaction limit at 100% of total supply\r\n \r\n //exclude owner and this contract from fee\r\n _isExcludedFromFee[owner()] = true;\r\n _isExcludedFromFee[address(this)] = true;\r\n \r\n _exemptFromMaxWallet[owner()] = true;\r\n _exemptFromMaxWallet[address(this)] = true;\r\n _exemptFromMaxWallet[uniswapV2Pair] = true;\r\n _exemptFromMaxWallet[_devWalletAddress] = true;\r\n _exemptFromMaxWallet[_marketingWalletAddress] = true;\r\n _exemptFromMaxWallet[_developmentWalletAddress] = true;\r\n _exemptFromMaxWallet[_burnAddress] = true;\r\n \r\n _isExcluded[address(this)] = true;\r\n _excluded.push(address(this));\r\n _isExcluded[_burnAddress] = true;\r\n _excluded.push(_burnAddress);\r\n _isExcluded[msg.sender] = true;\r\n _excluded.push(msg.sender);\r\n _isExcluded[uniswapV2Pair] = true;\r\n _excluded.push(uniswapV2Pair);\r\n \r\n // pinkAntiBot = IPinkAntiBot(pinkAntiBot_);\r\n // pinkAntiBot.setTokenOwner(msg.sender);\r\n // antiBotEnabled = true;\r\n \r\n emit Transfer(address(0), _msgSender(), _tTotal);\r\n }\r\n\r\n function name() public view returns (string memory) {\r\n return _name;\r\n }\r\n\r\n function symbol() public view returns (string memory) {\r\n return _symbol;\r\n }\r\n\r\n function decimals() public view returns (uint8) {\r\n return _decimals;\r\n }\r\n\r\n function totalSupply() public view override returns (uint256) {\r\n return _tTotal;\r\n }\r\n\r\n function balanceOf(address account) public view override returns (uint256) {\r\n if (_isExcluded[account]) return _tOwned[account];\r\n return tokenFromReflection(_rOwned[account]);\r\n }\r\n\r\n function transfer(address recipient, uint256 amount) public override returns (bool) {\r\n _transfer(_msgSender(), recipient, amount);\r\n return true;\r\n }\r\n\r\n function allowance(address owner, address spender) public view override returns (uint256) {\r\n return _allowances[owner][spender];\r\n }\r\n\r\n function approve(address spender, uint256 amount) public override returns (bool) {\r\n _approve(_msgSender(), spender, amount);\r\n return true;\r\n }\r\n\r\n function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {\r\n _transfer(sender, recipient, amount);\r\n _approve(sender, _msgSender(), _allowances[sender][_msgSender()] - amount);\r\n return true;\r\n }\r\n\r\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\r\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);\r\n return true;\r\n }\r\n\r\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\r\n _approve(_msgSender(), spender, _allowances[_msgSender()][spender] - subtractedValue);\r\n return true;\r\n }\r\n\r\n function isExcludedFromReward(address account) public view returns (bool) {\r\n return _isExcluded[account];\r\n }\r\n\r\n function totalFees() public view returns (uint256) {\r\n return _tFeeTotal;\r\n }\r\n\r\n \r\n function tokenFromReflection(uint256 rAmount) private view returns(uint256) {\r\n require(rAmount <= _rTotal, \"Amount must be less than total reflections\");\r\n uint256 currentRate = _getRate();\r\n return rAmount / currentRate;\r\n }\r\n\r\n function setEnableAntiBot(bool _enable) external onlyOwner() {\r\n antiBotEnabled = _enable;\r\n }\r\n\r\n function excludeFromReward(address account) public onlyOwner() {\r\n require(!_isExcluded[account], \"Account is already excluded\");\r\n if(_rOwned[account] > 0) {\r\n _tOwned[account] = tokenFromReflection(_rOwned[account]);\r\n }\r\n _isExcluded[account] = true;\r\n _excluded.push(account);\r\n }\r\n\r\n function includeInReward(address account) external onlyOwner() {\r\n require(_isExcluded[account], \"Account is already included\");\r\n for (uint256 i = 0; i < _excluded.length; i++) {\r\n if (_excluded[i] == account) {\r\n _excluded[i] = _excluded[_excluded.length - 1];\r\n _tOwned[account] = 0;\r\n _isExcluded[account] = false;\r\n _excluded.pop();\r\n break;\r\n }\r\n }\r\n }\r\n \r\n function excludeFromFee(address account) public onlyOwner {\r\n _isExcludedFromFee[account] = true;\r\n }\r\n \r\n function excludeFromMaxWallet(address account) public onlyOwner {\r\n _exemptFromMaxWallet[account] = true;\r\n }\r\n \r\n function setPresaleAddress(address _presale) external onlyOwner {\r\n excludeFromMaxWallet(_presale);\r\n excludeFromFee(_presale);\r\n excludeFromReward(_presale);\r\n }\r\n \r\n function includeInFee(address account) public onlyOwner {\r\n _isExcludedFromFee[account] = false;\r\n }\r\n \r\n function includeFromMaxWallet(address account) public onlyOwner {\r\n _exemptFromMaxWallet[account] = false;\r\n }\r\n \r\n function setReflectionFeePercent(uint256 taxFee) external onlyOwner() {\r\n _reflectionFee = taxFee;\r\n }\r\n \r\n function setTokensToSwap(uint256 _swap) external onlyOwner() {\r\n numTokensSellToAddToLiquidity = _swap * 10**9;\r\n }\r\n\r\n function setDevFeePercent(uint256 giveawayFee) external onlyOwner() {\r\n _devFee = giveawayFee;\r\n _totalBNBFees = _marketingfee + _developmentfee + _devFee + _liquidityFee;\r\n _previousTotalFee = _totalBNBFees;\r\n }\r\n \r\n function setDevelopmentFeePercent(uint256 giveawayFee) external onlyOwner() {\r\n _developmentfee = giveawayFee;\r\n _totalBNBFees = _marketingfee + _developmentfee + _devFee + _liquidityFee;\r\n _previousTotalFee = _totalBNBFees;\r\n }\r\n \r\n function setMarketingFeePercent(uint256 giveawayFee) external onlyOwner() {\r\n _marketingfee = giveawayFee;\r\n _totalBNBFees = _marketingfee + _developmentfee + _devFee + _liquidityFee;\r\n _previousTotalFee = _totalBNBFees;\r\n }\r\n \r\n function setLiquidityFeePercent(uint256 liquidityFee) external onlyOwner() {\r\n _liquidityFee = liquidityFee;\r\n _totalBNBFees = _marketingfee + _developmentfee + _devFee + _liquidityFee;\r\n _previousTotalFee = _totalBNBFees;\r\n }\r\n \r\n function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {\r\n _maxTxAmount = (_tTotal * maxTxPercent) / 10**2;\r\n }\r\n \r\n function setTradingIsEnabled(bool _enabled) external onlyOwner {\r\n tradingIsEnabled = _enabled;\r\n }\r\n \r\n function setSwapAndLiquifyEnabled(bool _enabled) public onlyOwner {\r\n swapAndLiquifyEnabled = _enabled;\r\n emit SwapAndLiquifyEnabledUpdated(_enabled);\r\n }\r\n \r\n function updateMarketingWalletAddress(address payable marketingWalletAddress) external onlyOwner() {\r\n _marketingWalletAddress = marketingWalletAddress;\r\n }\r\n \r\n function updateDevelopmentWalletAddress(address payable developmentWalletAddress) external onlyOwner() {\r\n _developmentWalletAddress = developmentWalletAddress;\r\n }\r\n \r\n function updateDevWalletAddress(address payable devWalletAddress) external onlyOwner() {\r\n _devWalletAddress = devWalletAddress;\r\n }\r\n\r\n \tfunction setWalletBalance(uint256 _maxWalletBalance) external onlyOwner{\r\n \t maxWalletBalance = _maxWalletBalance;\r\n \t}\r\n \r\n //to recieve ETH from uniswapV2Router when swaping\r\n receive() external payable {}\r\n \r\n function removeAllFee() private {\r\n if (_totalBNBFees == 0) return;\r\n \r\n _previousTotalFee = _totalBNBFees;\r\n _previousReflectionFee = _reflectionFee;\r\n \r\n _totalBNBFees = 0;\r\n _reflectionFee = 0;\r\n }\r\n \r\n function restoreAllFee() private {\r\n _totalBNBFees = _previousTotalFee;\r\n _reflectionFee = _previousReflectionFee;\r\n }\r\n \r\n function isExcludedFromFee(address account) public view returns(bool) {\r\n return _isExcludedFromFee[account];\r\n }\r\n\r\n function _approve(address owner, address spender, uint256 amount) private {\r\n require(owner != address(0), \"ERC20: approve from the zero address\");\r\n require(spender != address(0), \"ERC20: approve to the zero address\");\r\n\r\n _allowances[owner][spender] = amount;\r\n emit Approval(owner, spender, amount);\r\n }\r\n\r\n function _transfer(\r\n address from,\r\n address to,\r\n uint256 amount\r\n ) private {\r\n require(from != address(0), \"ERC20: transfer from the zero address\");\r\n require(to != address(0), \"ERC20: transfer to the zero address\");\r\n require(amount > 0, \"Transfer amount must be greater than zero\");\r\n if (antiBotEnabled) {\r\n pinkAntiBot.onPreTransferCheck(from, to, amount);\r\n }\r\n if (!_exemptFromMaxWallet[to]) {\r\n require(amount <= _maxTxAmount, \"Transfer amount exceeds the maxTxAmount.\");\r\n require(balanceOf(to) + amount <= maxWalletBalance, 'Wallet balance is exceeding maxWalletBalance'); \r\n }\r\n if (!tradingIsEnabled) {\r\n if (_isExcludedFromFee[from] && to == uniswapV2Pair) {\r\n tradingIsEnabled = true;\r\n } else {\r\n require(_isExcludedFromFee[from] || _isExcludedFromFee[to], \"Liquidity not launched yet\");\r\n }\r\n }\r\n \r\n // is the token balance of this contract address over the min number of\r\n // tokens that we need to initiate a swap + liquidity lock?\r\n // also, don't get caught in a circular liquidity event.\r\n // also, don't swap & liquify if sender is uniswap pair.\r\n uint256 contractTokenBalance = balanceOf(address(this));\r\n \r\n if(contractTokenBalance >= _maxTxAmount)\r\n {\r\n contractTokenBalance = _maxTxAmount;\r\n }\r\n \r\n bool overMinTokenBalance = contractTokenBalance >= numTokensSellToAddToLiquidity;\r\n if (\r\n overMinTokenBalance &&\r\n !inSwapAndLiquify &&\r\n from != uniswapV2Pair &&\r\n to == uniswapV2Pair &&\r\n swapAndLiquifyEnabled\r\n ) {\r\n contractTokenBalance = numTokensSellToAddToLiquidity;\r\n \r\n //add liquidity\r\n swapAndLiquify(contractTokenBalance);\r\n }\r\n \r\n //indicates if fee should be deducted from transfer\r\n bool takeFee = true;\r\n \r\n //if any account belongs to _isExcludedFromFee account then remove the fee\r\n if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){\r\n takeFee = false;\r\n }\r\n \r\n //transfer amount, it will take taxfees\r\n _tokenTransfer(from,to,amount,takeFee);\r\n }\r\n\r\n function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {\r\n uint256 amountToSwap = contractTokenBalance;\r\n\r\n uint256 tokensForLP = ((amountToSwap * _liquidityFee) / _totalBNBFees) / 2;\r\n\r\n uint256 initialBalance = address(this).balance;\r\n\r\n swapTokensForEth(amountToSwap - tokensForLP);\r\n\r\n uint256 newBalance = address(this).balance - initialBalance;\r\n\r\n uint256 totalBNBFee = _totalBNBFees - _liquidityFee / 2;\r\n\r\n uint256 bnbToBeAddedToLiquidity = ((newBalance * _liquidityFee) / totalBNBFee) / 2;\r\n\r\n if (bnbToBeAddedToLiquidity > 0)\r\n addLiquidity(tokensForLP, bnbToBeAddedToLiquidity);\r\n \r\n uint256 bnbToBeAddedToDev = (newBalance * _devFee) / totalBNBFee;\r\n\r\n if (bnbToBeAddedToDev > 0)\r\n _devWalletAddress.transfer(bnbToBeAddedToDev);\r\n \r\n uint256 bnbToBeAddedToDevelopment = (newBalance * _developmentfee) / totalBNBFee;\r\n\r\n if (bnbToBeAddedToDevelopment > 0)\r\n _developmentWalletAddress.transfer(bnbToBeAddedToDevelopment);\r\n \r\n uint256 bnbToBeAddedToMarketing = address(this).balance;\r\n\r\n if (bnbToBeAddedToMarketing > 0)\r\n _marketingWalletAddress.transfer(bnbToBeAddedToMarketing);\r\n \r\n emit SwapAndLiquify(amountToSwap, newBalance, tokensForLP);\r\n }\r\n\r\n function swapTokensForEth(uint256 tokenAmount) private {\r\n // generate the uniswap pair path of token -> weth\r\n address[] memory path = new address[](2);\r\n path[0] = address(this);\r\n path[1] = uniswapV2Router.WETH();\r\n\r\n _approve(address(this), address(uniswapV2Router), tokenAmount);\r\n\r\n // make the swap\r\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\r\n tokenAmount,\r\n 0, // accept any amount of ETH\r\n path,\r\n address(this),\r\n block.timestamp\r\n );\r\n }\r\n\r\n function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {\r\n // approve token transfer to cover all possible scenarios\r\n _approve(address(this), address(uniswapV2Router), tokenAmount);\r\n\r\n // add the liquidity\r\n uniswapV2Router.addLiquidityETH{value: ethAmount}(\r\n address(this),\r\n tokenAmount,\r\n 0, // slippage is unavoidable\r\n 0, // slippage is unavoidable\r\n owner(),\r\n block.timestamp\r\n );\r\n }\r\n\r\n //this method is responsible for taking all fee, if takeFee is true\r\n function _tokenTransfer(address sender, address recipient, uint256 amount,bool takeFee) private {\r\n if(!takeFee)\r\n removeAllFee();\r\n \r\n _transferStandard(sender, recipient, amount);\r\n \r\n if(!takeFee)\r\n restoreAllFee();\r\n }\r\n\r\n function _transferStandard(address sender, address recipient, uint256 tAmount) private {\r\n (\r\n uint256 rAmount, uint256 rTransferAmount, uint256 rReflection, uint256 tTransferAmount, uint256 tReflection, uint256 tLiquidity\r\n ) = _getValues(tAmount);\r\n _rOwned[sender] -= rAmount;\r\n if (_isExcluded[sender])\r\n _tOwned[sender] -= tAmount;\r\n if (_isExcluded[recipient])\r\n _tOwned[recipient] += tTransferAmount;\r\n _rOwned[recipient] += rTransferAmount;\r\n \r\n\r\n _takeLiquidity(tLiquidity);\r\n _reflectFee(rReflection, tReflection);\r\n emit Transfer(sender, recipient, tTransferAmount);\r\n }\r\n \r\n function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {\r\n (uint256 tTransferAmount, uint256 tReflection, uint256 tLiquidity) = _getTValues(tAmount);\r\n (uint256 rAmount, uint256 rTransferAmount, uint256 rReflection) = _getRValues(tAmount, tReflection, tLiquidity, _getRate());\r\n return (rAmount, rTransferAmount, rReflection, tTransferAmount, tReflection, tLiquidity);\r\n }\r\n\r\n function _getTValues(uint256 tAmount) private view returns (uint256, uint256, uint256) {\r\n uint256 tReflection = calculateReflectionFee(tAmount);\r\n uint256 tLiquidity = calculateLiquidityFee(tAmount);\r\n uint256 tTransferAmount = tAmount - (tReflection + tLiquidity);\r\n return (tTransferAmount, tReflection, tLiquidity);\r\n }\r\n \r\n function calculateReflectionFee(uint256 _amount) private view returns (uint256) {\r\n return (_amount * _reflectionFee) / 100;\r\n }\r\n\r\n function calculateLiquidityFee(uint256 _amount) private view returns (uint256) {\r\n return (_amount * _totalBNBFees) / 100;\r\n }\r\n\r\n function _getRValues(uint256 tAmount, uint256 tReflection, uint256 tLiquidity, uint256 currentRate) private pure returns (uint256, uint256, uint256) {\r\n uint256 rAmount = tAmount * currentRate;\r\n uint256 rReflection = tReflection * currentRate;\r\n uint256 rLiquidity = tLiquidity * currentRate;\r\n uint256 rTransferAmount = rAmount - (rReflection + rLiquidity);\r\n return (rAmount, rTransferAmount, rReflection);\r\n }\r\n\r\n function _getRate() private view returns(uint256) {\r\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\r\n return rSupply / tSupply;\r\n }\r\n\r\n function _getCurrentSupply() private view returns(uint256, uint256) {\r\n uint256 rSupply = _rTotal;\r\n uint256 tSupply = _tTotal; \r\n for (uint256 i = 0; i < _excluded.length; i++) {\r\n if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);\r\n rSupply -= _rOwned[_excluded[i]];\r\n tSupply -= _tOwned[_excluded[i]];\r\n }\r\n if (rSupply < _rTotal / _tTotal) return (_rTotal, _tTotal);\r\n return (rSupply, tSupply);\r\n }\r\n \r\n function _reflectFee(uint256 rReflection, uint256 tReflection) private {\r\n _rTotal -= rReflection;\r\n _tFeeTotal += tReflection;\r\n }\r\n \r\n function _takeLiquidity(uint256 tLiquidity) private {\r\n uint256 currentRate = _getRate();\r\n uint256 rLiquidity = tLiquidity * currentRate;\r\n _rOwned[address(this)] += rLiquidity;\r\n if(_isExcluded[address(this)])\r\n _tOwned[address(this)] += tLiquidity;\r\n }\r\n\r\n}\r\n// S_Manager",
7
"ABI":"[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"minTokensBeforeSwap\",\"type\":\"uint256\"}],\"name\":\"MinTokensBeforeSwapUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensSwapped\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ethReceived\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokensIntoLiqudity\",\"type\":\"uint256\"}],\"name\":\"SwapAndLiquify\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"SwapAndLiquifyEnabledUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"_devFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_developmentfee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"_exemptFromMaxWallet\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_liquidityFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_marketingfee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_maxTxAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_reflectionFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"antiBotEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"excludeFromFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"excludeFromMaxWallet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"excludeFromReward\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"includeFromMaxWallet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"includeInFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"includeInReward\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"isExcludedFromFee\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"isExcludedFromReward\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxWalletBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pinkAntiBot\",\"outputs\":[{\"internalType\":\"contract IPinkAntiBot\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"giveawayFee\",\"type\":\"uint256\"}],\"name\":\"setDevFeePercent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"giveawayFee\",\"type\":\"uint256\"}],\"name\":\"setDevelopmentFeePercent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"_enable\",\"type\":\"bool\"}],\"name\":\"setEnableAntiBot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"liquidityFee\",\"type\":\"uint256\"}],\"name\":\"setLiquidityFeePercent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"giveawayFee\",\"type\":\"uint256\"}],\"name\":\"setMarketingFeePercent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"maxTxPercent\",\"type\":\"uint256\"}],\"name\":\"setMaxTxPercent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_presale\",\"type\":\"address\"}],\"name\":\"setPresaleAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"taxFee\",\"type\":\"uint256\"}],\"name\":\"setReflectionFeePercent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"_enabled\",\"type\":\"bool\"}],\"name\":\"setSwapAndLiquifyEnabled\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_swap\",\"type\":\"uint256\"}],\"name\":\"setTokensToSwap\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"_enabled\",\"type\":\"bool\"}],\"name\":\"setTradingIsEnabled\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_maxWalletBalance\",\"type\":\"uint256\"}],\"name\":\"setWalletBalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"swapAndLiquifyEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalFees\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"tradingIsEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"uniswapV2Pair\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"uniswapV2Router\",\"outputs\":[{\"internalType\":\"contract IUniswapV2Router02\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"devWalletAddress\",\"type\":\"address\"}],\"name\":\"updateDevWalletAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"developmentWalletAddress\",\"type\":\"address\"}],\"name\":\"updateDevelopmentWalletAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"marketingWalletAddress\",\"type\":\"address\"}],\"name\":\"updateMarketingWalletAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]",
8
"ContractName":"LOTUS",
9
"CompilerVersion":"v0.8.9+commit.e5eed63a",
10
"OptimizationUsed":"1",
11
"Runs":"999999",
12
"ConstructorArguments":"",
13
"EVMVersion":"Default",
14
"Library":"",
15
"LicenseType":"None",
16
"Proxy":"0",
17
"Implementation":"",
18
"SwarmSource":"ipfs://fbcc2ee61300cb243ea4af6776ec71c77178c9d3dbd261e697776a1dd0e79072"
19
}
20
]
21
}
Copied!

Verify Source Code

Submits a contract source code to Etherscan for verification.
See Demo Source Verification Submission Code at Source Code Verification Sample.
  1. 1.
    Requires a valid Etherscan API key, it will be rejected otherwise
  2. 2.
    Current daily limit of 100 submissions per day per user (subject to change)
  3. 3.
    Only supports HTTP POST due to max transfer size limitations for HTTP GET
  4. 4.
    Supports up to 10 different library pairs
  5. 5.
    Contracts that use "imports" will need to have the code concatenated into one file as we do not support "imports" in separate files.
  6. 6.
    List of supported solc versions, only solc version v0.4.11 and above is supported e.g. v0.4.25+commit.59dbf8f1
  7. 7.
    Upon successful submission you will receive a GUID (50 characters) as a receipt
  8. 8.
    You may use this GUID to track the status of your submission
  9. 9.
    Verified Source Codes will be displayed at the Verified Contracts page.

Source Code Submission Gist

👇
Note: Upon successful submission, a GUID is returned, which can be used to check for submission status.
1
//Submit Source Code for Verification
2
$.ajax({
3
type: "POST", //Only POST supported
4
url: "//api-goerli.etherscan.io/api", //Set to the correct API url for Other Networks
5
data: {
6
apikey: $('#apikey').val(), //A valid API-Key is required
7
module: 'contract', //Do not change
8
action: 'verifysourcecode', //Do not change
9
contractaddress: $('#contractaddress').val(), //Contract Address starts with 0x...
10
sourceCode: $('#sourceCode').val(), //Contract Source Code (Flattened if necessary)
11
codeformat: $('#codeformat').val(), //solidity-single-file (default) or solidity-standard-json-input (for std-input-json-format support
12
contractname: $('#contractname').val(), //ContractName (if codeformat=solidity-standard-json-input, then enter contractname as ex: erc20.sol:erc20)
13
compilerversion: $('#compilerversion').val(), // see https://goerli.etherscan.io/solcversions for list of support versions
14
optimizationUsed: $('#optimizationUsed').val(), //0 = No Optimization, 1 = Optimization used (applicable when codeformat=solidity-single-file)
15
runs: 200, //set to 200 as default unless otherwise (applicable when codeformat=solidity-single-file)
16
constructorArguements: $('#constructorArguements').val(), //if applicable
17
evmversion: $('#evmVersion').val(), //leave blank for compiler default, homestead, tangerineWhistle, spuriousDragon, byzantium, constantinople, petersburg, istanbul (applicable when codeformat=solidity-single-file)
18
licenseType: $('#licenseType').val(), //Valid codes 1-12 where 1=No License .. 12=Apache 2.0, see https://goerli.etherscan.io/contract-license-types
19
libraryname1: $('#libraryname1').val(), //if applicable, a matching pair with libraryaddress1 required
20
libraryaddress1: $('#libraryaddress1').val(), //if applicable, a matching pair with libraryname1 required
21
libraryname2: $('#libraryname2').val(), //if applicable, matching pair required
22
libraryaddress2: $('#libraryaddress2').val(), //if applicable, matching pair required
23
libraryname3: $('#libraryname3').val(), //if applicable, matching pair required
24
libraryaddress3: $('#libraryaddress3').val(), //if applicable, matching pair required
25
libraryname4: $('#libraryname4').val(), //if applicable, matching pair required
26
libraryaddress4: $('#libraryaddress4').val(), //if applicable, matching pair required
27
libraryname5: $('#libraryname5').val(), //if applicable, matching pair required
28
libraryaddress5: $('#libraryaddress5').val(), //if applicable, matching pair required
29
libraryname6: $('#libraryname6').val(), //if applicable, matching pair required
30
libraryaddress6: $('#libraryaddress6').val(), //if applicable, matching pair required
31
libraryname7: $('#libraryname7').val(), //if applicable, matching pair required
32
libraryaddress7: $('#libraryaddress7').val(), //if applicable, matching pair required
33
libraryname8: $('#libraryname8').val(), //if applicable, matching pair required
34
libraryaddress8: $('#libraryaddress8').val(), //if applicable, matching pair required
35
libraryname9: $('#libraryname9').val(), //if applicable, matching pair required
36
libraryaddress9: $('#libraryaddress9').val(), //if applicable, matching pair required
37
libraryname10: $('#libraryname10').val(), //if applicable, matching pair required
38
libraryaddress10: $('#libraryaddress10').val() //if applicable, matching pair required
39
},
40
success: function (result) {
41
console.log(result);
42
if (result.status == "1") {
43
//1 = submission success, use the guid returned (result.result) to check the status of your submission.
44
// Average time of processing is 30-60 seconds
45
document.getElementById("postresult").innerHTML = result.status + ";" + result.message + ";" + result.result;
46
// result.result is the GUID receipt for the submission, you can use this guid for checking the verification status
47
} else {
48
//0 = error
49
document.getElementById("postresult").innerHTML = result.status + ";" + result.message + ";" + result.result;
50
}
51
console.log("status : " + result.status);
52
console.log("result : " + result.result);
53
},
54
error: function (result) {
55
console.log("error!");
56
document.getElementById("postresult").innerHTML = "Unexpected Error"
57
}
58
});
Copied!

Check Source Code Verification Submission Status

1
//Check Source Code Verification Status
2
$.ajax({
3
type: "GET",
4
url: "//api-goerli.etherscan.io/api",
5
data: {
6
apikey: $('#apikey').val(),
7
guid: 'ezq878u486pzijkvvmerl6a9mzwhv6sefgvqi5tkwceejc7tvn', //Replace with your Source Code GUID receipt above
8
module: "contract",
9
action: "checkverifystatus"
10
},
11
success: function (result) {
12
console.log("status : " + result.status); //0=Error, 1=Pass
13
console.log("message : " + result.message); //OK, NOTOK
14
console.log("result : " + result.result); //result explanation
15
$('#guidstatus').html(">> " + result.result);
16
},
17
error: function (result) {
18
alert('error');
19
}
20
});
Copied!

Verify Proxy Contract

Submits a proxy contract source code to Etherscan for verification.
  1. 1.
    Requires a valid Etherscan API key, it will be rejected otherwise
  2. 2.
    Current daily limit of 100 submissions per day per user (subject to change)
  3. 3.
    Only supports HTTP post
  4. 4.
    Upon successful submission you will receive a GUID (50 characters) as a receipt
  5. 5.
    You may use this GUID to track the status of your submission
  6. 6.
    Verified proxy contracts will display the "Read/Write as Proxy" of the implementation contract under the contract address's contract tab

Verifying Proxy Contract using cURL

Request
Response
1
// example with only the mandatory contract address parameter
2
curl -d "address=0xcbdcd3815b5f975e1a2c944a9b2cd1c985a1cb7f" "https://api-goerli.etherscan.io/api?module=contract&action=verifyproxycontract&apikey=YourApiKeyToken"
3
4
// example using the expectedimplementation optional parameter
5
// the expectedimplementation enforces a check to ensure the returned implementation contract address == address picked up by the verifier
6
curl -d "address=0xbc46363a7669f6e12353fa95bb067aead3675c29&expectedimplementation=0xe45a5176bc0f2c1198e2451c4e4501d4ed9b65a6" "https://api-goerli.etherscan.io/api?module=contract&action=verifyproxycontract&apikey=YourApiKeyToken"
Copied!
1
// OK
2
{"status":"1","message":"OK","result":"gwgrrnfy56zf6vc1fljuejwg6pelnc5yns6fg6y2i6zfpgzquz"}
3
4
// NOTOK
5
{"status":"0","message":"NOTOK","result":"Invalid API Key"}
Copied!

Checking Proxy Contract Verification Submission Status using cURL

Request
Response
1
curl "https://api-goerli.etherscan.io/api?module=contract&action=checkproxyverification&guid=gwgrrnfy56zf6vc1fljuejwg6pelnc5yns6fg6y2i6zfpgzquz&apikey=YourApiKeyToken"
Copied!
1
// OK
2
{"status":"1","message":"OK","result":"The proxy's (0xbc46363a7669f6e12353fa95bb067aead3675c29) implementation contract is found at 0xe45a5176bc0f2c1198e2451c4e4501d4ed9b65a6 and is successfully updated."}
3
4
// NOTOK
5
{"status":"0","message":"NOTOK","result":"A corresponding implementation contract was unfortunately not detected for the proxy address."}
Copied!
Last modified 2mo ago