This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import styles from './App.module.css'; | |
class App extends Component { | |
state = { | |
users: null, | |
total: null, | |
per_page: null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** associate without labels */ | |
enum Trade { | |
case Buy(String, amount) | |
case Sell(String, Int) | |
} | |
Trade.Buy("Firstbank PLC", 300) | |
Trade.Sell("Firstbank PLC", 700) | |
/** associate with labels */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.6.4; | |
contract Token { | |
... | |
... | |
mapping(address => uint) public balanceOf; | |
event Transfer(address indexed _from, address indexed _to, uint256 _value); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.6.4; | |
contract Token { | |
... | |
... | |
mapping(address => uint) public balanceOf; | |
event Transfer(address indexed _from, address indexed _to, uint256 _value); | |
function transfer(address _to, uint _value) public returns (bool success) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.6.4; | |
contract Token { | |
uint public totalSupply; | |
mapping(address => uint) public balanceOf; | |
constructor(uint _totalSupply) { | |
totalSupply = _totalSupply; | |
balance[msg.sender] = _totalSupply; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.6.4; | |
contract Token { | |
uint public totalSupply; | |
constructor(uint _totalSupply) { | |
totalSupply = _totalSupply; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.6.4; | |
contract Token { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.6.4; | |
contract Token { | |
uint public decimals = 18; | |
string public symbol = 'AT'; | |
string public name = 'Agoi Token'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
networks: { | |
development: { | |
host: "127.0.0.1", // Localhost (default: none) | |
port: 7545, // Standard Ethereum port (default: none) | |
network_id: "*", // Any network (default: none) | |
}, | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Person { | |
var firstname: String | |
var middlename: String | |
var lastname: String | |
} | |
//this will definitely work because i have a middlename | |
let me = Person(firstname: "Abel", middlename: "abel", lastname: "Adeyemi") | |
//This will throw an error |
NewerOlder