Questions tagged [erc20]

ERC-20 is a smart contract standard defining an interface and a set of rules for development of fungible tokens on the Ethereum platform.

462 questions
0
votes
1 answer

deposite and withdraw erc20 token using smart contract

my goal is to create a smart contract which user can deposit erc20 and withdraw erc20 token using.i tried to implement this functionality using token transfer and transferfrom functions tried to send tokens to contract address .but its showing some…
0
votes
1 answer

How To Run A Successful Solidity Smart Contract Test Script?

I have been following this tutorial by Gregory from Dapp University on how to create your own ERC20 token along with a crowd-sale smart contract. I have been successful so far, but I am stuck where I need to make the buytokens() function work so a…
AllJs
  • 1,760
  • 4
  • 27
  • 48
0
votes
1 answer

After compiling my erc20 token, can I modify any function?

I am getting into a Token project. Can I append more functions to the token and more smartcontract after compiling the token to the BSC, or is there nothing else to be done at that point?
0
votes
2 answers

Token (solidity) - Reward a user X amount of token from main app wallet with user paying the gas

Hello Everything is fine? I'm now starting to study Solidity, I'm making a centralized game, and after some successful missions, I want to give the user the option of "Claim tokens", where I would transfer from the game wallet to him, and the amount…
0
votes
1 answer

How to interact with UUPS upgradeable contract using web3?

I have an ERC20 token already deployed on the Ropsten testnet with two versions. V1 is a simple unproxied ERC20 token and looks like this: // SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import…
L. Lei
  • 31
  • 4
0
votes
0 answers

Can’t withdrawal ERC-20 tokens from faucet contract

I recently published an ERC-20 token on mainnet and all is working well. Now I am attempting to write a Faucet smart contract in order to distribute coins to whoever asks for them. Note that this wouldn't be a faucet that mints new tokens directly…
jspru
  • 1,060
  • 1
  • 9
  • 17
0
votes
1 answer

How to generate same wallet address in both BEP20 and ERC20 using web3

How to generate same wallet address(same public key) in both BEP20(Binance Smart Chain) and ERC20(Ethereum) using web3? I want to use one single key pair for both networks. I can see some exchange website provide same wallet address for both…
Alireza Asadi
  • 11
  • 1
  • 2
0
votes
1 answer

Airdrop contract - Contract can't send token - ERC20 transfer amount exceeds allowance

I am trying to create a contract which will be used as an airdrop contract. I will send tokens from a contract already deployed to it, and then any user can claim tokens to this airdrop contract. However I got an error : ERC20 transfer amount…
Hurinj
  • 59
  • 1
  • 9
0
votes
1 answer

Error calling deposit function on ERC20 escrow contract

I wrote this contract to escrow a given type of ERC20 token (address of the token is given when calling the constructor). But every time I call the deposit function to deposit some tokens into the contract, I just get transaction failed and I'm not…
0
votes
0 answers

Axie infinity battle’s logs

How can I get all battle’s logs of all players from game Axie Infinity which based on ethereum. I need it for developing strategy for my battle. For example: on Axie.zone you can see link of another player battle. Link for example:…
0
votes
0 answers

ERC20 not showing the 'contact address'

1- Whenever I deploy this contract to check the address from where the 'mint' is deploying, it does not show me the 'contact address' for the mint inside of the log. 2- In 'MyContract' I am keeping track of 2 values, 'wallet' & 'token' to use the…
0
votes
0 answers

Fixing price of Tokens to USD, but buying in ETH?

function _getTokenAmount(uint weiAmount) internal override view returns(uint256) { super._getTokenAmount(weiAmount); int currentPrice = priceFeed.getLatestPrice(); uint weiToEightDec = weiAmount / (10 * 10 ** 10); uint…
LMan
  • 13
  • 3
0
votes
1 answer

Figuring out addresses in an ERC20 contract

I'm writing an ERC20 contract that would allow another ERC20 to be able to work with my contract, and am unsure how to get a specific address in the scenario given below. Say my contract is CoinA, and someone else's contract is PartnerCoin. I'm…
0
votes
1 answer

ParserError in solidity, Expected identifier but got reserved keyword 'immutable'

I'm trying to compile my code on my token smart contract on solidity but this line is causing an error: address public immutable BUSD = address(0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56); //BUSD Error message: contracts/Work Protocol.sol:32:20:…
0
votes
0 answers

How to check price data of a crypto token on decentralized exchanges

Just wondering how I can access accurate price data for a given crypto token on decentralized exchanges (e.g. Uniswap, SushiSwap, Bancor, Balancer etc). I want to implement a solidity contract that can take an exchange and a currency pair and return…
J. Whitehead
  • 451
  • 4
  • 21