Block Chain Technology and Investments Buzz for Beginners

Discuss Blockchain Technology Platform, Crypto Currencies, ICO's, ETF's, NFT's and more...

Crypto Stocks/ETFs

Funds that invest in companies involved in development and use of blockchain technology or Futures contracts that track the performance of cryptocurrencies or holding the underlying crypto-assets.

Start a Bitcoin full node on your computer (Supported OS : Linux, Mac, BSD, Windows)

$ curl https://bitnodes.io/install-full-node.sh | sh

Solidity - PersonalContract Example code

pragma solidity ^0.4.21;

//This is a simple Contract.  Usecase:  Lend $1000 to a Friend.

contract PersonalBond {

    // Publicly accessible state variable. address type is 160-bit. Stores addresses of the contract
    // keyword public, automatically creates a function function minter() returns (address) { return minter; } outside of the code to give access to the outside.
    address public minter;
   
    // map the addresses to unsigned int
    mapping (address => uint) public balances;

    event Sent(address from, address to, uint amount);
   
    function PersonalBond() public {
        minter = msg.sender;
    }

    function mint(address receiver, uint amount) public {
        if (msg.sender != minter) return;
        balances[receiver] += amount;
    }

    function send(address receiver, uint amount) public {
        if (balances[msg.sender] < amount) return;
        balances[msg.sender] -= amount;
        balances[receiver] += amount;
        emit Sent(msg.sender, receiver, amount);
    }
}

1 comment:

  1. The information you've provided is quite useful. It's incredibly instructional because it provides some of the most useful information. Thank you for sharing that. Ethereum Scalability Solutions Online

    ReplyDelete