Contracts

What is it

Contracts can be assimilated to class in oriented-object programming. They define a template for the initial state (variables) and implementation of behaviours (functions).

To be more concrete, here is how you would write a contract in Solidity

contract MyContractName {
  // everything that goes into your contract
}

contract is a keyword telling Solidity what you are writing is a contract. MyContractName is the name of the contract and can be assigned to whatever you like, while following the conventions The contract details are within the two brackets { }

Conventions

For usability, Solidity decided to use CamelCase for its naming convention. Therefore, all words in a contract name should be capitalised. SpacecryptFactory is right while both spacecryptFactory and Spacecrypt_Factory are not.

Exercise
Correct!
False!

Loading...

Declare a contract named SpacecryptFactory
pragma solidity ^0.4.24; // Every big success starts small. Yours starts here

Hint

Don't forget to accept the contract deployment in Metamask

results matching ""

    No results matching ""