Categories
Cryptocurrency Ethereum Mastering Development

Mapping multiple structs to a struct and call them

I have a question about how I should design my contract to achieve the following: I want to create products identifiers (can be struct or string) something like: “product#123abc”. Then I want to map a struct to it (in my case this struct holds location information) Example: struct Location { string city; string street; uint […]

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?