The Conventional Commits specification is a lightweight convention on top of commit messages. It provides an easy set of rules for creating an explicit commit history; which makes it easier to write automated tools on top of. This convention dovetails with SemVer, by describing the features, fixes, and breaking changes made in commit messages.
This is not an exhaustive list of all interfaces in Go's standard library.
I only list those I think are important.
Interfaces defined in frequently used packages (like io, fmt) are included.
Interfaces that have significant importance are also included.
All of the following information is based on go version go1.8.3 darwin/amd64.
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.19; | |
| contract LogEmitter { | |
| event Log(address indexed msgSender); | |
| function emitLog() public { | |
| emit Log(msg.sender); | |
| } |
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; | |
| import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; | |
| contract StorageBug is Ownable { | |
| function write(uint256 number) external onlyOwner { | |
| uint256[] storage arr; | |
| arr.push(number); |
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; | |
| // x -----> | |
| // _______________ | |
| // y |____|____|_____ | |
| // |____|____|_____ | |
| // |____|____|_____ | |
| // |____|____|_____ |
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: UNLICENSED | |
| pragma solidity ^0.8.0; | |
| // Simple contract to swap two variables in Solidity | |
| contract Swapper { | |
| uint8 public x = 1; | |
| uint8 public y = 2; | |
| function swap() public { |
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.6.10; | |
| /* | |
| EtherStore is a contract where you can deposit any amount and withdraw at most | |
| 1 Ether per week. This contract is vulnerable to re-entrancy attack. | |
| Let's see why. | |
| 1. Deploy EtherStore | |
| 2. Deposit 1 Ether each from Account 1 (Alice) and Account 2 (Bob) into EtherStore |
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
| pragma solidity 0.4.24; | |
| import "https://github.com/smartcontractkit/chainlink/evm-contracts/src/v0.4/ChainlinkClient.sol"; | |
| import "https://github.com/smartcontractkit/chainlink/evm-contracts/src/v0.4/vendor/Ownable.sol"; | |
| contract ATestnetConsumer is ChainlinkClient, Ownable { | |
| uint256 constant private ORACLE_PAYMENT = 1 * LINK; | |
| uint256 public currentPrice; | |
| int256 public changeDay; |
NewerOlder