New answers tagged tokens
0
votes
How this honeypot token is able to fool the checkers? How does it figure out how the transfer function is called - via mined or simulated transaction?
So Vlad, Were you able to sell a honeypot token?
- 1
0
votes
Deposit DAI on test account
The method I usually use consists in impersonating a "whale" account and sending the tokens to me.
Start by going over etherscan in the page of the token, go to "Holders" and pick ...
- 1,710
1
vote
How can i input 0.001 value in solidity?
You can use exponential notation to do this:
uint256 value = 0.001e18;
Just make sure to write e18, since 1 ETH = 10^18 wei.
- 14.7k
1
vote
NFTs having the same URI
Hi developer advocate from Chainstack here.
An NFT is actually a smart contract that keeps the owners' information. Taking BAYC as an example, its address is 0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d....
- 494
0
votes
How can i input 0.001 value in solidity?
The only unit of value that we have that can be used to store decimal are the wei and the gwei.
But what's the wei ? It's the unit used for gas.
How can we get a random number and convert it to wei ?
...
- 1
0
votes
Deposit DAI on test account
Hi Developer advocate from Chainstack here.
You should deploy your own DAI and USDC! So basically all tokens are smart contracts.
All you need to do is just copy the source code from here and deploy ...
- 494
1
vote
How can i input 0.001 value in solidity?
Hi Developer advocate from Chainstack here.
Basically solidity doesn't support float point calculation.
If you are talking about Eth, the basic value of Solidity is Wei. So 0.5 eth is equivalent to ...
- 494
0
votes
View all NFTs owned by specific Ethereum wallet
Check out Alchemy docs. They have interesting solutions for this purpose.
https://docs.alchemy.com/reference/nft-api-quickstart
After initialization, you must come across a single line of code, such ...
- 155
1
vote
Accepted
mapping won't save and or return balances
Are you sure the if statement is passed?
contract Test {
mapping(address => uint256) public balances;
function checkAndDistributeReward(address root) public {
// if (hasEvenSubtrees(root)) {
...
- 187
0
votes
Etherscan - bought tokens but balances is 0
Though some amount was sent to 0xd54c73e53bf6e569d134e378a9bd179d960068b8 in your sample transaction, but later in https://etherscan.io/tx/...
- 689
0
votes
Uniswap read contract (klast, getReserves, price0CumulativeLast, price1CumulativeLast)
The kLast function likely returns the latest value of the "k" variable in the smart contract. Without more context about the specific contract and its intended use, it is difficult to say ...
- 64
0
votes
Accepted
Uniswap read contract (klast, getReserves, price0CumulativeLast, price1CumulativeLast)
price0CumulativeLast and price1CumulativeLast are indeed the latest prices of their respective tokens in Ether.
getReserves is a function that returns the current liquidity of both tokens and the ...
- 156
0
votes
Accepted
error: {'code': -32000, 'message': 'invalid sender'}
The problem was that web3py library has some problems, when working with BSC.
The problem was that BSC requires gasPrice included into transaction. So, after modifying the code as follow:
mint_tx = ...
- 101
0
votes
How get the mint price from contract and max supply not total supply
Unfortunately, like Lauri said in prev post, there is no one standard or even any commonly used pattern.
The only solution I can think about here is to pre-approve contracts in your application with ...
- 136
0
votes
How get the mint price from contract and max supply not total supply
There aren't any standards (at least any that would be in use) for setting the mint price. So everyone implements it in their own way. Therefore there is no universal way to retrieve it - and many ...
- 26.7k
0
votes
Transfer an NFT token from Polygon to Ethereum - Solidity smart contract
There is no simple way of doing this and it is not inherently supported by either of the chains.
You would need to implement an NFT bridge, which would either lock or burn the asset on one chain and ...
- 338
0
votes
How would an nft marketplace structure their smart contracts to pay out "creator shares"?
There are basically 2 options on how to implement this:
Implement EIP-2981 in your NFT contract, however not all NFT marketplaces support the standard. Since the standard only directs how to give ...
- 338
0
votes
How to host token gated content on Wix website
Since you are using thirdweb I am assuming you know how to get the wallet address.
You can use 3rd party web3 APIs services like Moralis to get the NFTs owned by a wallet on a specific smart contract.
...
0
votes
Developing a Staking and Un-staking Smart Contract
For your reference that was a project on BSC before.
*It's a Ponzi mechanism there. Don't try it.
https://bscscan.com/address/0x1b81f2267d957ce9d041d547593dac9bdf68f819#code
- 111
0
votes
Accessing funds that are sent to the smart contract address
Withdrawing ether
This function may be working with your contract correctly and let me know it working correctly or not.
function withdraw() public onlyOwner {
(bool success, ) = owner.call{...
2
votes
Can't make buy function work on ERC20
First of all, your code doesn't make sense, you are expecting BuyTicketsNow and then overriding it.
Either you should check if amount is a multiplier of ticket price, or expect number of tickets and ...
- 136
0
votes
Snapshot of balances of all token holders at a particular block
Radiant is exactly doing that, the tool: https://segment.radiant.so/ and the API docs: https://docs.radiant.so
- 116
1
vote
How to create a smart contract factory that inherits its token?
You can create a modifier to have privilege access to those token contracts. What you need is an interface for it and some functions from the factory contract to manage the state of the children ...
- 536
1
vote
How to create a smart contract factory that inherits its token?
Depends on what you mean by "use". If you only want to call its functions, you can import the IERC20 interface and call its functions like this:
(smartContract1Address).transferFrom(from,to,...
- 338
0
votes
How to host token gated content on Wix website
I was trying to achieve the same for one of my Wix website and I could get it working to some extent. I created Web3.js code snippet for token gating and added in on my Wix site using injected ...
2
votes
Coinbase says my balance is on the Ethereum network. What does this mean?
There are multiple blockchains where tokens are stored. Your tokens are on Ethereum
- 566
0
votes
Where to find new ERC20 tokens?
You can listen to the dex contract address for when a pair is created using Moralis streams API, you will receive webhooks which you can use to create a notification system.
Here you can find an ...
0
votes
How to mint or release a new token every second?
Another option would be algorithmic minting and some dispatcher method. For example,
the contract stores the time when the minting for the user was started or was for the last time.
the contract has ...
- 689
1
vote
How to mint or release a new token every second?
Yes, this is possible using the Sablier protocol (Disclosure: I'm part of of the team at Sablier). The protocol allows you to stream ERC-20 tokens, where every second a fraction of the total amount is ...
0
votes
Is it possible to simultaneously call a method from the children's smart contract by the parent's smart contract?
Yes, you can batch multiple transactions in one. just make a for loop, that calls each contracts transfer function. I presume all child contract have the same layout? You could do something like:
...
- 338
1
vote
Accepted
Contract mints token id 0 ERC721A
NFTs always go from 0 and then usually to 9999. Take BAYC for example: https://opensea.io/assets/ethereum/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d/0
But if you wish to start with id = 1, then theres ...
- 338
0
votes
How to mint or release a new token every second?
You can mint a token on every block but not on every second because at least on EVM one block costs more than that to me mined.
- 536
3
votes
How to mint or release a new token every second?
minting every second is not feasible as the blockchain produces blocks every 10-12 seconds and as the blockchain executes the transaction when the block is pushed to the blockchain. You could only ...
- 437
1
vote
How to mint or release a new token every second?
Yes, it is possible to make a function that mints every second.
The answer to your question can be divided into 2 parts.
Minting every second
After creating the mint function, you will have to call ...
- 11
0
votes
Contract mints token id 0 ERC721A
_safeMint generally mint the tokenId supplied to the function
_safeMint(msg.sender, tokenId)
Here is a working example with ERC721 smart contract
Counters.Counter private _tokenIdTracker;
........
...
- 146
0
votes
Contract mints token id 0 ERC721A
I'm not an NFT expert but the tokenIds is an array and an array aways start with index 0. In mine NFT projects i always deploying the tokenId to the deployers address, this tokenURI usually pointed to ...
- 536
1
vote
Accepted
How to check if safeTransferFrom succeeded?
By listening to Transfer(from, to, tokenId) event.
https://docs.openzeppelin.com/contracts/2.x/api/token/erc721#IERC721-Transfer-address-address-uint256-
Or
contract.safeTransferFrom(params
.then(...
- 536
1
vote
Accepted
A question about ERC-20 Token
All transactions require gas to execute. The gas cost is paid with the network's native asset - in BSC it's BNB and in Ethereum it's Ether. So anyone who wants to transfer ERC20 tokens have to have ...
- 26.7k
0
votes
Accepted
Amateur Questions
I'd say that your only cost will be deploying the contract.. but the users will have to pay gas everytime they do anything in game that requires a change of state in the Blockchain
Using a "nft&...
- 628
0
votes
After a year this token stopped working
As I can see that the factory address of Moonlift protocol has pair of busd-mlpt token, you should be able to easily remove liquidity from the router of Moonlist Protocol. Given is the router address ...
- 146
0
votes
Where to find new ERC20 tokens?
You have multiple ways to do it, using online service or checking the blockchain yourself:
Check the blockchain: DEX listing is simply people creating trading pair on popular dex (Uniswap, SushiSwap, ...
- 1,344
1
vote
Is it possible to earn "income" by doing work on some aspect of Ethereum beyond running a node?
Okay.. here is my longshot:
Q: All I want to know is if mining / running nodes is pretty much the only way you can make money by contributing to a blockchain itself?
A: No, you can also have income if ...
- 628
0
votes
How to transfer all the coins that an account may have?
Firstly you will need to have enough ETH in the wallet for the transaction, otherwise, you will not be able to send anything.
Secondly most tokens on ETH chain are following the ERC20 standard, which ...
- 338
1
vote
Get last contract list
At the end of the url you have apikey=xxxx. You should create your own API key on etherscan and replce xxxx with it.
- 338
0
votes
cross chain token
Within a centralizer process. Wrapped tokens such as WBTC you need to send some BTC to an centralized project that can mint WBTC in the desirable chain for you. And even among dexes in the same chain ...
- 536
0
votes
How do I send multiple transactions as one transaction?
I always use this Token MultiSender (BlockBucket) just because the fees are 0.01 ETH compared to the other app which is 0.09 ETH per transaction.
Looked at Etherscan just to check it's all legit and ...
- 36
1
vote
Accepted
What is the best way to apply for a Job as a Smart Contract engineer?
You should learn the newer development framework foundry because it has much more advanced testing capabilities and all of the top teams use it. Almost no projects use truffle.
Learning how to write ...
- 26
1
vote
How can I get the token symbol from the token contract address using Node.js?
In node.js we can achieve this by using multiple libraries like web3js , etherjs
I will give you an example of web3js
const contract = new web3.eth.Contract(abi,contractAddress);
const symbol = await ...
- 71
1
vote
Accepted
Token approval questions and issues
It asks for approval again because you used all the allowance on your first transfer.
There is a fundamental error in how you understand approval.
When you approve the DEX to spend 10 000 of your ...
- 1,687
0
votes
how does this honeypot works on BSC - it allows swapping from BNB but not reverse, can't even add BNB liquidity using it
Classic honeypot. If you want to swap back to BNB the following occurs:
You create a swap transaction in the Pair Contract via the Pancake Router.
The Pair Contract(LP) tries to transfer the amount ...
- 689
Top 50 recent answers are included
Related Tags
tokens × 2346solidity × 761
erc-20 × 660
contract-development × 373
ether × 190
contract-design × 166
web3js × 147
remix × 145
transactions × 142
blockchain × 134
go-ethereum × 133
nft × 119
ico × 107
erc-721 × 94
contract-deployment × 81
etherscan × 81
crowdsale × 81
smart-contract-wallets × 70
metamask × 63
wallets × 62
uniswap × 60
ethereum-wallet-dapp × 56
gas × 50
exchanges × 50
myetherwallet × 46