This file contains hidden or 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
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.8; | |
| contract SimpleStorage { | |
| uint256 favoriteNumber; | |
| mapping(string => uint256) public nameToFavoriteNumber; | |
| struct People { | |
| uint256 favoriteNumber; |
This file contains hidden or 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
| // SPDX-License-Identifier: MIT | |
| pragma solidity 0.8.0; | |
| contract Example3 { | |
| uint256 count; | |
| uint256 public time; | |
| constructor(){ |
This file contains hidden or 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
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity 0.8.0; | |
| contract Bank { | |
| address public owner; | |
| mapping(address => uint256) depositor; | |
| address[] public depositors; | |
| constructor() { |
This file contains hidden or 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
| // SPDX-License-Identifier:MIT | |
| pragma solidity 0.8.0; | |
| contract Tuple { | |
| function getValues() public pure returns (int, bool) { | |
| return (49, true); | |
| } | |
| function get() public pure returns (int) { |
This file contains hidden or 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
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity ^0.8.0; | |
| contract Vault { | |
| // a contract where the owner create grant for a beneficiary; | |
| //allows beneficiary to withdraw only when time elapse | |
| //allows owner to withdraw before time elapse | |
| //get information of a beneficiary | |
| //amount of ethers in the smart contract |
This file contains hidden or 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
| //SPDX-License-Identifier: GPL-3.0; | |
| pragma solidity 0.8.7; | |
| contract Energy { | |
| //have total supply | |
| //transferrable | |
| //name | |
| //symbol | |
| //decimal |
This file contains hidden or 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
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity 0.8.4; | |
| import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol"; | |
| contract Erc20Token is ERC20("fire on", "FIO") { | |
| constructor() { | |
| _mint(address(this), 10000e18); | |
| } |
This file contains hidden or 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
| package main | |
| import ( | |
| "crypto/sha256" | |
| "fmt" | |
| ) | |
| func main() { | |
| hash := sha256.New() | |
| hash.Write([]byte("Hello, World!")) |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| "golang.org/x/crypto/sha3" | |
| ) | |
| func main() { | |
| data := "Hello, Ethereum!" |
This file contains hidden or 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
| package main | |
| import ( | |
| "crypto/ecdsa" | |
| "fmt" | |
| "log" | |
| "github.com/ethereum/go-ethereum/crypto" | |
| "github.com/ethereum/go-ethereum/common" | |
| ) |
OlderNewer