Skip to content

Commit

Permalink
Merge pull request #62 from l2beat/main
Browse files Browse the repository at this point in the history
[pull] main from l2beat:main
  • Loading branch information
pull[bot] authored Jan 3, 2025
2 parents aa063f0 + 78e4b72 commit 05c4626
Show file tree
Hide file tree
Showing 98 changed files with 18,367 additions and 745 deletions.
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"
);
}
}
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."
}
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);
}
}
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."
}
Loading

0 comments on commit 05c4626

Please sign in to comment.