Smart Contracts

15 Tips to Write Better Smart Contracts

Functions should be concise and self-explanatory. Any functions which look too large, or perform nested loops or recursion should be revisited. More computation means more gas, meaning it costs more to perform those functions.Consider off-chain computing to take some load off your blockchain application. For example, decentralised exchanges use off-chain order filling algorithms to fill orders, since the algorithm is quite complex. Once an order is filled, the settlement is performed on the blockchain.If reducing complexity is too difficult, consider the possibility that blockchain may not be the ideal solution

Smart Contracts: Don’t Reinvent the Wheel

SafeMathIn most modern programming languages, safety in arithmetic operations is accounted for, so little thought goes into their implementation. However, in Solidity, overflows and underflows present a security risk.SafeMath is a library that ensures safe arithmetic operations by reverting the transaction if the bounds of an integer data type are exceeded.SafeMath example.The using statement indicates to the compiler that the contract is using functions defined in SafeMath for uint operations. Instead of using arithmetic operators (+, -, *, /, %), use the functions add(), sub(), mul(), div(), and mod(). Source:

Ripple Funds Blockchain’s Disruption of the Legal Industry

A new blockchain course offered by the Australian National University (ANU)’s law school commenced this year with support from Ripple’s University Blockchain Research Initiative (UBRI).Cointelegraph spoke to Lauren Weymouth, the senior manager of the UBRI’s University Partnerships Program, and Scott Chamberlain, the academic running the curriculum, to find out more about how blockchain can disrupt the legal industry and the partnership between the ANU and UBRI.Chamberlain will be working alongside the developer behind the Toast XRPL Wallet, Richard Holland, to develop and deliver the course.ANU law school launches blockchain courseChamberlain

South African National Blockchain Alliance Holds Online Launch

The South African National Blockchain Alliance carried out an online livestream launch while the country is in the midst of a 21-day lockdown to curb the spread of the coronavirus pandemic. The organization was due to be launched at the beginning of April in Johannesburg but had to be taken online as South Africa and the world tackles a global health crisis.The launch happened during a livestream on YouTube on April 3, which included a panel of speakers elaborating on how SANBA will help nurture blockchain-focused startups and companies that

1.1 Million In USDC Invested Into Uniswap and PoolTogether By Coinbase

Coinbase, one of the world’s heavyweight exchanges, has recently invested 1.1 million in USDC to the decentralized finance protocols of PoolTogether and Uniswap.Pushing In 1.1 Million In USDC To Smart ContractsAccording to the announcement the San Francisco-based crypto exchange had made, the funding itself comes from its USDC Bootstrap Fund. This Fund was created back in September of last year, with an initial funding clocking in at $2 million. The move itself comes as a bid from the exchange to stimulate the growth of the USDC within the Decentralized Finance