I'm trying to get the balance of my wallet address to render on my frontend. Here's what I have so far.
const [balance, setBalance] = useState("");
const handleWalletBalance = async () => {
const { ethereum } = window;
…
I'm working on a crypto payment system using ethers Web3Provider
web3.eth.sendTransaction(transactionObject)
After the user calls this method, this dialog is shown:
In the app the user is able to close the payment dialog leaving this pending. Is…
I'm trying to encode calldata using ethers.js for the following function:
function myFunction(uint8,uint8,uint256,uint256,uint256)
My code sample:
let iface = new ethers.utils.Interface([
"function…
I have a relatively basic project using solidity and react working as a single page dApp using Create React App. However I am trying to move this now to Nextjs and have hit a hurdle which I assume is something to do with the server side stuff…
I am trying to sign and verify messages using wallet connect for my DAPP. So far I have tried using ethers and web3 to wrap WalletConnect and on my mobile device I'm using the metamask and trust wallet apps. So far none of the approaches is…
I am trying to implement a method for calculating token buy/sell tax. The one that devs implement it in the transfer() function.
I've done some research and there are 2 options.
eth_call - simulate a swap, calculate the difference
deploy the ERC20…
I am Not able to get weeklyBusiness array inside User struct. as the contract is already deployed is there a way i can change ABI to get all components of User struct including arrays using userInfo function.
struct WeeklyBusiness {
uint256…
I am attempting to calculate a hash from an image file which is stored as .png on Arweave.
The method I am using is shown below, but I'm not sure I'm actually using the methods of the Node fetch function and the ethers.js slidityKeccak256 function…
Using the SimpleWebAuthn TypeScript package, I have generated a ECDSA-SHA256 key pair and I used the key pair to sign a challenge. The SimpleWebAuthn package uses crypto.webcrypto.subtle (see this line) to verify the signature. I want to verify the…
I want to do math - 100000 * 1.004 by using BigNumber values. The biggest problem here is that 1.004 is a float and BigNumber does not accept it. I am using ethers.js library for it.
I tried to use parseUnits("1.004", 18). I am using 18 because…
I have a Hardhat script
that queries the RIF token balance
on Rootstock.
However the RIF address is hardcoded in my script:
const rifTokenAddress = '0x2aCc95758f8b5F583470bA265Eb685a8f45fC9D5';
async function main() {
const erc20 = await…
How do I get a list of a given ERC20 token holders?
I use QuickNode + ethers.js or web3.js and I have SC address for the ERC20 token.
Is there a short way to get a list of token holders or do I have to look through transactions?
I've tried…
I am trying call transferWithAuthorization on the USDC contract (which implements EIP-3009). To do this, I need to sign the transaction data and then execute the transaction, however I am getting the error: Fail with error 'FiatTokenV2: invalid…
I create my wallet like this
const wallet = ethers.Wallet.createRandom()
I use metamask to send RIF tokens to the public address. I confirm the new balance of the account and it is accurate, the ERC20 transaction worked.
When I try to send some of…