Skip to content

Instantly share code, notes, and snippets.

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

Ming-der Wang mingderwang

:bowtie:
On chain, building AA wallet
View GitHub Profile
@mingderwang
mingderwang / index.ts
Created August 10, 2025 01:35
.env -> DATABASE_URL='postgresql://neondb_owner:[email protected]/neondb?sslmode=require&channel_binding=require'
import { Kysely, Generated } from 'kysely';
import { NeonDialect } from 'kysely-neon';
import ws from 'ws';
import * as dotenv from 'dotenv';
dotenv.config();
// Define database interface
interface Database {
contacts: ContactTable;
// 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
//