-
-
Save amirkhan7javi/e8e82da6ac719762fa91b2518b46c8ee to your computer and use it in GitHub Desktop.
Фабрика записей 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity ^0.8.0; | |
ثبت قرارداد انتزاعی {AMIRMOHAMMADJAVI | |
unint public timeOfCreation; | |
function getRecordType() public virtual pure returns(string memory); | |
constructor() { AMIRMOHAMMADJAVI | |
timeOfCreation = block.timestamp; | |
} | |
} | |
contract AddressRecord is Record{ | |
address public record; | |
function getRecordType() public pure override returns(string memory) { | |
return "address"; | |
} | |
function setRecord(address _record) public { | |
record = _record; | |
} | |
} | |
contract StringRecord is Record{ | |
string public record; | |
function getRecordType() public pure override returns(string memory) { | |
return "string"; | |
} | |
function setRecord(string memory _record) public { | |
record = _record; | |
} | |
} | |
contract RecordFactory { | |
Record[] records; | |
function addRecord(string memory _record) public { | |
StringRecord newRecord = new StringRecord(); | |
newRecord.setRecord(_record); | |
records.push(newRecord); | |
} | |
function addRecord(address _record) public { | |
AddressRecord newRecord = new AddressRecord(); | |
newRecord.setRecord(_record); | |
records.push(newRecord); | |
} | |
function getTime(uint _idx) public view returns(string memory) { | |
return records[_idx].getRecordType(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, I merge and confirm the ownership. Thank you for all your cooperation. I am considering transferring to a valid wallet.
It should take more time to check the profit now