May 12, 2026

Truffle Suite Recap with v5.0.36 ~relative latest~ – Yuya Sugano

Truffle Suite Recap with v5.0.36 ~relative latest~ – Yuya Sugano

Truffle Suite Recap with v5.0.36 ~relative latest~ – Yuya Sugano

Truffle Suite Recap with v5.0.36 ~relative latest~ – Yuya Sugano

How can smart contracts be created in Ethereum? It’s straightforward in Ethereum. A smart contract can be created by a transaction from one of EOA (Externally Owned Accounts). EOA are accounts those that have a private key. On the other hand contract addresses do not have a private key but it’s controlled by the logic of its smart contract code, so contract addresses are calling points from EOA or other contracts to execute the codes and functions inside its smart contract. OK understand that a smart contract can be created by a transaction. But what is a transaction? In this era we have seen a lot of transactions in our daily lives. In Chapter 6 of “Mastering Ethereum” its preface explains well:

Transactions are signed messages originated by an EOA, transmitted by the Ethereum network, and recorded on the Ethereum blockchain.

In simple word transactions are the only ways to trigger a change of state of Ethereum, or cause a contract to execute in the EVM. Ethereum doesn’t run autonomously. It’s said that everything starts with a transaction. A transaction consists of the following data and serialized using the Recursive Length Prefix (RLP) encoding scheme before signed. Nonce, Gas price, Gas limit, Recipient, Value, Data, v,r,s are nine elements in the transaction message.

transaction example

We don’t go deeper into each element of a transaction message here but understanding those elements is important to handle smart contracts appropriately. Especially the filed Value and Data are considerable to distinguish a payment trasaction, an invocation or a contract creation. Transactions can have both Value and Data only Value, only Data, or neither Value nor Data. All four combinations are valid.

  • Only Value — a payment to EOA or to a contract address changing its balance with the fallback function
  • Only Data — an invocation to a contract address to invoke one of the functions in that contract, as of now it doesn’t make any sense to send Data to EOA but it shows on a user wallet as data
  • Value and Data — a payment and an invocation, when it goes to a contract address both a payment and an invocation explained above could happen on that contract address, in case of EOA a normal payment happens on its balance and Data shows
  • Neither Value nor Data Nothing happens except gas emission of the originator of the transaction

I could raise one exception besides four cases mentioned above in a transaction. That is a contract creation by a trasaction from EOA. A contract creation is a special case of one of transactions to a special destination address that is called the Zero address 0x0 ; to field in a contract registration transaction must contain the zero address as a destination. This address represents neither an EOA nor a contract. When a compiled bytecode of a smart contract is set on Data in transaction messages, it must be signed and sent to the Zero address for creating a contract. The contract address is given once a pile of transactions are mined and executed in the network. The given contract address can be used in a transaction as the recipient, sending funds to the contract or calling the contract’s functions as usual. If you have web3js you can embed your bytecode in data: and send a transaction. The transaction will be signed and broadcasted to the network.

Writing programs, smart contracts on Ethereum EVM needs a compiler to translate programs into raw byte codes when we need to deploy it on Ethereum EVM. Becacuse this virtual machine understand only machine code that human can’t understand. Human can understand high-level programing language such as Serpent, Solidity, Vyper, Bamboo for writing Ethereum smart contracts. As smart contracts are immutable it’s crucial to select a language that can be written with less side-effects and less fraws as much as expected. As of now Solidity is kind of de-facto standard language to write smart contracts in Ethereum. As Solidity is evolving rapidly it would be better to install the latest version with compatible tools, and it is one of motivations for me to write this Truffle article with the relative latest version.

Published at Fri, 07 Feb 2020 11:17:33 +0000

{flickr|100|campaign}

Previous Article

19 Million XRP Tokens Move to Jed McCaleb’s Wallet, Dump Inbound?

Next Article

Everyone Loves A Winner & Cryptocurrencies Are Winning Again

You might be interested in …