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
export CHAIN_ID="elgafar-1" | |
export TESTNET_NAME="elgafar-1" | |
export FEE_DENOM="ustars" | |
export STAKE_DENOM="ustars" | |
export GENESIS_URL="https://raw.githubusercontent.com/CosmWasm/testnets/master/malaga-420/config/genesis.json" | |
export RPC="https://rpc.elgafar-1.stargaze-apis.com:443" |
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.19; | |
// Reference: https://www.quicknode.com/guides/ethereum-development/smart-contracts/a-broad-overview-of-reentrancy-attacks-in-solidity-contracts#explaining-reentrancy-with-custom-solidity-contracts | |
import "./TheBank.sol"; | |
contract TheAttacker { | |
TheBank public theBank; | |
constructor(address _thebankAddress) { |
See how a minor change to your commit message style can make a difference. Examples
Have a look at CLI util git-conventional-commits to ensure this conventions and generate changelogs
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.20; | |
import "@openzeppelin/contracts/governance/Governor.sol"; | |
import "@openzeppelin/contracts/governance/extensions/GovernorSettings.sol"; | |
import "@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol"; | |
import "@openzeppelin/contracts/governance/extensions/GovernorVotes.sol"; | |
import "@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol"; | |
import "@openzeppelin/contracts/governance/extensions/GovernorTimelockControl.sol"; |
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
import { ethers } from "ethers"; | |
// Using this if cannot serialize bigint | |
BigInt.prototype.toJSON = function () { | |
const int = Number.parseInt(this.toString()); | |
return int ?? this.toString(); | |
}; | |
// Define provider | |
const provider = new ethers.JsonRpcProvider(RPC_URL) |
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.13; | |
import "wormhole-solidity-sdk/interfaces/IWormholeRelayer.sol"; | |
import "wormhole-solidity-sdk/interfaces/IWormholeReceiver.sol"; | |
contract HelloWormhole is IWormholeReceiver { | |
event GreetingReceived(string greeting, uint16 senderChain, address sender, address senderContract); | |
uint256 constant GAS_LIMIT = 50_000; |
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
{ | |
"@context": [ | |
{ | |
"@protected": true, | |
"@version": 1.1, | |
"id": "@id", | |
"type": "@type", | |
"DriversLicense": { | |
"@context": { | |
"@propagate": true, |
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; | |
// Reference: https://ethereum.stackexchange.com/questions/117725/passing-functions-as-parameters-how-to-invoke | |
contract A { | |
enum Action { Walk, Fly, Swim } | |
function walk() internal pure returns (uint) { |
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 "./ArrayLib.sol"; | |
contract ArrayContract { | |
using ArrayLib for uint256[]; // Import the library for use with uint256[] arrays | |
uint256[] private arr; // The array to store uint256 elements |