• Stars
    star
    141
  • Rank 260,062 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 5 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Repository contains generalized meta transaction standard that can be added to any smart contract to allow Meta Transactions from any externally-owned (key-based) account.

Generalized Meta Transaction

Repository containing a gas cost effective standard for meta transaction to be used by any contract to enable native meta transaction feature on any function. The approach support signed typed messages so that while signing the data on client side user see a human readable message instead of scary hex string.

You can see the LIVE DEMO Here(works on Kovan)

The standard is the result of initiative by metamask here https://medium.com/metamask/announcing-a-generalized-metatransaction-contest-abd4f321470b

Biconomy was selected as one of the finalist in the hackathon. Read here

How do i use this in my Smart Contracts?

  1. Inherit EIP712MetaTransaction contract
  2. Use msgSender() method where ever you were using msg.sender

How do i use this in my client code?

In order to execute meta transactions you just need to call executeMetaTransaction(address userAddress, bytes memory functionSignature, bytes32 sigR, bytes32 sigS, uint8 sigV) inherited from EIP712MetaTransaction.sol

userAddress => externally owned address of the user eg the user address in his metamask wallet

functionSignature => ABI encoding of function name with its parameter. Use web3 encodeABI method here

sigR => 32 bytes r part of the signature

sigS => 32 bytes s part of the signature

sigV => integer v part of the signature

r,s,v can be calculated using web3 getSignatureParameters utility method.

Since this standard supports EIP-712 so signature parameters should be generated using eth_signTypedData_v3 or eth_signTypedData_v4 JSON RPC method.

How to Run test cases

Setup
Rename .secret.example to .secret and add 12 word mnemonic string in the first line

NOTE: Make sure you have nodejs version > 12.0.0

  1. Hardcode the chainId() at line 28 in EIP712Base.sol to the specific network Id e.g 42 for Kovan etc.
  2. Similarly change the same networkId as above in EIP712MetaTransaction.test.js at line 146.
  3. Run npm install command to install all the dependencies
  4. Run ganache-cli in separate cmd/terminal to run ganache client
  5. At last, Run npm run test to run all the test cases.

How to get test coverage

  1. Hardcode the chainId() at line 28 in EIP712Base.sol to the specific network Id e.g 42 for Kovan etc.
  2. Similarly change the same networkId as above in EIP712MetaTransaction.test.js at line 146.
  3. Run npm install command to install all the dependencies
  4. Run ganache-cli in separate cmd/terminal to run ganache client
  5. At last, Run npm run coverage to get test coverage report

Check out example front-end code here and example solidity code here

This repository is basic implementation of Native Meta Transactions. This reposiory will be updated as per the EIP-1776 to implement native meta transactions with support of batching, transaction expiry etc

More Repositories

1

scw-contracts

SCW contracts for Biconomy Smart Account
TypeScript
117
star
2

mexa-sdk

Repository contains mexa sdk code that can be plugged into your dapp and can leverage meta transaction feature.
TypeScript
105
star
3

mexa

Repository contains smart contracts for biconomy's Mexa platform to implement meta transactions and allow dapp users to perform blockchain operations without holding any ether or other crypto currency.
JavaScript
94
star
4

biconomy-client-sdk

Biconomy SDK is a plug & play toolkit for dApps to build transaction legos that enable a highly customised one-click experience for their users
TypeScript
77
star
5

biconomy-paymasters

Paymasters development project
TypeScript
29
star
6

sdk-examples

TypeScript
25
star
7

dapp-demo

JavaScript
25
star
8

nexus

Nexus by Biconomy: ERC-7579 Modular Smart Account for Enhanced Account Abstraction
Solidity
22
star
9

docs

Biconomy official documentation
MDX
15
star
10

relayer-node

A Multichain Relayer Node
TypeScript
14
star
11

hyphen-contract

all contracts related to hyphen
Solidity
11
star
12

biconomy-contracts

Smart contracts of Biconomy's multi-chain relayer protocol
Solidity
10
star
13

wallet-integrations

This Repository consist of various integration with Biconomy.
JavaScript
8
star
14

bundler

4337 Typescript Bundler
TypeScript
8
star
15

useAA

react hook library
TypeScript
7
star
16

userop-debugger-backend

TypeScript
7
star
17

documentation

Biconomy official documentation for account abstraction SDK
TypeScript
7
star
18

hyphen-ui

TypeScript
6
star
19

gasless-playground

TypeScript
6
star
20

awesome-biconomy

Compilation of compelling project ideas and useful resources for utilizing Biconomy
5
star
21

sdk-demo

A playground to test some use cases of the SDK.
TypeScript
5
star
22

moonShot

Gamified version of option trading on blockchain. Where user place a bet on a coin's price and bet if the price will go up or down, if after certain duration his prediction comes true he wins some tokens.
JavaScript
5
star
23

hyphen-sdk

Repository containing Hyphen SDK code that helps you integrate Hyphen cross-chain asset transfer protocol in your Dapp. Hyphen SDK provides you simple to use methods that connects directly with Hyphen liquidity pools on supported chains and hyphen nodes to fetch information related to cross chain transfer transactions.
TypeScript
5
star
24

quickstart

TypeScript
4
star
25

ccmp-contracts

Cross Chain Messaging Protocol Aggregator
TypeScript
4
star
26

InstaExitDemo

Demo showcasing instaExit where you can transfer funds instantly across different chains.
JavaScript
3
star
27

hyphen-data

JavaScript
3
star
28

quick-start

TypeScript
3
star
29

biconomy-sdk-starter-kit

TypeScript
2
star
30

gasless-minting-demo

JavaScript
2
star
31

brn-contracts

Smart Contracts for the Decentralised Relayer Network
Solidity
2
star
32

hyphen-arbitrage-bot

Python bot which delivers Arbitrage Opportunities via Twitter account @ArbitRajaBot for all tokens across all chains.
Python
2
star
33

entry-point-gas-estimations

4337 Gas Estimations SDK
TypeScript
2
star
34

3074-Experiments

Solidity
2
star
35

sdk

TypeScript
2
star
36

biconomy-careers

TypeScript
1
star
37

.github

1
star
38

hyphen-widget

A Widget for Hyphen
TypeScript
1
star
39

safety-module

UI for Biconomy Safety Module
JavaScript
1
star
40

mexa-sdk-react-native-example

Java
1
star
41

frames

TypeScript
1
star
42

compound-demo

JavaScript
1
star
43

biconomy_viem_example

TypeScript
1
star
44

frame-smart-account-template

create smart account template
TypeScript
1
star
45

mexa-examples

Project containing different example codes showing how mexa can be used in different ways to enable gas less transactions in your project.
JavaScript
1
star
46

insta-exit-sdk

SDK to interact with Biconomy instaExit backend. It will provide a seamless process to integrate Insta-exit in any dapp or project
TypeScript
1
star
47

ContextBuilder

TypeScript
1
star
48

fallback-gastank

Solidity
1
star
49

biconomy_privy_example

An example implementation of Biconomy and Privy.
TypeScript
1
star
50

telegram-mini-app

tel bot - @biconomy_mini_app_bot
TypeScript
1
star