Contract 0xacdbd2d740A053AdEADa55FE2A56BCC1Eb301882

Contract Overview

Balance:
0 Ether
Txn Hash
Method
Block
From
To
Value
0x3e2b90e2f02f48f3a2db94403767f3b7c58971f6200bc958e31fbec715e5a1ceMint Asset From ...122195502022-04-26 13:24:52157 days 9 hrs ago0x76a15f9b153765cbd6fc737969b65116d1860bc1 IN  0xacdbd2d740a053adeada55fe2a56bcc1eb3018820 Ether0.0007818 10.90170612
0x5cca9bdb54ac4c68d6e29c7be09704222dc0e9a226090f1283d7ded2991b6b78Set Minted Selec...122195372022-04-26 13:17:02157 days 9 hrs ago0x76a15f9b153765cbd6fc737969b65116d1860bc1 IN  0xacdbd2d740a053adeada55fe2a56bcc1eb3018820 Ether0.00031522 6.80291896
0xb72b8b204b132de2621cbed71e864f2e45fcd890a749dfb2cecc272e3e4ec0b0Set L2Token Cont...122195362022-04-26 13:14:57157 days 9 hrs ago0x76a15f9b153765cbd6fc737969b65116d1860bc1 IN  0xacdbd2d740a053adeada55fe2a56bcc1eb3018820 Ether0.00029081 6.27002528
0x989610461023e05c7721e703e5f981d040ba224643d337ab16cd80d9218b8165Set L2Nft Factor...122195352022-04-26 13:13:43157 days 9 hrs ago0x76a15f9b153765cbd6fc737969b65116d1860bc1 IN  0xacdbd2d740a053adeada55fe2a56bcc1eb3018820 Ether0.00027535 5.93981305
0xeb737106c98b19cb709300dc8ab1f6cb0bca644edd3658634772b0121674425e0x60806040122194962022-04-26 12:41:22157 days 10 hrs ago0x76a15f9b153765cbd6fc737969b65116d1860bc1 IN  Create: MessagingAsset0 Ether0.0024652 2.52335744
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0x3e2b90e2f02f48f3a2db94403767f3b7c58971f6200bc958e31fbec715e5a1ce122195502022-04-26 13:24:52157 days 9 hrs ago 0xacdbd2d740a053adeada55fe2a56bcc1eb3018820x0d761163e8bdc22fec278fea0c7a95e7b2dfa3c30 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MessagingAsset

Compiler Version
v0.8.0+commit.c7dfd78e

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 4 : MessagingAsset.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";
import "./interfaces/IStarknetCore.sol";

contract MessagingAsset is Ownable {
    IStarknetCore starknetCore;
    uint256 private l2NftFactoryContractAddress;
    uint256 private l2TokenContractAddress;
    uint256 private mint_selector;

    function setMintedSelector(uint256 _mint_selector) external onlyOwner {
        mint_selector = _mint_selector;
    }

    function setL2NftFactoryContractAddress(uint256 _l2NftFactoryContractAddress) external onlyOwner {
        l2NftFactoryContractAddress = _l2NftFactoryContractAddress;
    }

    function setL2TokenContractAddress(uint256 _l2TokenContractAddress) external onlyOwner {
        l2TokenContractAddress = _l2TokenContractAddress;
    }

    constructor(address _starknetCore) public{ 
        starknetCore = IStarknetCore(_starknetCore);
    }

    function mintAssetFromL2(
        string memory _product_key,
        string memory _area,
        string memory _surface,
        uint256 _price,
        string memory _name_token,
        string memory _symbol_token
    ) public {
        uint256[] memory payload = new uint256[](7);
        payload[0] = l2TokenContractAddress;
        payload[1] = uint256(keccak256(abi.encodePacked(_product_key)));
        payload[2] = uint256(keccak256(abi.encodePacked(_area)));
        payload[3] = uint256(keccak256(abi.encodePacked(_surface)));
        payload[4] = uint256(keccak256(abi.encodePacked(_price)));
        payload[5] = uint256(keccak256(abi.encodePacked(_name_token)));
        payload[6] = uint256(keccak256(abi.encodePacked(_symbol_token)));
        // Send the message to the Starknet core contract.
        starknetCore.sendMessageToL2(l2NftFactoryContractAddress, mint_selector, payload);
    }

}

File 2 of 4 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 4 : IStarknetCore.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.0;

interface IStarknetCore {
    /**
      Sends a message to an L2 contract.
      Returns the hash of the message.
    */
    function sendMessageToL2(
        uint256 to_address,
        uint256 selector,
        uint256[] calldata payload
    ) external returns (bytes32);

    /**
      Consumes a message that was sent from an L2 contract.
      Returns the hash of the message.
    */
    function consumeMessageFromL2(
        uint256 fromAddress,
        uint256[] calldata payload
    ) external returns (bytes32);

    function l2ToL1Messages(bytes32 msgHash) external view returns (uint256);
}

File 4 of 4 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

Settings
{
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"_starknetCore","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"string","name":"_product_key","type":"string"},{"internalType":"string","name":"_area","type":"string"},{"internalType":"string","name":"_surface","type":"string"},{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"string","name":"_name_token","type":"string"},{"internalType":"string","name":"_symbol_token","type":"string"}],"name":"mintAssetFromL2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_l2NftFactoryContractAddress","type":"uint256"}],"name":"setL2NftFactoryContractAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_l2TokenContractAddress","type":"uint256"}],"name":"setL2TokenContractAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mint_selector","type":"uint256"}],"name":"setMintedSelector","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b50604051620011e1380380620011e1833981810160405281019062000037919062000182565b620000576200004b6200009f60201b60201c565b620000a760201b60201c565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050620001fc565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000815190506200017c81620001e2565b92915050565b6000602082840312156200019557600080fd5b6000620001a5848285016200016b565b91505092915050565b6000620001bb82620001c2565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b620001ed81620001ae565b8114620001f957600080fd5b50565b610fd5806200020c6000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80638da5cb5b1161005b5780638da5cb5b146100c4578063b4368733146100e2578063ef8b7ef6146100fe578063f2fde38b1461011a5761007d565b80632ae804ce14610082578063715018a61461009e5780637ba8965c146100a8575b600080fd5b61009c60048036038101906100979190610b53565b610136565b005b6100a66101bc565b005b6100c260048036038101906100bd9190610b53565b610244565b005b6100cc6102ca565b6040516100d99190610d3f565b60405180910390f35b6100fc60048036038101906100f79190610b53565b6102f3565b005b61011860048036038101906101139190610a52565b610379565b005b610134600480360381019061012f9190610a00565b610795565b005b61013e61088d565b73ffffffffffffffffffffffffffffffffffffffff1661015c6102ca565b73ffffffffffffffffffffffffffffffffffffffff16146101b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101a990610d7a565b60405180910390fd5b8060048190555050565b6101c461088d565b73ffffffffffffffffffffffffffffffffffffffff166101e26102ca565b73ffffffffffffffffffffffffffffffffffffffff1614610238576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161022f90610d7a565b60405180910390fd5b6102426000610895565b565b61024c61088d565b73ffffffffffffffffffffffffffffffffffffffff1661026a6102ca565b73ffffffffffffffffffffffffffffffffffffffff16146102c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102b790610d7a565b60405180910390fd5b8060038190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6102fb61088d565b73ffffffffffffffffffffffffffffffffffffffff166103196102ca565b73ffffffffffffffffffffffffffffffffffffffff161461036f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161036690610d7a565b60405180910390fd5b8060028190555050565b6000600767ffffffffffffffff8111156103bc577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156103ea5781602001602082028036833780820191505090505b5090506003548160008151811061042a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001018181525050866040516020016104479190610d0d565b6040516020818303038152906040528051906020012060001c8160018151811061049a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001018181525050856040516020016104b79190610d0d565b6040516020818303038152906040528051906020012060001c8160028151811061050a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001018181525050846040516020016105279190610d0d565b6040516020818303038152906040528051906020012060001c8160038151811061057a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001018181525050836040516020016105979190610d24565b6040516020818303038152906040528051906020012060001c816004815181106105ea577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001018181525050826040516020016106079190610d0d565b6040516020818303038152906040528051906020012060001c8160058151811061065a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001018181525050816040516020016106779190610d0d565b6040516020818303038152906040528051906020012060001c816006815181106106ca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001018181525050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633e3aa6c5600254600454846040518463ffffffff1660e01b815260040161073993929190610d9a565b602060405180830381600087803b15801561075357600080fd5b505af1158015610767573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078b9190610a29565b5050505050505050565b61079d61088d565b73ffffffffffffffffffffffffffffffffffffffff166107bb6102ca565b73ffffffffffffffffffffffffffffffffffffffff1614610811576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080890610d7a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610881576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087890610d5a565b60405180910390fd5b61088a81610895565b50565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600061096c61096784610e09565b610dd8565b90508281526020810184848401111561098457600080fd5b61098f848285610edf565b509392505050565b6000813590506109a681610f5a565b92915050565b6000815190506109bb81610f71565b92915050565b600082601f8301126109d257600080fd5b81356109e2848260208601610959565b91505092915050565b6000813590506109fa81610f88565b92915050565b600060208284031215610a1257600080fd5b6000610a2084828501610997565b91505092915050565b600060208284031215610a3b57600080fd5b6000610a49848285016109ac565b91505092915050565b60008060008060008060c08789031215610a6b57600080fd5b600087013567ffffffffffffffff811115610a8557600080fd5b610a9189828a016109c1565b965050602087013567ffffffffffffffff811115610aae57600080fd5b610aba89828a016109c1565b955050604087013567ffffffffffffffff811115610ad757600080fd5b610ae389828a016109c1565b9450506060610af489828a016109eb565b935050608087013567ffffffffffffffff811115610b1157600080fd5b610b1d89828a016109c1565b92505060a087013567ffffffffffffffff811115610b3a57600080fd5b610b4689828a016109c1565b9150509295509295509295565b600060208284031215610b6557600080fd5b6000610b73848285016109eb565b91505092915050565b6000610b888383610cd8565b60208301905092915050565b610b9d81610e99565b82525050565b6000610bae82610e49565b610bb88185610e6c565b9350610bc383610e39565b8060005b83811015610bf4578151610bdb8882610b7c565b9750610be683610e5f565b925050600181019050610bc7565b5085935050505092915050565b6000610c0c82610e54565b610c168185610e8e565b9350610c26818560208601610eee565b80840191505092915050565b6000610c3f602683610e7d565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610ca5602083610e7d565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b610ce181610ed5565b82525050565b610cf081610ed5565b82525050565b610d07610d0282610ed5565b610f21565b82525050565b6000610d198284610c01565b915081905092915050565b6000610d308284610cf6565b60208201915081905092915050565b6000602082019050610d546000830184610b94565b92915050565b60006020820190508181036000830152610d7381610c32565b9050919050565b60006020820190508181036000830152610d9381610c98565b9050919050565b6000606082019050610daf6000830186610ce7565b610dbc6020830185610ce7565b8181036040830152610dce8184610ba3565b9050949350505050565b6000604051905081810181811067ffffffffffffffff82111715610dff57610dfe610f2b565b5b8060405250919050565b600067ffffffffffffffff821115610e2457610e23610f2b565b5b601f19601f8301169050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b6000610ea482610eb5565b9050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015610f0c578082015181840152602081019050610ef1565b83811115610f1b576000848401525b50505050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610f6381610e99565b8114610f6e57600080fd5b50565b610f7a81610eab565b8114610f8557600080fd5b50565b610f9181610ed5565b8114610f9c57600080fd5b5056fea26469706673582212202a03bfc2ace4508a2e368bec48f276672a919482d82d522645bca493e15ed9ba64736f6c634300080000330000000000000000000000000d761163e8bdc22fec278fea0c7a95e7b2dfa3c3

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000000d761163e8bdc22fec278fea0c7a95e7b2dfa3c3

-----Decoded View---------------
Arg [0] : _starknetCore (address): 0x0d761163e8BDc22fec278FEa0C7A95e7B2dfa3C3

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000000d761163e8bdc22fec278fea0c7a95e7b2dfa3c3


Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.