-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
05b6e6b
commit 3d23d94
Showing
11 changed files
with
76 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"type":"function","name":"facetAddress","constant":true,"stateMutability":"view","payable":false,"gas":1100000,"inputs":[{"type":"bytes4","name":"_functionSelector"}],"outputs":[{"type":"address","name":"facetAddress_"}]},{"type":"function","name":"facetAddresses","constant":true,"stateMutability":"view","payable":false,"gas":1100000,"inputs":[],"outputs":[{"type":"address[]","name":"facetAddresses_"}]},{"type":"function","name":"facetFunctionSelectors","constant":true,"stateMutability":"view","payable":false,"gas":1100000,"inputs":[{"type":"address","name":"_facet"}],"outputs":[{"type":"bytes4[]","name":"facetFunctionSelectors_"}]},{"type":"function","name":"facets","constant":true,"stateMutability":"view","payable":false,"gas":1100000,"inputs":[],"outputs":[{"type":"tuple[]","name":"facets_","components":[{"type":"address","name":"facetAddress"},{"type":"bytes4[]","name":"functionSelectors"}]}]},{"type":"function","name":"supportsInterface","constant":true,"stateMutability":"view","payable":false,"gas":1100000,"inputs":[{"type":"bytes4","name":"_interfaceId"}],"outputs":[{"type":"bool"}]}] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"type":"function","name":"setStr1","constant":false,"payable":false,"gas":1100000,"inputs":[{"type":"string","name":"str"}],"outputs":[]},{"type":"function","name":"setStr2","constant":false,"payable":false,"gas":1100000,"inputs":[],"outputs":[]}] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"type":"function","name":"getStr1","constant":true,"stateMutability":"view","payable":false,"gas":1100000,"inputs":[],"outputs":[{"type":"string"}]},{"type":"function","name":"getStr2","constant":true,"stateMutability":"view","payable":false,"gas":1100000,"inputs":[],"outputs":[{"type":"string"}]}] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"type":"event","anonymous":false,"name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","indexed":true},{"type":"address","name":"newOwner","indexed":true}]},{"type":"function","name":"owner","constant":true,"stateMutability":"view","payable":false,"gas":1100000,"inputs":[],"outputs":[{"type":"address","name":"owner_"}]},{"type":"function","name":"transferOwnership","constant":false,"payable":false,"gas":1100000,"inputs":[{"type":"address","name":"_newOwner"}],"outputs":[]}] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import { AppStorageOpen, LibCommon } from "../libraries/LibCommon.sol"; | ||
|
||
contract Facet1 { | ||
|
||
function setStr1(string memory str) external { | ||
AppStorageOpen storage appStore = LibCommon.appStorage(); | ||
appStore.str1 = str; | ||
} | ||
|
||
function setStr2() external { | ||
AppStorageOpen storage appStore = LibCommon.appStorage(); | ||
appStore.str2 = "store string 2"; | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import { AppStorageOpen, LibCommon } from "../libraries/LibCommon.sol"; | ||
|
||
contract Facet2 { | ||
|
||
function getStr1() external view returns(string memory){ | ||
AppStorageOpen memory appStore = LibCommon.appStorage(); | ||
return appStore.str1; | ||
} | ||
|
||
function getStr2() external view returns(string memory){ | ||
AppStorageOpen memory appStore = LibCommon.appStorage(); | ||
return appStore.str2; | ||
} | ||
|
||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import "./storage.sol"; | ||
|
||
library LibCommon { | ||
|
||
function appStorage() internal pure returns (AppStorageOpen storage appStore) { | ||
assembly { | ||
appStore.slot := 0 | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
struct AppStorageOpen { | ||
string str1; | ||
string str2; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ "diamond": "0x25b5A1874F31E4d329e3Fe21F9De9628d9804465"} | ||
{ "diamond": "0x10BCE52147909587F190D12E8e08e6BDc9e7f6F6"} |
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