Categories
Cryptocurrency Ethereum Mastering Development

What is the difference between require() and return in an if() statement?

I am reading this page and trying to understand how these 2 pieces of code will behave: With require() function transfer(address _newOwner) public { require(msg.sender == owner) // Do the actual transfer } With return in an if(): function transfer(address _newOwner) public { if (msg.sender != owner) return; // Do the actual transfer } I […]

Categories
Cryptocurrency Ethereum Mastering Development

How can I convert token transfer to data field?

How to convert the erc20 token transfer with target address amount etc to data field? By Abi etc?

Categories
Cryptocurrency Ethereum Mastering Development

How can I estimate the gas in usdt transfer?

Any example to estimate gas in usdt transfer? I tried right code in ethers.js but not working in usdt although it works on rinkeby for the token using usdt source code, I use the same usdt abi.

Categories
Cryptocurrency Ethereum Mastering Development

Web3 is not connecting to metamask. TypeError: Null object returned to account

I am currently following the tutorial in Dapp University YouTube channel where I am coding my own ERC-20 token https://www.youtube.com/watch?v=XdKv5uwEk5A&t=21611s. At 5:51:00 onwards you can see that in his webpage Your Account is displaying the address of Ganache(local blockchain). But in my code Account is displaying NULL as you can see printed in console. Also […]

Categories
Cryptocurrency Ethereum Mastering Development

Web3 is not connecting to metamask. TypeError: Null object returned to account

I am currently following the tutorial in Dapp University YouTube channel where I am coding my own ERC-20 token https://www.youtube.com/watch?v=XdKv5uwEk5A&t=21611s. At 5:51:00 onwards you can see that in his webpage Your Account is displaying the address of Ganache(local blockchain). But in my code Account is displaying NULL as you can see printed in console. Also […]

Categories
Cryptocurrency Ethereum Mastering Development

Web3 is not connecting to metamask. TypeError: Null object returned to account

I am currently following the tutorial in Dapp University YouTube channel where I am coding my own ERC-20 token https://www.youtube.com/watch?v=XdKv5uwEk5A&t=21611s. At 5:51:00 onwards you can see that in his webpage Your Account is displaying the address of Ganache(local blockchain). But in my code Account is displaying NULL as you can see printed in console. Also […]

Categories
Cryptocurrency Ethereum Mastering Development

Want to Access remote dai smart contract in another smart contract

I want to transfer Dai tokens from account1 to account2. My account1 has 50 DAI tokens. Kovan Dai contract address given by makerdao is: 0x4F96Fe3b7A6Cf9725f59d353F723c1bDb64CA6Aa. What I am doing is, 1. I have signed in metamask by account1. 2. approve balance by a method called approve(address(this), balance). – address(this) is my deployed smart contract address. […]

Categories
Cryptocurrency Ethereum Mastering Development

Web3 is not connecting to metamask. TypeError: Null object returned to account

I am currently following the tutorial in Dapp University YouTube channel where I am coding my own ERC-20 token https://www.youtube.com/watch?v=XdKv5uwEk5A&t=21611s. At 5:51:00 onwards you can see that in his webpage Your Account is displaying the address of Ganache(local blockchain). But in my code Account is displaying NULL as you can see printed in console. Also […]

Categories
Cryptocurrency Ethereum Mastering Development

Where can I buy some usdt in small amount for testing on mainnet

Any where to buy small amount of usdt of mainnet for testing?

Categories
Cryptocurrency Ethereum Mastering Development

I found erc20 gas different in ether.js on rinkeby

I use estimate gas to calculate the gas to transfer usdt on rinkeby by ether.js it works, but when I change to mainnet it shows error gas exceed limit but rinkeby ok. What is the problem? I use usdt abi and contract address to test usdt transfer and on rinkeby I deployed the same usdt […]