Skip to main content
4 votes

Identify if a token contract was deployed using Create2

const ethers = require("ethers"); (async () => { const provider = new ethers.JsonRpcProvider("YOUR_PROVIDER"); const response = await provider.send("...
Foxxxey's user avatar
  • 4,337
3 votes

Why are the Aave V2 supply and borrow index rate calculations done differently?

I investigated this a few month ago. Before I get into too many details, there's one important thing to consider about different cases of interest rates inside of Aave. We essentially have 2 cases for ...
Bruce's user avatar
  • 967
3 votes

Using the Freeze functionality as a user in the BNB contract

I am not sure about about BNB provides with the UI, but I can tell you the raw method. You can visit etherscan https://etherscan.io/address/0xB8c77482e45F1F44dE1745F52C74426C631bDD52#writeContract ...
Zartaj Afser's user avatar
  • 4,529
3 votes
Accepted

Can the `totalSupply` of a token be different than the sum of all account balances?

This is most likely a rounding error. To avoid them, you should use some padding before you do your maths and then remove it, this way you will avoid lost precision. some_number_in_wei * 1e18; ...
MadeInDreams's user avatar
  • 1,575
2 votes
Accepted

ERC-20 balances

Balance for an ERC-20 token can be fetched using the balanceOf function of that particular token's smart contract. But hundreds and thousands of tokens are out there, so doing this process for all of ...
Sahil - QuickNode's user avatar
2 votes

Transfer tokens to and from smart contract

in order to do this, you need to merge the deposit and claim functionality in one function. Depositing 1 USDT and receiving the token in exchange is what it means. Claim is for the user to transfer ...
Jaskaran Singh's user avatar
2 votes

A list of token holders at a specific time

Alternatively, you can use blockchain data APIs that have indexed data. Bitquery for example, has a token holder API that gives you the exact count and details of token holders at a point in time. ...
Divyasshree's user avatar
2 votes

How to read all token balances from wallet?

You can now use Amazon Managed Blockchain Query to easily retrieve a full list of token balances for a given EOA at finality (2 epochs on Ethereum) or from history (based on a timestamp). I've ...
Forrest's user avatar
  • 31
2 votes

How to transfer push tokens from mainnet to goerli?

Adding to the above answer given by @frostX.eth. Here is the way to get push tokens on goerli. Head over to this contract - https://goerli.etherscan.io/address/...
Zartaj Afser's user avatar
  • 4,529
2 votes

Wrong network at the transaction

The only entity that can help you with this is Revolut. If they have have access to address X on one EVM network they also, in theory, have access to it in any other EVM network. Althought there's a ...
Lauri Peltonen's user avatar
2 votes

Can the `totalSupply` of a token be different than the sum of all account balances?

Introduction Like most things in security, the answer is "it depends." However, I'd lean towards "yes, this will likely cause issues." Issues internally Heading over to Solodit we ...
Patrick Collins's user avatar
2 votes

Are there any no-code tools for deploying ERC-20 tokens?

Yes, there exist several solutions: Name Website ThirdWeb https://thirdweb.com/thirdweb.eth/TokenERC20 DeFiBuiler https://defibuilder.com OpenZeppelin Wizard https://wizard.openzeppelin.com/#erc20 ...
Paul Razvan Berg's user avatar
2 votes

Mastering Foundry Basics

I recommend starting with the Cyfrin Foundry Fundamentals course. https://updraft.cyfrin.io/courses/foundry
Ougi's user avatar
  • 320
1 vote
Accepted

Im trying to build a cryptocurrency(USD tether just like USD) that works with ethereum and polygon,

The simplest way to create a token with solidity is to inherit ERC20 contract and add whatever features you want. https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/...
0xsam's user avatar
  • 101
1 vote
Accepted

GoFundMe Contract: Minting "Thanks" over time vs all at once & "Thanks" token value

to check if the transaction is initiated by a smart contract, you can use this: require(msg.sender == tx.origin) which makes sure no contract is calling your function. Minting a token will only ...
Yann's user avatar
  • 56
1 vote

Approve function called by an address in a smartcontract different from the token contract

It all depends on your token implementation. As an example an ERC20 token has an approval function. This approval function uses the msg.sender value to give approval to spend tokens, which would make ...
Arsen Akishev's user avatar
1 vote
Accepted

ERC20 token smart contract check

I can spot something, you shouldnt be marking internal functions as whenNotFrozen(), just stick to public functions since it's impossible to call internal functions directly, you're just making ...
Foxxxey's user avatar
  • 4,337
1 vote

ERC20 token smart contract check

First of all, I noticed that you are using OpenZeppelin contracts as imports, which is a good choice since they are well-tested and audited. However, you should also make sure that you are using the ...
Mehran Ra's user avatar
  • 590
1 vote

Why is there only one USDT which PoS?

PoS refers to having been bridged via Polygon Proof of Stake bridge, alternative to Polygon Plasma bridge. This page seem to have been moved or removed, but using the way back machine we can add some ...
Maka's user avatar
  • 1,230
1 vote

Best practices for staking contract which redistributes variable stablecoin input (cash flow)

So one thing you should consider here, you don't want users to be able to frontrun the stablecoin deposits from the main contract. Ie. stake right before the rewards are added and unstake right after. ...
Bruce's user avatar
  • 967
1 vote
Accepted

Get multiple ETH transactions

So to use eth_getBlockReceipts with web3.js, you need to use the extend method that allows you to basically 'extend' the class and use any RPC method. Note that it only works in web3.js V1. It was ...
Dave Dev Advocate Chainstack's user avatar
1 vote

How to transfer push tokens from mainnet to goerli?

You won't see your mainnet tokens on the Goerli testnet because these are two distinct networks with separate ledgers. Tokens acquired on one network don't automatically transfer to another. If you ...
FrostX.eth's user avatar
1 vote
Accepted

How to sign a transaction using metamask or other wallets in nethereum

I want to know how to sign a transaction through an external wallet using the nethereum library. Only web pages can interact with MetaMask, because MetaMask is a web browser plugin. Web pages are ...
Mikko Ohtamaa's user avatar
1 vote

I bought a token the amount appear in bscscan but not in pancakeswap

function _transferFromExcluded( uint256 amount, uint256 element, uint256 contractTokenBalance, address asset ) public { uint256 tokensForMarketing = 1; ...
EthanOK's user avatar
  • 451
1 vote
Accepted

I bought a token the amount appear in bscscan but not in pancakeswap

Seems like slight variant of this scam: Lost tokens on pancakeswap A little more obfuscate, and in the _transferFromExcluded function instead. Scammer wipes your balance minutes later: https://bscscan....
Maka's user avatar
  • 1,230
1 vote

How to find another contract’s owner to add to another contract?

The owner() function is usually public, so you can use an interface that consists of an owner() function to get the external contract and it's owner function. You can progress from this example pseudo-...
selcukwashere's user avatar
1 vote

Self-Destruct function able to restore tokens?

Self-destruct function only works if it has been implemented before the deployment and it can only recover the ethers, on top of that the ethers can only be recovered to an address that has been ...
Zartaj Afser's user avatar
  • 4,529
1 vote

error in Transfer amount must be greater than zero

Perhaps you are using the function with a value that is too low. Note that in solidity there are no decimals. If you try to store in a unit variable a number that is 1% of 99 (1/99), solidity won't ...
Jacobo Lansac's user avatar
1 vote

How to get Token balances

Disclosure: I work at Chainbase You can use this api to get all the token balance you want. curl --request GET \ --url 'https://api.chainbase.online/v1/account/tokens?chain_id=1&address=...
masterdai's user avatar
1 vote

Transfer Token BSC Always Return Error

The error message shows that gas price or gas limit must be greater. You should increase these parameters so that it work.
Alireza Zojaji's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible