GrindCode
  • Member for 9 months
  • Last seen more than a month ago
How can I save e-mails in my contract in secure way?
2 votes

Everything you write on your blockchain is open and anybody in the world can read it. Plus, it will cost your user something like $1 to $10 to give up his information to the world. Why do you want to ...

View answer
Transfer ERC20 tokens of a smart contract
Accepted answer
2 votes

There is two different address in Ethereum. The one controlled by a private key (usable for a user). Smart contract that are address controlled by a code (no private key). If you didn't put a function ...

View answer
Can there be two blocks with the same number?
2 votes

The best way is to use the block hash. For example block number 12551600 : https://etherscan.io/block/12551600 Hash : 0x1856e857565089091ef6ab0bb193b15302f293b33c5a432b8fbdb51cedfe1ad3 Block height ...

View answer
How to fix race condition between db and web client that listen for contract events
1 votes

I do it with infura node so I have a socket with this node to keep tracks of events. If you don't want a socket maybe you can run your node locally and your database will make call() to your own node ?...

View answer
Should I back up the private key from the metamask wallet
1 votes

Your private key is stored in your browser. Metamask ask you for a password to encrypt the private key. No it's stored locally. Always back up your private key. It's better to store your "...

View answer
How to securely send a message
1 votes

You can encrypt a message and store in your smart contract. But to decrypt it, the only thing you can do is to make a call() to get encrypted data from the caller. It's a special function that will ...

View answer
very expensive remix NFT deployment
1 votes

Deploy a contract cost transactions fees, you gas is constant but your gas price is not. Today gas was quite low between 10Gwei-20Gwei. If you want to pay less you can customize your fees on Metamask ...

View answer
Is it possible for web3 to listen to contract function call ? (For example mint() for a NFT)
1 votes

You need your smart contract address, your ABI and web3js. But you need also a node that actually work with ethereum blockchain. You can do your local node (but it will take long time to sync and a ...

View answer
Security considerations: using events to trigger offchain actions
1 votes

Yes wanting for confirmation is good. Don't look at pending transaction or worse, at transaction in mempool. Then you can wait for few confirmations block so your are 100% sure that the transaction ...

View answer
Ways to securely generate private key with ethersjs
1 votes

How often you want to generate a private key ? The best secure way for me is doing it offline with a good source of randomness (card, dice) or in a offline computer with BIP39 from Ian Coleman.

View answer
Is there a gas difference between minting and sending ERC-20 tokens?
1 votes

The transaction will be a change in a mapping from the smart contract. Each entries cost gas as it's described on yellow paper : https://ethereum.github.io/yellowpaper/paper.pdf Page 25. If you "...

View answer
Why check for zero-account?
0 votes

There is a 0x0 address you can see it here : https://etherscan.io/address/0x0000000000000000000000000000000000000000 This address is the owner of every ERC20 / NFT tokens when they are not claimed yet....

View answer
What is the "correct" way to check if an address is zero?
0 votes

require(account != address(0x0))

View answer
Adding max tx percent ERC20
0 votes

I don't think your buy limit will be in ETH, but you can control your transfer rate for your ERC20 tokens because this is what your contract do. Yes they add this control to avoid big movement. ...

View answer
Manually deploying a transaction
0 votes

There is a "replay attack" paramaters that you need to add. You need to add "chainId" because some node reject transactions if you don't specify what chain you want to spend your ...

View answer
How to keep track of nonces with HD Wallet Provider (or any other tools)?
0 votes

Your nonce start at 0 and you can increment it every transactions. Also you can retrieve your nonce with web3.Js.

View answer
Coinbase wallet 12 word seed used on metamask?
0 votes

Some service do use BIP39 mnemonic passphrase BUT sometimes they are tweaking factors, for example PBKDF2 iteration, or key range. For example, with Electrum (a bitcoin wallet) they are adding a seed ...

View answer
Fetch all tokens (ERC20, ERC721, ERC1155) owned by a specified address
0 votes

ERC1155 are not as popular as ERC721 so there is less smart contract to look into it I think. For the call it's pretty mush the same thing than ERC721.

View answer
I can't load web3. I keep getting this console error how do I fix it?
0 votes

You can't use "require" in browser html file, you have to import it with to use web3js client size. If you want to "require" web3 on nodeJS first npm install web3 then require it ...

View answer
For a given contract address, does a private key exist that maps to it?
0 votes

There is two address type in Ethereum. Address owned by a private key (a random number basically) that can be use by a user. Address that are run by a smart contract, and there is no private key for ...

View answer
Gather funds from multiple wallets
0 votes

A transaction is the cheapest interaction you can have with the Ethereum Blockchain. So it's your only hope to gather fund from multiple wallet.

View answer
Is it possible to send a transaction from a 0 balance EOA through a funded Smart Contract, such as the latter pays the tx fees?
0 votes

I don't think smart contract pay fees. Because if they pay fees, someone can drain the smart contract wallet very easily. He can just ask multiple small transactions from the contract.

View answer
Storing multiple cryptocurrencies using a usb stick as the private key
0 votes

USB can easily be scanned by a virus to retrieve data on your USB. Hardware wallet are better because they can't output sensitive data. Cold wallet mean cold so better to use a full offline computer ...

View answer
Locked Staking - when can I cash out?
0 votes

I didn't read in details but yes you will be able to withdraw your locked fund. I don't know if you can only withdraw interest and let your full stack. However, remember that a limited number of stack ...

View answer
Which transaction comes first in a block?
0 votes

I don't think they are executed one after another, they are pretty much in a same block, so a block is like a "tick" for the network. Most smart contract implement a feature that forbid ...

View answer
Dapp with frontend
0 votes

Are you sure to write this data on your smart contract ? They will be accessible for anyone in the world with no restrictions. And you will pay like 100 000gas for it so it's quite expansive for a ...

View answer
How best to replay all events from genesis using web3
0 votes

Do you use a local node ? Because if you use a service it will be limited to 2M5 queries. Maybe try {fromBlock : 1} ?

View answer
Is it possible to redistribute ERC20 tokens?
0 votes

You can fork the contract and do a bridge that give you 65% of your tokens with a burn function. But it will cost gas for everyone, because rewrite an entire mapping is quite expansive. There is no ...

View answer
Can I add a custom button to MetaMask or other Ethereum wallets that can be clicked on to call a custom contract function? If so, how?
0 votes

Yes of course you can do it. Look what LARVALABS did with they projects : https://www.larvalabs.com/cryptopunks https://meebits.larvalabs.com/ Yes web3js is a good choice about it. I advice you to ...

View answer
Accessing contract data for offchain analysis
0 votes

You can make a bot that is connected to the Ethereum blockchan (hosting your own node or using service like infura.io). Then you need the smart contract address you want to look out, and his ABI. Then ...

View answer