forked from l2beat/l2beat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from l2beat/main
[pull] main from l2beat:main
- Loading branch information
Showing
98 changed files
with
18,367 additions
and
745 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
...kend/discovery/_templates/facet/EthscriptionsSafeModule/shape/EthscriptionsSafeModule.sol
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,38 @@ | ||
// SPDX-License-Identifier: Unknown | ||
pragma solidity 0.8.18; | ||
|
||
contract EthscriptionsSafeModule { | ||
address public constant ethscriptionsProxyAddress = 0xeEd444Fc821b866b002f30f502C53e88E15d5095; | ||
|
||
function createEthscription(address to, string calldata dataURI) external { | ||
require( | ||
GnosisSafe(msg.sender).execTransactionFromModule( | ||
ethscriptionsProxyAddress, | ||
0, | ||
abi.encodeWithSignature( | ||
"createEthscription(address,string)", | ||
to, | ||
dataURI | ||
), | ||
Enum.Operation.DelegateCall | ||
), | ||
"execTransactionFromModule failed" | ||
); | ||
} | ||
|
||
function transferEthscription(address to, bytes32 ethscriptionId) external { | ||
require( | ||
GnosisSafe(msg.sender).execTransactionFromModule( | ||
ethscriptionsProxyAddress, | ||
0, | ||
abi.encodeWithSignature( | ||
"transferEthscription(address,bytes32)", | ||
to, | ||
ethscriptionId | ||
), | ||
Enum.Operation.DelegateCall | ||
), | ||
"execTransactionFromModule failed" | ||
); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/backend/discovery/_templates/facet/EthscriptionsSafeModule/template.jsonc
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,5 @@ | ||
{ | ||
"$schema": "../../../../../discovery/schemas/contract.v2.schema.json", | ||
"displayName": "EthscriptionsSafeModule", | ||
"description": "Module that allows the Safe to interact with Ethscriptions." | ||
} |
30 changes: 30 additions & 0 deletions
30
...ackend/discovery/_templates/facet/EthscriptionsSafeProxy/shape/EthscriptionsSafeProxy.sol
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,30 @@ | ||
// SPDX-License-Identifier: Unknown | ||
pragma solidity 0.8.18; | ||
|
||
contract EthscriptionsSafeProxy { | ||
address internal immutable deployedAddress; | ||
|
||
event ethscriptions_protocol_CreateEthscription( | ||
address indexed initialOwner, | ||
string contentURI | ||
); | ||
|
||
event ethscriptions_protocol_TransferEthscription( | ||
address indexed recipient, | ||
bytes32 indexed ethscriptionId | ||
); | ||
|
||
constructor() { | ||
deployedAddress = address(this); | ||
} | ||
|
||
function createEthscription(address to, string calldata dataURI) external { | ||
require(deployedAddress != address(this), "Only Delegate Call"); | ||
emit ethscriptions_protocol_CreateEthscription(to, dataURI); | ||
} | ||
|
||
function transferEthscription(address to, bytes32 ethscriptionId) external { | ||
require(deployedAddress != address(this), "Only Delegate Call"); | ||
emit ethscriptions_protocol_TransferEthscription(to, ethscriptionId); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/backend/discovery/_templates/facet/EthscriptionsSafeProxy/template.jsonc
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,5 @@ | ||
{ | ||
"$schema": "../../../../../discovery/schemas/contract.v2.schema.json", | ||
"displayName": "EthscriptionsSafeProxy", | ||
"description": "Helper of the Safe Module that allows to send Ethscriptions transactions." | ||
} |
Oops, something went wrong.