Skip to content

Commit

Permalink
Merge pull request #3 from crossnft-labs/feature/destination-minter
Browse files Browse the repository at this point in the history
create destination minter contract
  • Loading branch information
cross-nft-labs authored Dec 3, 2023
2 parents 9483b2e + 3893798 commit 8d2bdac
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions contracts/CrossNftDestinationMinter.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

import {CCIPReceiver} from "@chainlink/contracts-ccip/src/v0.8/ccip/applications/CCIPReceiver.sol";
import {Client} from "@chainlink/contracts-ccip/src/v0.8/ccip/libraries/Client.sol";
import {MyNFT} from "./MyNFT.sol";

contract CrossNftDestinationMinter is CCIPReceiver {
MyNFT nft;

event MintCallSuccessfull();

constructor(address router, address nftAddress) CCIPReceiver(router) {
nft = MyNFT(nftAddress);
}

function _ccipReceive(
Client.Any2EVMMessage memory message
) internal override {
(bool success, ) = address(nft).call(message.data);
require(success);
emit MintCallSuccessfull();
}
}

0 comments on commit 8d2bdac

Please sign in to comment.