Questions tagged [tokens]

A token is a transferable, divisible object on the blockchain, such as a subcurrency or a prediction market share.

Filter by
Sorted by
Tagged with
0
votes
1answer
14 views

Transfer of ERC-20 tokens fails, even though smart contract has enough token balance

I am trying to develop a buy function for my token smart contract, but it fails on the transfer: transfer(msg.sender, amountToBuy); It fails with the Error: 'ERC20: transfer amount exceeds balance', ...
0
votes
1answer
41 views

How do you validate a Token is USDC or any specific Token?

For my usecase I want to check if msg.value, sent to my smart contract, is actually 10 USDC and not any Shitcoin. Is this done with the approve function of ERC20 interface? Because right now I have ...
0
votes
1answer
90 views

Error occurred when trying to execute this swap in Uniswap V2

I’m trying to buy AHOUSE/weth and I get the “error occurred when trying to execute this swap” message. I try buying it with usdc, and eth. I try increasing the gas but nothing worked. I looked on ...
1
vote
1answer
117 views

Fetch vesting schedule for a token in an account by using web3.py

Private investors usually have tokens locked in their wallet and released by a specific schedule. I want to find this schedule for any given token contract address and a given wallet address (function ...
0
votes
0answers
337 views

How to program an NFT with multiple layers?

NFTs with multiple layers are being made now. e.g. an NFT made of different images sometimes owned by different artists. These NFTs are referred to as programmable NFTs, async NFTs and or dynamic NFTs....
1
vote
1answer
370 views

Lazy minting contract - How to deal with unique (off-chain) metadata

Let's say I want to create a digital card collection. I create the metadata and image parts, and then combine them. So now I have a few thousand unique images. Now I want people to be able to lazy ...
0
votes
0answers
56 views

Cannot verify contract on etherscan: "Error! Invalid constuctor arguments provided" after compiling and deploying an existing smart contract

I am experimenting with ERC721 smart contracts and the minting of new NFTs. I tried compiling on remix and deploying on ropsten an existing smart contract that I found on the blockchain and that I ...
1
vote
0answers
16 views

practicing solidity to make tokens [duplicate]

PLZ share your knowledge. I'm a blockchain developer and i have just learnt soilidity but i dont have any previous experience with coding so i need a lot of practice to continue. MY QUESTION From ...
0
votes
1answer
116 views

What happens when a token is minted on multiple chains?

Let's say we have total supply of a token set at 10,000,000. There are 9,999,999 tokens at the moment. What if at the same time a token is minted on both Polygon and Ethereum?
0
votes
1answer
44 views

truffle migrate doesnt do anything

Update: I ran truffle develop and it was still conencted to my old ganache blockchain. How do I update it? whenever I run truffle migrate it compiles my contracts then just ends, it doesn't run the ...
1
vote
0answers
47 views

Compiling contract failes

I want to create crowdsale, but when compiling contracts i got: Compiling your contracts... =========================== > Compiling ./contracts/Migrations.sol > Compiling ./contracts/TubblySale....
0
votes
1answer
39 views

Is it possible to intercept a message sent to a smart contract (i.e. a guess for a quiz) and send it as your own before the original reaches it?

I'm trying to write a smart contract that can be generated by an individual given ETH/ERC-20 value to lock and a secret passphrase (hashed). Then, given that another individual sends the passphrase in ...
0
votes
1answer
88 views

Creating tokens on BSC mainnet vs BSC testnet

I am starting to test with creating tokens. My contracts deploy correctly in mainnet but fail to deploy on testnet (the transaction gets reverted). What are the main differences between mainnet and ...
1
vote
2answers
49 views

How to send token instead of eth with web3?

I have a function that sends eth to a function in a contract with web3: await contract.methods.withdraw(i).send({ from: from }); debug("withdraw in battle: "+i); } I would like ...
0
votes
1answer
41 views

How to create a token that is minted upon purchase?

I want to test a token system that goes like this: Deposit _token, receive x amount of token0. But I hope for token0 to be minted upon deposit. Using openzepellin standards what do I need to do for ...
0
votes
0answers
21 views

Why is total supply different then coinmarketcap and total supply of contacts?

Why is total supply different then coinmarketcap and total supply of ethers.js (or bscscan)? Coinmarketcap shows 1,000,000,000 UNI but, ethers.js shows 3699999999999999999999999.
0
votes
0answers
104 views

web3 getPastEvents() returns empty array

I am listening to the events of a contract running on the ethereum network at https://etherscan.io/address/0x6b175474e89094c44da98b954eedeac495271d0f and I am connecting through infura.io mainnet ...
0
votes
0answers
49 views

What is the best method to get all holders of a Token?

I'm looking for something similar to Etherscan's "Holders" tab, but I need the info delivered via web3 or web API to a script. Blockscout has a mainnet RPC but it is currently down and ...
0
votes
0answers
17 views

Transferring tokens with Geth: what's outdated about this tutorial?

I'm using this e-book to learn about using go-ethereum, but it's pretty outdated. I'm on the part about transferring tokens and I'm getting an invalid opcode when estimating gas. I have a private key ...
0
votes
0answers
26 views

WBTC and Compound UDT approve does not work on rinkeby

Here is WBTC code and here is Compound USDT code I am trying to interact with. here is a brief of my code: Imports: import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/...
1
vote
1answer
246 views

3 questions about bridging tokens between Polygon and Ethereum

I have an ERC721 token deployed on Polygon that I want to bridge into Ethereum. I'm having a hard time figuring out how bridges and layer 2 work, so I have a few questions about this workflow. 1 - I ...
0
votes
1answer
23 views

ERC20 token creation

If I create an ERC20 token using a smart contract, how do I reference a contracts ethereum balance? Or do I just need to update some value like --> ethStore and then send transfers based on that ...
0
votes
1answer
17 views

Got the problem with getting ABI

This is my code:https://gist.github.com/Puregass/f3ef64b9722c77a9290ad6369cd11172 Remix.etherium can't create ABI for my contract.How can I fix it ?
0
votes
1answer
139 views

MetaMask API - How to detect if token already registered?

I'd like to prevent a user from entering my dapp until they have registered my token with MetaMask. I accomplish this using the code below, which is executed the moment the user is about to enter the ...
0
votes
0answers
31 views

How does ethhedge work?

I didn't understand how ethhedge token work. I have read a contract of ethhedge on ethscan. It seems that it is connected with a variable called leverage, but I couldn't google what it is. Where can I ...
0
votes
1answer
20 views

How do I call a function of an already deployed contract several times in one transaction?

Assuming I have: Contract A: function X(address) {}; Contract B: function multipleExecuter(){} Where Contract A is not mine and is an already deployed contract i.e. I have the address and source ...
0
votes
0answers
55 views

How do I change the data of my NFT?

I have a ERC-721 NFT with it's meta-data attached to a URI of the file on IPFS. Part of the game I'm designing requires the NFT to level up, and thus change data. How can I change or update data on an ...
0
votes
0answers
14 views

Is it possible to create a vesting contract for NFT?

Creating vesting contract for NFT(erc721)? We have token vesting smart contract, but how about NFT? Can it be vested on a smart contract?
0
votes
1answer
94 views

Can I create a multi-wallet in web3 that can store/receive/send other tokens like shiba, safemoon etc?

Please am totally a novice in eth and web3 stuff I managed to know how to create wallets in web3 but the part am totally not getting is.. I don't know if this wallets can be used to receive/store ...
0
votes
0answers
376 views

How to transfer USDT out of a smart contract? [duplicate]

I'm having a trouble trying to solve this task: I created a very simple smart contract that should call a function in the external smart contract and transfer tokens. Here's my contract code: pragma ...
0
votes
0answers
16 views

Access ETH transactions for analytic purposes

I would like to do some data analytics with ETH transactions. With my little knowledge in this field, I am looking for an easy way to access the transactions. Are there any 3rd party platform/ APIs ...
0
votes
1answer
44 views

is this possible to divide the percentage of split for token?

Hi I am very new in Ethereum and smart contract development and trying to make a smart contract where a token can be divided or we can say can be spliced into two parts for e.g, we have 1ETH, we ...
0
votes
0answers
24 views

forwarding token and ether after receiving payment

situation: I am trying to write a smart contract, which is forwarding 50 tokens I created to the msg.sender, after it receives 1 ETH from the msg.sender. It also forwards this 1 ETH to a certain ...
0
votes
1answer
62 views

Mint x tokens Every Block and Reduce Minted Tokens By % after n blocks and distribute rewards among participants?

I am creating a contract that mints 'x' tokens per block and drops 20% after 'n' blocks. Also these tokens get distributed to the participants of the network. Say Bob and Jen are the only two in the ...
0
votes
0answers
70 views

SwapExactTokensForETH is called instead of TransferFrom

I developed a smart contract which calls PCS router V2 to get some data, however I don't know what I did to change the way it works and now when I interact with it via PancakeSwap the method called is ...
0
votes
1answer
28 views

What are some real uses of ERC20 Tokens?

Hello I am pretty new to the world of crypto and as far as I understand Tokens are basically ERC20 contracts written in the Solidity and deployed on the Ethereum blockchain. I understand people buying ...
0
votes
1answer
26 views

How to Update a function after 'n' amount of time?

I am trying to update the amount of tokens minted after 'n' amount of time. For example every 90 days the token will be minted 20% less. In my code here i am trying to test it using seconds instead ...
0
votes
1answer
55 views

Betting Smart contract using Token (Bep-20/erc20) instead of ether/bnb?

This is my betting contract using eth/bnb, how can I change eth/bnb to token as their betting payment https://github.com/laronlineworld/BettingCOD/blob/main/BettingCOD.sol Code for Betting function ...
0
votes
0answers
13 views

Is it possible to do privacy preserving token metadata sharing between Ethereum and a TEE

Is it possible to do a privacy preserving ERC 721 / ERC 1155 token metatadata transfer between Ethereum Layer 1 Smart Contract based Token Vault and a Trusted Execution Environment like Intel SGX or ...
0
votes
1answer
87 views

Send ERC20 token from a forwarder contract address to another address

I am having difficulty spending the funds in a smart contract address. The smart contract address was generated using an ETH forwarder smart contract - https://github.com/primozkocevar/SigWallet-ERC20/...
0
votes
0answers
38 views

Buy Function doesn't work ERC20 Token

Hi i want to write a buy function for my ERC20 Token this is my ERC20 Source pragma solidity ^0.4.21; contract SafeMath { function safeMul(uint256 a, uint256 b) internal pure returns (uint256) {...
0
votes
0answers
28 views

add custom bep20 token in trust wallet through deep linking

I am trying to add my custom smartchain token to trust wallet through Deep Linking url but it is working for ETH network only. When my link https://link.trustwallet.com/add_asset?asset=...
0
votes
0answers
60 views

Build with Library IterableMapping

I'm trying to compile my contract, which uses the IterableMapping library. IterableMapping is being created in the file itself, but even so, apparently an error is being raised, saying that I should ...
0
votes
1answer
45 views

Setting token price on a Dex [closed]

There are various opinions and parameters when it comes to the setting of a token price. What are the best practices when setting the token price on a Dex?
0
votes
1answer
890 views

How to remove Fake token contact signed

I participated in multiple airdrops and recently checked the account on etherscan which was showing multiple Coins in my wallet... I approved one of them and got some sort of "sign" pop up ...
0
votes
1answer
87 views

Verify and Publish in BSC Scan not working

I have a contract, where I compiled it optimized in 200. When I go to publish in BSC Scan, it gives me some messages as attached. I'm informing in bsc scan the optimization in 200. It points out ...
0
votes
0answers
12 views

ERC 721 Token to Ledger "Swap Only"

Attempting to sent ERC 721 token to Ledger and am only given the option to "swap" the token not "send" Anyone else seen this issue with tokens?
0
votes
0answers
29 views

Wierd exploit in auto-liquidity token

i dont know if this is a known exploit or not, but this caught my attention. It seems that address on mainnet is a contract (unverified of course) that takes advantage of a vulnerability somewhere ...
0
votes
1answer
73 views

Metamask Chrome extension can't send deployed ERC721?

I deployed an ERC721 token on bsc testnet, added it to Metamask Chrome extension. It shows up correctly, but the button "send" is faded out. Am I missing something?
0
votes
0answers
58 views

Token contract can't retrieve the allowance

https://ethereum.org/en/developers/tutorials/transfers-and-approval-of-erc-20-tokens-from-a-solidity-smart-contract/ I was trying this tutorial in Remix IDE. But I couldn't get the sell function to ...

1 2 3
4
5
41