Skip to content

Instantly share code, notes, and snippets.

View mingderwang's full-sized avatar
:bowtie:
On chain, building L2

Ming-der Wang mingderwang

:bowtie:
On chain, building L2
View GitHub Profile
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./SimpleERC20.sol";
import "./UniswapV2PairLike.sol";
contract TestUniswapV2Pair {
SimpleERC20 public tokenA;
SimpleERC20 public tokenB;
UniswapV2PairLike public pair;
/**
** Account-Abstraction (EIP-4337) singleton EntryPoint implementation.
** Only one instance required on each chain.
**/
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.12;
/* solhint-disable avoid-low-level-calls */
/* solhint-disable no-inline-assembly */
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/ECDSA.sol)
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;
import "./ECDSA.sol";
contract MultiSigWallet {
using ECDSA for bytes32;
address[2] public owners;
mapping(bytes32 => bool) public executed;
@mingderwang
mingderwang / AbstractWallet.sol
Last active September 25, 2024 03:14
refer to https://github.com/mingderwang/me/wiki deploy to sepolia 0xee96d999Ea10b2CCB8Ba20B3FAe0f431e394336f
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
contract AbstractWallet is Ownable {
constructor() Ownable(msg.sender) {
}
mapping(address => bool) public authorizedAddresses;
@mingderwang
mingderwang / gist:6c1eeaa801559cd0d9b05aaa9c99e1f9
Created April 14, 2024 17:52
if you got this error: > NX Could not find ".modules.yaml" at ".../node_modules/.modules.yaml"
// just
npm install -g @nrwl/cli@latest
npm install -g lerna@latest
// or even
rm -rf node_modules package-lock.json
npm install
pragma solidity ^0.8.0;
contract ExampleContract {
struct PassKeyId {
uint256 pubKeyX;
uint256 pubKeyY;
string keyId;
}
// You can declare a variable of type PassKeyId
/* solhint-disable */
// SPDX-License-Identifier: MIT
// from OpenZeppelin Contracts (last updated v4.7.0) (utils/Base64.sol)
pragma solidity ^0.8.19;
/**
* @dev Provides a set of functions to operate with Base64 strings.
*
* _Available since v4.5._
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.17;
//
// Heavily inspired from
// https://github.com/maxrobot/elliptic-solidity/blob/master/contracts/Secp256r1.sol
// https://github.com/tdrerup/elliptic-curve-solidity/blob/master/contracts/curves/EllipticCurve.sol
// modified to use precompile 0x05 modexp
// and modified jacobian double
// optimisations to avoid to an from from affine and jacobian coordinates
//
@mingderwang
mingderwang / gist:d9852d87fb038b2bdab5b15ff4e43d0c
Created March 12, 2024 06:19
export NODE_OPTIONS=--openssl-legacy-provider
odules/babel-loader/lib/index.js:51:103 {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}