Do you have metamask installed, running and logged in?
once i switched to send back a change in âsendâ manner instead of âtransferâ it worked.
yes it is running, holds eth but not ingects the address into account window
ok dosnt matter switched to opera and it finely runned ok.
thanks.
Using this contract as the base add the following to get the balance of the external contract in question.
function getExternalBalance() public view returns (uint){
return dc.getBalance(); //OR address(dc).balance; also works
}
Just posting the solution I came up with to Exercise 1 in relation to prevent a Dog being overwritten for the owners public address. I was probably over thinking it as I came from the perspective of having an array of Dogs per address, and you can search for a Dog based on itâs age.
pragma solidity 0.5.1;
contract DogContract {
struct Dog {
string name;
uint age;
}
Dog[] dogs;
mapping(address => Dog[]) ownerToDogs;
function addDog(string memory _ownerName, uint _age) public {
dogs.push(Dog(_ownerName, _age));
ownerToDogs[msg.sender] = dogs;
}
function getDog(uint searchByAge) public view returns (string memory) {
Dog[] memory storedDogs = ownerToDogs[msg.sender];
for (uint i = 0; i < storedDogs.length; i++) {
Dog memory currentDog = storedDogs[i];
if (searchByAge == currentDog.age) {
return currentDog.name;
}
}
return "No dog with this age found!";
}
}
Hi folks,
I got a remix/metamask problem here, trying to follow along the lecture about testnet deployment.
Metamask does not inject into remix. The Account field remains empty.
Logged in to Metamask, got some ether in it, tried Ropten and Rinkeby testnet, tried in Chrome and Brave browsers, without success. Someone got an idea? Donât want to install and try x different browsers.
Thx
Michael
Just to make sure. Are you logged in to metamask and have selected injected web3 in remix?
If that doesnât work. You can also try to go into metamask settings -> Security & Privacy -> Turn off privacy mode.
Turning off privacy mode did the trick. Thank you, Filip.
mappings assignment
https://ivanontech.teachable.com/courses/287053/lectures/8617350
I guess, the issue with the âaddDogâ function is the absence of checking if that address already has some data. In this case it might not make sense to overwrite and revert() might be a rihgt thing to do.
I guess, It also might make sense to return âstring storageâ in âgetDog()â to avoid gas waste on moving data around.
error handling + assignment
https://ivanontech.teachable.com/courses/287053/lectures/8617415
Require should be used to validate the age.
require(ownerToDog[msg.sender].age == 0);
Dog memory currentDog = Dog(_name, _age);
ownerToDog[msg.sender] = currentDog;
Hi everybody!
I try to get the free ETH thanks to the website https://faucet.metamask.io/
but I donât know why it doesnât work:
I press the button ârequest 1 ether from faucetâ but I can see nothing on my wallet:
Is there anybody out there who have an idea to solve this?
Did your metamask window open up when you pressed the request button? You should have to press confirm in metamask in order for the transaction to go through. You can try to go into metamask settings and disable privacy mode.
Hi Filip,
I want to complain about how you show your code on the screen. I am having a hard time reading it since it is SOOOOO SMALLL! I can´t follow you unless I enter full screen mode which made me have to paused everytime I want to try it myself. Thats really unconvinient!!
WHY can´t you make the code bigger like what Ivan did in JS and C++ videos?? Really man, it gets into my nerve so much. I really want to be able to code but you are not HELPING!
ALL of your videos are like this and this is not good service for us all. PLS FIX IT!!
When I clicked on the request button my metamask window opened. Then I disabled the privacy mode as you told me. But there is no ETH.
Try to change your metamask network to ropsten and try again.
Thank you for the feedback. I know that the text is very small is some of the videos in the SC programming course. I have addressed this feedback in all new videos that I upload, both in new courses and in the updated videos I have added and replaced in this course.
Sometimes itâs also hard to fit everything on the screen in tools such as Superblocks and Remix where there is so much more than just the code. By I feel you and I promise you it will get fixed as videos get updated.
I donât understand why but with rinkeby nothing work
And with ropsten that works
Do you have an idea why?
Probably something wrong with the faucet site.
OK thanks for your answer