Create A Contract

Published by Marianne Poser on

1st Step: Open the Remix page in your browser (https://remix.ethereum.org ) and create a new Solidity file. In our example, we name the file “TreasureBox.sol”.

2nd Step: In the newly created file, we now create the contract at first without content. The contract name is assigned, which corresponds to the file name. Additionally, the version pragma for the compiler must be defined.

3rd Step: Our new contract becomes an ERC1155 contract by first importing the ERC1155 contract from OpenZeppelin and defining the contract as ERC1155. In addition, the associated (imported) constructor is called in the contract. Within the constructor, the URI of your project is already passed. (The given URI is only for test purposes and is not a real project! – Choose your own!) Behind this address, information about the tokens can be stored, e.g., image data of NFTs.

Categories: