Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //SPDX-License-Identifier: MIT
- pragma solidity ^0.8.0;
- import "./cust_error.sol";
- contract Account{
- address public bank;
- address public owner;
- constructor(address _owner)payable{
- bank = msg.sender;
- owner = _owner;
- }
- function getbal() public view returns(uint){
- // return address(this).balance;
- }
- event Received(address, uint);
- receive() external payable {
- emit Received(msg.sender, msg.value);
- }
- }
- contract accountfactory{
- Account[] public accounts;
- // uint public vall;
- // constructor(address cc){
- // vall = cc.value;
- // }
- function createacc(address _owner)external payable{
- require(msg.value >= 21);
- Account account = new Account{value: 21}(_owner);
- accounts.push(account);
- }
- function getbal() public view returns(uint){
- return address(this).balance;
- }
- function invest() public payable {
- }
- address public addofaa;
- function getaddbb(address aaa) public {
- addofaa = aaa;
- }
- function call_other()public view returns(string memory)
- {
- aa a = aa(addofaa);
- return a.say_hello();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement