Skip to content

Instantly share code, notes, and snippets.

@bertil291utn
Created June 11, 2022 18:21
Show Gist options
  • Save bertil291utn/79ca345c0933eb304928e41278c462a2 to your computer and use it in GitHub Desktop.
Save bertil291utn/79ca345c0933eb304928e41278c462a2 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.3;
import "./SimpleStorage.sol";
contract StorageFactory is SimpleStorage{
SimpleStorage [] public SSArray;
function createSSContract()public{
SimpleStorage genSS=new SimpleStorage();
SSArray.push(genSS);
}
function sfStore(uint256 index, uint256 age) public {
SimpleStorage(address(SSArray[index])).incrementAge(age);
}
function sfGetAge(uint256 index) public view returns (uint256) {
return SimpleStorage(address(SSArray[index])).getAge();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment