Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
A token is a transferable, divisible object on the blockchain, such as a subcurrency or a prediction market share.
1
vote
Accepted
Does a smart contract track ERC-20 balances?
Also, an address that holds a token does not necessarily own it (such as with lending protocols, custodians, wrapped tokens, etc.).
The most widely accepted library is OpenZeppelin. …
1
vote
Accepted
Can't understand the mapping inside mapping
User A owns 10000 tokens, but user B owns none. User A can of course transfer its tokens, but he would also like user B to be able to transfer his tokens on his behalf. … The allowance is how many tokens B can transfer on behalf of user A (so, the initial approve amount minus any transfer made by user B for user A tokens). …
3
votes
Accepted
Does my token approval for trading on Uniswap expire after a certain time?
If it does, there are two possibilities:
It is not the same token (watch out for scam tokens that have the same name);
You are not using the same address as the one you did the approval with (check which …
1
vote
How to simulate buy?
As you can see from the pancakeswap contract code, this error is triggered by this:
require(amountIn > 0, 'PancakeLibrary: INSUFFICIENT_INPUT_AMOUNT');
The contract thinks that the amount that you ar …
2
votes
Setting token price on a Dex
Prices are set by the market. The best practice is to set the price to its fair value on the market.
If there is no market yet, you have to evaluate it. This is basically what investment banks will do …
0
votes
Accepted
How the exchange calls my Smart Contract methods?
It is the latter.
Your contract must absolutely conform to the ERC20 standard. You cannot use a function such as your TransferTokens function.
Pancakeswap (and pretty much everyone else also), will ca …
0
votes
Question regarding cryptocurrencies backed by commodities aka stablecoins
What makes a commodity or a fiat-backed stablecoin stable is its ability to be exchanged for a pre-determined amount of the commodity or fiat money in question.
You do not need to control the price at …
1
vote
How To Verify A Coin Without Original Contract Source Code?
I am not aware of a solution for this.
Etherscan will recompile the contract that you provide with the parameters that you provide. If the result matched the deployed bytecode, it will mark the contra …
2
votes
Accepted
Uniswap/Pancakeswap SWAP swapExactTokensForTokens / swapExactETHForTokens FAILED (Sniping Bot)
Before swaping a token (such as WETH), you have to approve a sufficient amount to the router address.
Use the approve() function of the token contract before attempting the swap.
0
votes
I need to know how to set a maximum buy limit per wallet
In the function that allows purchasing tokens (probably mint()), simply include a require check along those lines:
require((balanceOf(msg.sender) + _mintAmount) <= maximumLimit, "Cannot exceed limit"); …
2
votes
Total supply of deployed token is wrong
This means that to represent the amount of token an address has, or the totalSupply in circulation, you have to divide the number of tokens by 10^18. … So, 1000000 / 10^18 = 0.000000000001
Here is a useful converter.
function ERC20Token(
) {
balances[msg.sender] = 100000; // Give the creator all initial tokens (100000 for example …
1
vote
About smart contract
In theory, yes you could by learning the language of Ethereum smart contracts, Solidity.
In practice, if you don't already know how to code, you will have a hard time understanding Solidity. It has it …