Posts

Showing posts with the label Smart contract example

Smart contract code for Anyone can send coins to each other without a need for registering with a username and password with help of Ethereum keypair

Smart contract code for Anyone can send coins to each other without a need for registering with a username and password with help of Ethereum keypair The contract allows only its creator to create new coins (different issuance schemes are possible). Anyone can send coins to each other without a need for registering with a username and password, all you need is an Ethereum keypair.  // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.4; contract Coin {     // The keyword "public" makes variables     // accessible from other contracts     address public minter;     mapping (address => uint) public balances;     // Events allow clients to react to specific     // contract changes you declare     event Sent(address from, address to, uint amount);     // Constructor code is only run when the contract     // is created     constructor() {         minter = msg.se...