Skip to content

Instantly share code, notes, and snippets.

View dennis-gonzales's full-sized avatar
💻
Coding never stops

Dennis Gonzales dennis-gonzales

💻
Coding never stops
View GitHub Profile
@dennis-gonzales
dennis-gonzales / esm-package.md
Created August 9, 2023 02:30 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.3;
contract Bank {
enum Action { Deposit, Transfer, Withdrawal }
struct Transaction {
string details;
uint timestamp;
@dennis-gonzales
dennis-gonzales / basics.sol
Last active March 18, 2023 10:22
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.0+commit.26b70077.js&optimize=true&gist=
// import openzeppelin contract in remix
// import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol";
// import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Address.sol";
// import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol";
pragma solidity ^0.6.0;
contract Inbox {
string private _message;
@dennis-gonzales
dennis-gonzales / sample.md
Last active August 28, 2020 01:56 — forked from bradtraversy/sample.md
Markdown Cheat Sheet

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

This text is italic