Skip to content

Commit

Permalink
[FEATUR DONE] update IYumeEngine
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaojintao97 committed Nov 18, 2024
1 parent 12a9f79 commit e948281
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
9 changes: 5 additions & 4 deletions src/interfaces/IYumeEngine.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ pragma solidity 0.8.14;
import { DataTypes } from "../libraries/DataTypes.sol";

interface IYumeEngine {
function createCollection(
function relayCreateCollection(
DataTypes.CreateTokenParams calldata createTokenParams,
string calldata collectionName,
address creator
address msgSender
) external returns (address);

function createToken(
function relayCreateToken(
address nft,
DataTypes.CreateTokenParams calldata createTokenParams
DataTypes.CreateTokenParams calldata createTokenParams,
address msgSender
) external returns (uint256);

function mintWithEth(
Expand Down
11 changes: 6 additions & 5 deletions src/periphery/YumeMintNFTRelayHook.sol
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ contract YumeMintNFTRelayHook is IYumeRelayGateHook, Ownable {
address entryPoint,
bytes calldata data
) external payable override returns (RelayParams memory) {
if (bytes4(data[0:4]) == IYumeEngine.createCollection.selector) {
if (bytes4(data[0:4]) == IYumeEngine.relayCreateCollection.selector) {
return
_processCreateCollectionRelay(
msgSender,
chainId,
entryPoint,
data[4:]
);
} else if (bytes4(data[0:4]) == IYumeEngine.createToken.selector) {
} else if (bytes4(data[0:4]) == IYumeEngine.relayCreateToken.selector) {
return
_processCreateTokenRelay(
msgSender,
Expand Down Expand Up @@ -155,7 +155,7 @@ contract YumeMintNFTRelayHook is IYumeRelayGateHook, Ownable {
relayParams.to = entryPoint;
relayParams.value = 0;
relayParams.callData = abi.encodeWithSelector(
IYumeEngine.createCollection.selector,
IYumeEngine.relayCreateCollection.selector,
params,
collectionName,
msgSender
Expand Down Expand Up @@ -190,9 +190,10 @@ contract YumeMintNFTRelayHook is IYumeRelayGateHook, Ownable {
relayParams.to = entryPoint;
relayParams.value = 0;
relayParams.callData = abi.encodeWithSelector(
IYumeEngine.createToken.selector,
IYumeEngine.relayCreateToken.selector,
nft,
params
params,
msgSender
);
return relayParams;
}
Expand Down

0 comments on commit e948281

Please sign in to comment.