External Contracts & Interfaces assignment

Hey Filip,
you mentioned an extra exercise in the video to get the balance from the external contract, but there is no thread available to post it in so I created one.

pragma solidity 0.5.1;

contract DogContract{

    function addDog(string memory _name, uint _age) public payable returns (uint);

    function getBalance() public view returns (uint);
}

contract ExternalContract {

    DogContract dc = DogContract(0x692a70D2e424a56D2C6C27aA97D1a86395877b3A);

    function addExternalDog(string memory _name, uint _age) public payable returns (uint){
        return dc.addDog.value(msg.value)(_name, _age);
    }
    
    function getBalance() public view returns (uint){
        return dc.getBalance();
    }
    
}

Hey, I found an older forum on this chapter. You must have missed it by accident. I think we are meant to post our code in there.

Yeah I didn’t create a thread for the assignment since I though they could be posted in the general discussion thread.