4

Get the pool address Go to the Uniswap UI at https://app.uniswap.org/. Choose the token pair you want and then click the View pair analytics ↗. This will take you to a link like https://uniswap.info/pair/<poolAddress>. Note down poolAddress. Approve via Etherscan Go to https://etherscan.io/token/<tokenAddress>#writeContract where tokenAddress ...


4

If the contract did not initially include the possibility of sending Ether from it to some address, then the funds that came to it cannot be withdrawn (in public Ethereum). The only thing you can do is revise the contract code, that it really does not provide for such an opportunity.


3

Yes, technically the _spender can take up to 999999999999999000000000000000000 of your tokens. Unfortunately, this is common practice, as it makes token transactions of this nature more user-friendly. For example, once you have called approve() with this amount, you can now make many transactions without having to call approve() again, which technically ...


3

Most (if not all) of the wallets you mentioned are non-custodial, meaning that they do not control your funds. If a service were to go down, you can simply go to another and use your private key there. Funds are stored on the blockchain directly, not on the service itself. This is different from custodial wallets or services (e.g. Coinbase). Those services ...


3

When you mint the tokens in the constructor, you don't emit a Transfer event. So Etherscan doesn't know about the minting. constructor() public{ balances[msg.sender] = totalSupply_; } If you are creating ERC20 tokens you may want to look at the OpenZeppelin Contracts implementation to see if this meets your needs. See the documentation for ...


3

Why there are some contract addresses that do not have contract source code? Because the source code of a deployed contract becomes available on etherscan only after its author has verified it on etherscan.


3

The error-message INSUFFICIENT_OUTPUT_AMOUNT is thrown from the contract function, not from the transaction. It therefore has nothing to do with your gas-limit and gas-price configuration, and it most certainly has nothing to do with ETH/USD price. This error-message tells you that the output amount is smaller than the minimum that you've requested for (in ...


3

A good overview of frontrunning, and related miner extractable value (MEV), problems are well established and well known at this point. The difference between these two modes of frontrunning that in MEV it is the miners who frontrun you, whereas normal frontrunning bot use the same mempool for transactions are other Ethereum clients. Here are some articles ...


3

You are not providing enough information about your case, but most likely you have been front-run. When you are giving away free money on the blockchain, some people will take it. When you announce your request to buy some asset on Uniswap and you specify "my slippage is 100 bucks", you are giving away free money for the amount 100 bucks. If I have ...


2

It's an inconsistency of the different client implementations. go-ethereum (geth) uses the string execution reverted (source) OpenEthereum (fomerly parity) uses the string Reverted (source) The revert error message is returned when execution has been reverted with the REVERT opcode, so they are the exact same.


2

Change module=account to module=logs Change action=tokentx to action=getLogs Add topic0=0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef The last one is the hash of an ERC20 Transfer event. You can obtain it programmatically, for example, using web3.js v1.x: const Web3 = require("web3"); const TRANSFER_EVENT = Web3.utils.keccak256("...


2

That's exactly what Etherscan does - they have a list of tokens that they track. You'll then have to do a balanceOf query on each token with the address you want to get balance for. There is no central repository of token balances, since they are all their own individual contracts that just contain user balances. Edit: If you're querying balances directly ...


2

Token transfers The challenge with token transfers is that you can't detect them by monitoring the "receiving" address. Tokens are not explicitly transferred to an address - they are only assigned to an address inside the token contract. So whenever someone transfers tokens to address A he actually sends a transaction to the token contract at ...


2

Yes you can! I made an NPM package to help with this: eth-revert-reason. You can use that package to get the revert reason from a transaction with just the hash! It is hard to decode the revert reason in a generalized manner. Many different factors, such as web3.js vs. ethers, Geth vs. Parity, etc. will result in different results for all the answers posted ...


2

Adding a token to MetaMask (or any other wallet interface for that matter) does not "claim" the tokens. It simply tells MetaMask to look at that specific token for any balance. You can always receive tokens on your address, and add it to MetaMask later on in order to see your balance.


2

It must've been due to a too low gas price. Gas prices can be highly volatile so by the time your transaction arrives in the mem pool it may already be too low.


2

You are mostly correct in your analysis. Sending ETH from account A to account B will always cost (21000 * gasPrice). If you send ETH from account A to account B and C, you will have to do 2 transactions - A to B, then A to C. So you will pay twice as more fees (2 * 21000 * gasPrice). Examples: From A To B, C and D - 3 transactions (A-B, A-C, A-D), so 3 ...


2

ethapi.contract.getabi() returns a promise, not the ABI. You can take advantage of async await in order to wait for the promise response. async function getContractFromAddress(contractAddress) { let contractABI = (await ethapi.contract.getabi(contractAddress)).result let tokenContract = new web3.eth.Contract(contractABI,contractAddress) return ...


2

Short answer is: you have to create the API key at etherscan.io either for the mainnet and the rest of public testnets (Ropsten, Rinkeby, Goerli..). (Bonus) In addition, I had some issues when trying to verify a contract with interfaces located in subdirectories. Perhaps it is not your case, but if you are using Truffle to manage the contracts deployment, ...


2

In Remix: Whatever you pass to the bool parameter will become true except if you pass the value false. You can easily check this through a simple contract with Remix: pragma solidity ^0.8.1; contract Test { function isBool(bool check) external pure returns(bool) { if (check) return true; else return false; } } In Etherscan: ...


2

Let's see what happens here. In solidity v0.5.11, the end of the bytecode includes the following : 0xa2 0x65 627a7a7231 => "bzzr1" in hex 0x58 0x20 <32 bytes swarm hash> 0x64 736f6c63 -> "solc" in hex 0x43 <3 byte version encoding> 0x00 0x32 That's exactly what you have. In your two bytecodes ...


2

A contract can do some things that a regular address (EOA) cannot do: decrease gas costs by taking advantage of gas refunds (self destruct calls, e.g. CHI gas token) batch multiple contract calls into one transaction take a flashloan, make profit, repay it within a single transaction Frontrunners, arbitrageurs, etc. tend to employ such techniques. That's ...


2

then contracts have to pay for fee Not so. The contract doesn't pay fees. It's always the user. User sends a transaction that deploys a contract and the user pays for it. User sends a transaction to the contract and the user pays for the instructions that execute. It makes no difference if those instructions make the contract send funds. For example, the ...


1

What Etherscan checks, and what you are looking for, is the transaction receipt, which includes the status. There is a JSON-RPC call for this : eth_getTransactionReceipt (see here https://eth.wiki/json-rpc/API). I don't know web3j but the documentation refers to a method named Web3j.ethGetTransactionReceipt(<txHash>) (https://docs.web3j.io/transactions/...


1

After some comments we found the optimizer wasn't enabled The setting for the optimizer has to be modified to add a "enabled", so it look like this: "settings": { "optimizer": { "enabled": true, "runs": 999999 }, .... }


1

The transaction failed because your contract does not have any ETH balance and in your transaction to sendEther you also did not include any ETH. Try either to send ETH to the contract and afterwards call sendEther or directly call sendEther with enough ETH in the transaction.


1

Yes, via: http://api.etherscan.io/api?module=account&action=txlist&address=<XXX>&apikey=<YYY> Where XXX is your token address, and YYY is your Etherscan API key. The genesis block number of your token contract should be at the blockNumber field of the first entry, provided that the to field of that entry is empty. Otherwise, the ...


1

The following two functions caught my attention: // Absorb any tokens that have been sent to this contract into the pool function gulp(address token) external _logs_ _lock_ { require(_records[token].bound, "ERR_NOT_BOUND"); _records[token].balance = IERC20(token).balanceOf(address(this)); } ...


1

Regarding token recipients Any address can be the beneficiary, receiving ERC-20 and ERC-721 tokens (and also ERC-1155, ERC-777, and any other tokens). Regarding token contracts (the thing that emits the events) However, no, it is not possible for a token contract to both be an ERC-721 and an ERC-20 contract at the same time because those two specifications ...


1

That looks like the contract is the recipient of both types of tokens. The contract might have functionality to also transfer the tokens out of it but it might not. If it doesn't have such functionality the tokens simply stay there and can never be transferred out of it. You can't implement both of the standards in one contract as they have overlapping ...


Only top voted, non community-wiki answers of a minimum length are eligible