Last active
January 5, 2022 10:11
-
-
Save fdemiramon/86a345b179aa1f95d1d6d6c7ea8f1e41 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.1+commit.df193b15.js&optimize=false&runs=200&gist=
This file contains 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: MIT | |
pragma solidity 0.8.1; | |
interface IConcatNameFactory { | |
function createConcatName(address concatNameAddress) external returns(address); | |
} | |
contract ConcatName { | |
bytes public name; | |
IConcatNameFactory public factory; | |
constructor(bytes memory _name) { | |
name = _name; | |
factory = IConcatNameFactory(msg.sender); | |
} | |
function deposit() external payable returns(address){ | |
return factory.createConcatName(address(this)); | |
} | |
} |
This file contains 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: MIT | |
pragma solidity 0.8.1; | |
import "./ConcatName.sol"; | |
contract ConcatNameFactory { | |
function createConcatName(address ConcatNameAddress) external returns(address) { | |
return address(new ConcatName(abi.encodePacked(ConcatName(ConcatNameAddress).name(), abi.encodePacked("+")))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment