Do you have an actual contract in remix saved as DogContract1.sol? That is required in order to import it.
Hi Filip enclosed are two screenshots showing unable to import. I am using firefox trying few different URL,s . Same result with Google Chrome also. Local host connected. Thank you.
Your contract file needs to be names DogContract.sol. Right now the name is importto.sol. Thatâs why it doesnât work.
Hi Filip. Yes it works⌠Thanks:
I would like to know how to perform inheritance in super block studio. Thanks.
As of now, superblocks doesnât support multiple solidity files. You would have to create multiple contracts within the same solidity file. I will also check with my contact over at superblocks to see if thatâs a feature that they are working on.
Man, the herd has thinned!
Accidentally posted this assignment on 5066 instead of 5065
pragma solidity ^0.4.0;
contract PersonContract{
struct Person {
string name;
uint age;
}
Person[] People;
// setter function
function addPerson(string _cname, uint _age) {
People.push(Person(_cname, _age));
}
// getter function that returns Average Age over all the persons in the array People
function getAverageAge() returns (uint){
uint numOfPersons = 0;
uint totalAge = 0;
for(uint i = 0; i < People.length; i++ ) {
totalAge += People[i].age;
numOfPersons++;
}
return totalAge/numOfPersons;
}
}
Hello everyone. Can I get some help, please? I am getting these undeclared identifiers errors. Where did I make the mistake?
Thank you.
It should be
address owner = msg.sender;
not
address.owner = msg.sender;
I hope that helps.
OMG yes, that was it⌠amazing how a single dot can make one go nuts lol ⌠thanks a lot, Filip!
Hi Filip, thanks for your great help.
This is a general question about Solidity: Is there a practical way in Solidity to retrieve / get more than one element at a time? If not? What would be an efficient way to achieve it?