January 2019
Beginner to intermediate
372 pages
11h 17m
English
The application logic is similar to that of one used in the NEO smart contract. But the data structure used to store the asset information is different due to the functionalities provided by the virtual machine. One major difference between NEO and Ethereum contract is that the functions in Ethereum contracts can be directly invoked with the help of ABI.
The ProofOfOwnership smart contract uses a mapping data structure to store the asset ownership information in a key/value pair. The asset information of type bytes32 is mapped to the Ethereum address of the asset owner:
pragma solidity ^0.4.23;
contract ProofOfOwnership {
mapping (bytes32 => address) public assetOwners;
The registerAsset function maps the address ...