paint-brush
How we Tested Plutus Smart Contracts on Cardano by@metalamp
428 reads
428 reads

How we Tested Plutus Smart Contracts on Cardano

by MetaLampJune 10th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

MetaLamp has been invited to take part in the Plutus Partners Program in order to help facilitate Cardano ecosystem development. The team has been dealing with commercial blockchain products for five years. It has experience with financial technology and has built applications involving lenders, loans, and ledgers. It also performed blockchain projects related to different other domains: games, cloud services etc. The company has its own educational program and developer development map that helps employees navigate the system of professional knowledge and skills. It is proud of the highly developed culture of self-education in the team.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail

Coins Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - How we Tested Plutus Smart Contracts on Cardano
MetaLamp HackerNoon profile picture

The beginning of 2021 was challenging for our team, and as the story showed later, game-changing.

At Metalamp, we started a partnership with IOHK, the company that founded the blockchain platform Cardano. Our team has been invited to take part in the Plutus Partners Program in order to help facilitate Cardano ecosystem development.

IOHK compared the unused infrastructure they built with a new road with no cars. They were interested to check its quality and workability in the field. So, MetaLamp turned out to be one of the first vehicles that opened a new route. And its crew helped the builders of the road to search, find and fix all the «bumps».

Willing to provide high fidelity testing, IOHK looked for the appropriate software development agencies all over the globe. After negotiations, only five teams were selected, and MetaLamp was among them.

Why were we invited?

There were four factors that let the MetaLamp team attract Cardano founders’ interest.

1. Solid experience in Haskell

Since Plutus was written in Haskell, a profound knowledge of functional programming languages was a must-have. Thanks to involvement in the development of tricky and highly loaded projects with this technology stack since 2014, the team gained a rich experience in building complicated solutions in Haskell.


If you have not used the Haskell language and the Nix development tool before, it is simple to drown in syntax and compilation errors learning Plutus.
Kirill Elizarov, blockchain developer at MetaLamp

2. Ability to manage hard and tricky tasks and enthusiastic approach

If we talk about the specifics of MetaLamp, we have always tried to take some non-standard projects, there have never been template ones. Every time we just study everything from scratch, think over the architecture, search for the information a lot, communicate with other experts who have experience in this field. Any project we create has the same specifics as working in an experimental mode. Most of the time is spent thinking through solutions, not writing code.
Darya Trifonova, project manager at MetaLamp

So, by the time of participation in the Plutus Partners Program the MetaLamp developers were ready to face any challenges: they used to work with unconventional tasks.

We’re working with companies that really want to try something new, something innovative and interesting.
Gerard Moroney, director of operations in IOHK

And that is where the desire of MetaLamp to be ahead of the curve coincided with the opportunity offered by the Plutus Partner Program to try the unknown.

3. Proven track in blockchain

By the time the Plutus Partners Program started, MetaLamp had been dealing with commercial blockchain products for five years. The team has experience with financial technology and has built applications involving lenders, loans, and ledgers. MetaLamp also performed blockchain projects related to different other domains: games, cloud services etc.

4. Special culture in the team

MetaLamp is proud of the highly developed culture of self-education in the team. The company has its own educational program and developer development map that helps employees navigate the system of professional knowledge and skills.

The development map gives us a very large fundamental base and traditions in self-development. In the absence of a culture of self-development, a culture of leveling skills, the implementation of the study of Plutus would take much longer, and it would be a more vague task for us than it eventually was.
Roman Shtykh, CEO at MetaLamp

Overcoming the training program and internal exams designed by the studio, IT engineers learn to fill the gaps in their knowledge quickly and on their own. As this ability to acquire necessary skills is honed sharply, developers can manage the tasks that require learning a lot of new things qualitatively and fast.

Which tasks did we solve and what difficulties did we face?

«If you are not embarrassed by the first version of your product, you’ve launched too late», Reid Hoffman, the founder of LinkedIn said. The team of Cardano developers pursued the aim to deliver the product on time, but first make sure its quality is worth recognition. That’s why they focused a lot of effort to attract heavyweight expertise in order to check Plutus’ workability.

A smart contract is an application that constructs transactions and sends them to the blockchain according to definite rules. These rules cannot be violated by any blockchain user, they act like a contract in the traditional banking sector. The Plutus platform allows you to write smart contracts on the Cardano blockchain, which uses the UTXO model for ledger, which distinguishes it from other blockchains that have functionality for developing smart contracts.
Stanislav Zhdanovich, blockchain developer at MetaLamp

In this journey towards deployment of Alonzo on the mainnet and the start of smart contracts on Cardano, the IOHK engineers wanted to feel assured that the next hard fork would match their high standards.

To complete the quality assurance tasks at a top level, the MetaLamp team members had to dive into the project and meticulously learn the required information.

We were given time to study the documentation and lectures of the Plutus Pioneer Program before we started writing smart contracts. It was a bit difficult to understand, but the lectures helped a lot to “touch the code with your hands”. We could run it and see the result, make some changes of our own and see what happens. This experience tangibly helped me. This is a hard fork that includes smart contracts in the Cardano testnet. Testing made it possible to see in what form UTXOs are stored, how to use them in a transaction, and how to perform validation.
Olga Klimenko, the MetaLamp blockchain developer

One of the first obstacles the MetaLamp engineers faced was the lack of documentation to sort out some things.

The only drawback of the program is that IOG is now actively rolling out new features and updates, sometimes even changing the main API of some functions, that’s why lectures can quickly become outdated. But the authors of the program are trying to keep it updated. By the moment, three versions of these lectures have already been published.
Kirill Elizarov, blockchain developer at MetaLamp

They worked in such a format when there were constant calls, questions about what challenges they faced, there was no such thing during the regular development process. There was a lot of support from the core internal IOHK team.

We directly communicated with IOHK leaders, their operating officer and education director. It was super! Lars was very responsive and helpful (Lars Brünjes — education director at IOHK, PhD in pure mathematics passionate about functional programming in general and Haskell in particular.)
Darya Trifonova, project manager at Metalamp

The special community in Discord, where help can be asked, was very supportive for novice developers of smart contracts too.

But sometimes we had to look at the source code of Plutus and figure it out ourselves
Olga Klimenko, blockchain developer at MetaLamp

She notes that fundamental preparation is a rewarding approach in any domain, and blockchain isn’t an exception. If you try to write smart contracts right away, it’s almost impossible. But if you start with studying the theory (what it is and how it works), then get over to the specific blockchain (in our case, Cardano), after that try to conduct simple transactions, and finally write smart contracts, then it becomes easier.

In some cases learning the existing solutions in Ethereum served as a hint in a development process.
Stanislav Zhdanovich, blockchain developer at MetaLamp

During the period of MetaLamp participation in the program, IOHK did not have a testnet, which supported smart contracts.That also added some difficulties to the process.

We only worked with the simulation, and when the testnet appeared, it turned out that it did not support many features, for example, PAB with wallets, state machines, etc. And the code that we successfully ran in the simulation would not necessarily work in a real network. It was difficult when we had to look for workarounds to make the contract work in the testnet, if some bugs did not allow it. We left reviews and talked with the Plutus developers and other teams who participated in the testing contracts program in order to discuss ways to fix or work around the errors.
Olga Klimenko, blockchain engineer at MetaLamp

Failures are the stepping-stones to success, as the proverb goes. And working on the project, MetaLamp got solid experience with Cardano tools. The profound expertise of our teammates was appreciated by IOHK engineers, and we were invited to take part as supervisors in the Cardano hackathon, based on the Plutus language.

At Cardano Summit our developers helped participants write a defi application.

What are the results that we have achieved in the Program?

As a result, before the end of the program, we managed to write an NFT marketplace with an auction, but we did not have enough time to put it into the testnet. Rewriting with state machines took a long time, and the testnet met us with unexpected errors. When we launched a marketplace in the testnet, it turned out that there was no way to sign transactions, because there was no integration of wallets and PAB.
Olga Klimenko, blockchain developer at MetaLamp

By the moment, most of the problems that appeared during the end of the program have already been solved, so everything should go more smoothly in the testnet.

Working in close collaboration with the internal IOHK team, the MetaLamp developers helped them find the bugs and participated in brainstorming on how it could be fixed or improved.

To look wider, this experience allowed the development team to expand their knowledge significantly and start creating products not only on Cardano, but on Ethereum too.

How has this experience impacted the MetaLamp expertise?

Participation in the partner program was a turning point in the company’s work: the IT engineers dived into specific areas of the software development on blockchain platforms, acquired deep knowledge of Cardano and Ethereum and specifically, became the first developers who managed to write smart contracts on Plutus.

We have become more well-known in the crypto community, and our team joined new blockchain projects. We began to expand the list of technologies, and now we are working not only with Cardano, but also with Ethereum. We have been invited more often as experts in the media and to various profile events
Rostislava Glebovich, Head of sales at MetaLamp

All this activity resulted in increasing the number of customers interested in blockchain technologies.

At the moment we are involved in several ambitious blockchain projects related to DeFi. But since they are under NDA, we can’t share details. As we were the one of the first companies that started development of complex products on blockchain, we got an advantage in terms of better experience and proven expertise in the domain. It couldn’t help impacting the demand for our specialists and recognition of their skills in the community.
Roman Shtykh, CEO at MetaLamp

The MetaLamp team is excited by Cardano opportunities.The throughput of 257 transactions per second is a breakthrough in comparison with Ethereum that offers 8 times fewer or Bitcoin — 35 times fewer. The cost of transactions is lower than in other blockchain that also adds attractiveness to the platform. Energy consumption is optimized due to the consensus protocol, the Proof of Stake, which is obviously more ecology-friendly than the Proof of work. In the light of developing secure smart contracts, the high speed and low cost of transactions, and the ability for scaling make Cardano a promising technology for innovative projects.

For example, MetaLamp team has been cooperating with Iagon engineers working on the decentralized Cloud Service. Having numerous awards in background and strategic partnership with IOHK, MetaLamp became «a perfect match» for an ambitious project. «Haskell developers are hard to come by, they are like diamonds, but worth more», says the client, assessing the experience of collaboration with our experts.

Now smart contracts are a pain point in Cardano. But the developers work on the issues at a rapid pace. And when smart contracts appear in the mainnet, the popularity of the technology will skyrocket predictably. Many DeFi products will get funded, and as a result, demand for experts in the industry will increase.

DeFi applications are developing by leaps and bounds, the market is growing every year, and it will grow further, and any consensus of economists and analysts says that this market will grow in the next 5–10–15 years. DeFi products have great potential, and they are taking a large share from traditional finances and will continue to take it away. To what limits they will extend, we do not know, but the potential of the market feels quite enormous
Roman Shtykh, CEO at MetaLamp

The company is happy to be at the origins of the creation of significant blockchain products and contributes a lot to ecosystem development. At the moment the team takes part in the development process of many significant projects based on blockchain, ranging from NFT marketplaces to heavyweight infrastructure projects, including Bridge, L2 etc. We’re proud that we’ve managed to overcome all the difficulties related to mastering a new technology, and at the new level we’ve become sufficiently equipped with knowledge and skills to meet any challenges that the market can offer.