Questions tagged [balances]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
18 views

How to obtain a list of addresses of 'fresh' wallets?

How to obtain a list of addresses of 'fresh' wallets? Hi everyone, how do I go about extracting a list of wallets that had their first transaction within the past 24 hours? I know that wallets are ...
1 vote
0 answers
18 views

This is the source code for adding the token to the wallet, but the token is not added to the wallet [closed]

ERC20 Token smart contract: // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ERC20.sol"; contract Shinobi is ERC20 { constructor (...
0 votes
1 answer
17 views

Side balance of token in contract

Is it possible to have a "side balance" of an ERC20 token in the same contract? So when it's queryable with token.balanceOf(address(this)), for example, it doesn't appear until a certain ...
  • 369
0 votes
1 answer
28 views

address(this).balance not updating correctly

I have made a few test contracts for this issue and I have come across the same result in all of them so it is obvious I am not understanding something. In the following contract I keep track of the ...
0 votes
0 answers
19 views

When using remix IDE. how can I initialize a balance for the owner of the contract in the constructor?

I wanted to assign put in atleast 1 ether inside the balance of the owner of the contract. pragma solidity ^0.8.0; contract EtherWallet { address public owner; mapping(address => ...
0 votes
0 answers
47 views

How to create a snapshot of all ETH balances at a given block

A similar question can be found here: How to take a snapshot of addresses and balances of all normal addresses? The top solution is still possible today, but the 1-2 week timeline is unfeasible. ...
  • 91
0 votes
1 answer
34 views

Transfer function not changing custom token(ERC20) balance after successful transfer from transfer function?

Transfer function not changing custom token(ERC20) balance after successful transfer from transfer function ? The transaction is successfully performed but the amount of custom token in my wallet does ...
0 votes
2 answers
313 views

Is it possible to send testnet eth from one testnet network to another?

Is it possible to send testnet eth from one testnet network to another? Curious because ain't getting much testnet eth these days.
0 votes
0 answers
42 views

How do I calculate the circulating supply for a given token/token address from blockchain data (bigquery-public-data)?

The Following Query does not work WITH incoming as (SELECT a.to_address, a.token_address, b.symbol, SUM(SAFE_DIVIDE(SAFE_CAST(a.value as BIGNUMERIC),POW(10,CAST(b.decimals AS INT)))) as ...
1 vote
1 answer
160 views

How to send ether to a contract (even if the contract doesn't implement receive or fallback functions)? [duplicate]

If the contract doesn't implement the receive or fallback function as payable, it can't receive funds?
1 vote
0 answers
32 views

How does balance of nodes calculated in Ethereum network? [duplicate]

As a beginner of the topic, I am trying to understand the storage concept in Ethereum and smart contracts. Each of the network nodes has a public address called a digital wallet for managing the ...
  • 11
0 votes
1 answer
18 views

Why this transaction succeeded to transfer more than its balance?

On BSC chain, this transaction is minting an NFT(MstToken). The evm trace shows it called MstToken.transferFrom(fromUser, ..., 0x30927f74c9de0000) to send out 0x30927f74c9de0000 token and it succeeded,...
  • 213
0 votes
0 answers
36 views

Is it possible to exchange one token for another via web3.js in Metamask?

I need to transfer one token to another on my website, in Metamask (for example, ether to bnb or ether to matic). In Metamask, you can select the desired coin, click "Swap" and you can ...
0 votes
1 answer
13 views

I need help with balances

I would like to create a balance for each "vault". for example i will have my struct: struct unnamed { string[] crowdFundName; } I would like to add a balance to each vault for ...
0 votes
2 answers
55 views

Increasing ETH balance of a contract on deployment

I am building an exchange where you can buy and sell tokens. I have a contract Exchange. It contains a function sellTokens which will take the amount of tokens entered by a user and give them a ...
0 votes
0 answers
320 views

How to automatically get gas and gas price average values in web3.js?

I want to automatically get gas and gas price averages in web3.js and update them periodically. Here are the values (low, average, high) for gas prices. But they are constantly changing, and changing ...
  • 117
0 votes
1 answer
101 views

A Transaction from a wallet to a smart contract gives an error "txn receipt status fail". If you transfer to another wallet, it works. How to fix it?

I need to transfer money from the Metamask wallet to the smart contract address. I wrote a js-file for this(using web3.js). (I'm testing on Rinkeby's network.) When my site opens, this js-file is ...
  • 117
0 votes
2 answers
29 views

why I am not getting balance of contract?

when I call the getbal() of contract "Account" it shows 0 balance but when I call createacc() of contract "accountfactory" with value=30, accountfactory's balance becomes 9.but ...
  • 1
0 votes
0 answers
47 views

Balance in wallet not updated after mint

on my test token using OZ ERC20 I can mint successfully and the tokens show in the wallet. this is the relevant code contract TestToken is ERC20, Pausable, AccessControlEnumerable { ...
1 vote
1 answer
23 views

Where can I upload a secret file that no one should have access to except my site?

I want to create a website that will transfer money in real time from my ethereum wallet to another ethereum wallet. To do this, I use the web3.js library in the javascript file. This js file also ...
  • 117
0 votes
0 answers
186 views

web3.eth.filter error. How to track incoming transactions to ethereum wallet via web3.js (in Next-JS)?

I want to create a website that will transfer money in real time from my ethereum wallet to another ethereum wallet. To do this, you need a script (.js) to monitor the balance of my wallet in real ...
  • 117
0 votes
0 answers
27 views

How to implement a "deposit" functionality for a service with users?

Let's say, there's a service I'm building, and there're users that can sign up for it. I want to allow each user to deposit their funds, and, of course, track them. The requirement I have is that it'...
  • 1
0 votes
0 answers
22 views

Сall smart contract method from web3js bot. Is it possible?

I wrote a smart contract (.sol) in Solidity language that redistributes money from an Ethereum wallet to other Ethereum wallets. I need that when money is credited to the first wallet, a smart ...
  • 117
0 votes
1 answer
181 views

Why is the method in receive() external payable{this.withdraw Funds();} not called in Solidity?

I wrote a smart contract that, when receiving money to my address, should automatically transfer 50% to the 1st wallet address, 25% to the second, 25% to the third. For some reason it doesn't do it ...
  • 117
0 votes
0 answers
23 views

Is possible to remove an already hosted smartcontract and already hosted web3.js/ethers.js bot?(I mean Ethereum & Polygon;I have a private wallet key)

I need that when money is credited to the Metamask (Ethereum and Polygon) wallet, the money is automatically transferred to the smart contract. I was advised to write a bot on web3.js and ethers.js ...
0 votes
0 answers
37 views

How to make it so that when money comes to the Metamask wallet, they are automatically redirected to this smart contract? [duplicate]

I wrote a smart contract on Solidity, which, when receiving money to its address, redirects 50% to the first wallet, 25% to the second wallet. How to make it so that when money comes to the Metamask ...
1 vote
1 answer
110 views

How to transfer ethers from a contract to another SPECIFIC address?

I want to write a smart contract that, when receiving money, transfers 50% to a specific address of the first wallet (0x583031D1113aD414F02576BD6afaBfb302140225) and transfers 25% to a specific ...
0 votes
0 answers
22 views

Privilege for a list of addresses

I want to give free mints to people who owns an NFT from another collection. I can do it through importing interface of another contract and calling the balanceOf function with the related address, ...
0 votes
3 answers
1k views

How to call a payable function and pay from the contract balance?

First, this is not a duplicate question of these ones: How can you call a payable function in another contract with arguments and send funds? Calling and funding a payable function from existing ...
1 vote
1 answer
34 views

How to query the erc20 balance of an address using eth-cli command?

How does one get the balance of tokens erc20 of an address when using the eth-cli command?
0 votes
0 answers
221 views

API for getting the total balance (net worth) of an address?

Etherscan can get the total net worth for all tokens of an address, ETH and ERC-20, e.g.: https://etherscan.io/tokenholdings?a=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 Other services like Zapper.fi ...
  • 101
0 votes
1 answer
701 views

Get Token Balance of Address at Particular Block Number with Alchemy

I have been trying to get the token balances for an address at the first of the month for every month in the past year. There is an incredible article about how to do this with chainstack: https://...
0 votes
1 answer
172 views

Web3 Chainstack Guide to Batch Transactions gives Error: This contract object doesn't have address set yet, please set an address first

I am trying to get the token balances for all of the tokens in my address. To do that I followed the steps in this guide here: https://chainstack.com/the-ultimate-guide-to-getting-multiple-token-...
0 votes
0 answers
13 views

Can someone HELP a NOOB with Hex crypto

Please someone help me! I am very new and so freaking confused about Erc20 crypto tokens. I have an app I use called Hex Network and I have "mined" a good bit of Hex and have made 3 ...
0 votes
1 answer
55 views

implementing balanceOf in an ERC20 contract (not using openzepellin)

I'm a noob and trying to implement the balanceOf function in a solidity. The standard API is function balanceOf (address account) public returns(uint256) However, I suspect that it needs to read the ...
0 votes
2 answers
613 views

Wait for a transaction to be mined ends too soon

I got a simple python script that sends a signed transaction then wait for the transaction receipt. All is working perfectly, but when I poll my wallet (a metamask wallet) just after the reception of ...
0 votes
0 answers
102 views

Check whether the msg.sender has a polygon ERC-721 token in their wallet within a Ethereum ERC-721 contract at time of mint

I'm trying to figure out whether it's possible to check if the minter has a polygon nft in their wallet at time of mint for an ethereum nft. Take a look at how Bored ape kennel club did it https://...
0 votes
0 answers
8 views

Best way to collect state of addresses for contract X

I want to collect the state (balance) of all addresses of contract X. I'm interested in the historical state too. I'm trying to recreate the balance based on transfers. I'm using getPastEvents ...
0 votes
0 answers
50 views

Balance of token not appearing in my wallet (Ethereun ERC20)

I transferred AAA Tokens to my own wallet deposit which is under Network Ethereum ERC20. Etherscan seems ok towards my success transaction Txid: ...
  • 1
0 votes
1 answer
59 views

How can I find the incoming balance of a erc20 (usdt/shiba etc) using its transcation hash?

I know how to find the erc20 balance of an address. What I'm trying to find is the incoming token of a particular ERCs. For example : for a transaction, I managed to fetch its from_address, to_address ...
  • 383
0 votes
1 answer
211 views

withdraw function for withdraw ethereum token from a contract is behaving weird

I copy a withdrawal function from the solidity documentation and added it to my contract function withdraw() public onlyOwner { uint256 ownerBalance = address(this).balance; require(...
0 votes
1 answer
2k views

Multiple ways to check the balance of ERC20 tokens of smart contract: which to use?

I have a smart contract which holds ERC20 tokens. There's a function in it, in which I need to check whether the smart contract has enough balance, and if so, send out some tokens to a user. I thought ...
  • 1
0 votes
2 answers
558 views

How to correctly call `<address>.balance(uint256)` to get the balance of a specific address [duplicate]

I am a newbie in Solidity. I am learning by reading official docs, i.e. Solidity I am trying to get the balance of an address in solidity using the simple balance method. Below is my code: pragma ...
  • 21
0 votes
0 answers
181 views

Provide button to claim token without showing my private keys

The player will claim their rewards (a token) and pay a fee through their wallet. How does this process happen without my needing to display my private keys on the front-end? What I know so far is ...
  • 101
0 votes
1 answer
49 views

Deploy 2 SmartContracts at the same address

There are 2 SmartContract A, B. First, deploy A, then deploy B at the same address of A. When I call address(this).balance on A and B, it returns the same result. Would you please explain?
1 vote
1 answer
836 views

How to transfer Ether from a smart contract to an account?

I wrote a very simple smart contract. The goal is to: transfer some Ether from an account A to the smart-contract and then from the smart-contract to another account B. Here is the contract: pragma ...
0 votes
0 answers
139 views

Best way to get balances of multitude of addresses

I have a list/array/map of addresses. I want to keep track of their balances on the front end. Currently, the front end is calling the balanceOf() function for each address and updating based on the ...
  • 833
0 votes
1 answer
24 views

When you deploy contract, is it reset balance of your computed etereum address? [duplicate]

Before further situation description, sorry for my poor English skill. I sent my ethereum to estimated(?) contract address before contract is deployed. it will be contract address soon, but it is not ...
  • 1
0 votes
2 answers
64 views

Would an EOA's balance change within the same transaction?

I'm trying to understand various aspects of the micro-process of a transaction such as how msg.sender's balance is changed prior to and after a transaction is mined. Is the balance updated after the ...
  • 501
0 votes
0 answers
224 views

How to get the balance of any Token other than ETH?

I'm using ether.js library and infura as provider, the code works for getting balance of Eth: const provider = ethers.getDefaultProvider(Provider_network, { infura: MY_INFURA_ID }) const balance = ...
  • 213

1
2 3 4 5 6