Skip to content

Commit

Permalink
Updated contract addresses across all chains (#11)
Browse files Browse the repository at this point in the history
* Updated contract addresses across all chains and implementation of installModule/uninstallModule functions
* Update contract addresses on XDC Testnet
* Update Networks details
  • Loading branch information
kaushalrajbacancy authored Jun 14, 2024
1 parent 12d60fd commit d2da7f6
Show file tree
Hide file tree
Showing 97 changed files with 194 additions and 4,832 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog
## [2.0.0] - 2024-06-04
## [1.0.1] - 2024-06-13
### New
- The addresses of the contracts have been updated on all chains.
### Changes
- The `installModule` and `uninstallModule` functions have been enhanced to allow direct module installation and uninstallation from within the functions, providing a return of the UserOp Hash.
- The `DataUtils` module has been removed from the code.
- The code supporting ZeroDev and SimpleAccount has been removed.

## [1.0.0] - 2024-06-04
### New
- Added support for EP7.0 and Etherspot's Modular accounts
- Added `installModule` function to install module
Expand Down
File renamed without changes.
19 changes: 0 additions & 19 deletions examples/05-get-account-balances.ts

This file was deleted.

File renamed without changes.
17 changes: 0 additions & 17 deletions examples/06-transaction.ts

This file was deleted.

File renamed without changes.
21 changes: 0 additions & 21 deletions examples/07-transactions.ts

This file was deleted.

18 changes: 0 additions & 18 deletions examples/08-nft-list.ts

This file was deleted.

File renamed without changes.
33 changes: 0 additions & 33 deletions examples/09-exchange.ts

This file was deleted.

38 changes: 0 additions & 38 deletions examples/10-advance-routes-lifi.ts

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 26 additions & 0 deletions examples/14-install-module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { EtherspotBundler, ModularSdk } from '../src';
import * as dotenv from 'dotenv';
import { MODULE_TYPE } from '../src/sdk/common';

dotenv.config();

async function main() {
const bundlerApiKey = 'eyJvcmciOiI2NTIzZjY5MzUwOTBmNzAwMDFiYjJkZWIiLCJpZCI6IjMxMDZiOGY2NTRhZTRhZTM4MGVjYjJiN2Q2NDMzMjM4IiwiaCI6Im11cm11cjEyOCJ9';

// initializating sdk...
const modularSdk = new ModularSdk({ privateKey: process.env.WALLET_PRIVATE_KEY }, { chainId: Number(process.env.CHAIN_ID), bundlerProvider: new EtherspotBundler(Number(process.env.CHAIN_ID), bundlerApiKey) })

console.log('address: ', modularSdk.state.EOAAddress);

// get address of EtherspotWallet
const address: string = await modularSdk.getCounterFactualAddress();

console.log('\x1b[33m%s\x1b[0m', `EtherspotWallet address: ${address}`);

const uoHash = await modularSdk.installModule(MODULE_TYPE.VALIDATOR, '0x1417aDC5308a32265E0fA0690ea1408FFA62F37c');
console.log(`UserOpHash: ${uoHash}`);
}

main()
.catch(console.error)
.finally(() => process.exit());
22 changes: 0 additions & 22 deletions examples/14-zeroDev-address.ts

This file was deleted.

22 changes: 0 additions & 22 deletions examples/15-simpleAccount-address.ts

This file was deleted.

32 changes: 32 additions & 0 deletions examples/15-uninstall-module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { ethers } from 'ethers';
import { EtherspotBundler, ModularSdk } from '../src';
import * as dotenv from 'dotenv';
import { MODULE_TYPE } from '../src/sdk/common';

dotenv.config();

async function main() {
const bundlerApiKey = 'eyJvcmciOiI2NTIzZjY5MzUwOTBmNzAwMDFiYjJkZWIiLCJpZCI6IjMxMDZiOGY2NTRhZTRhZTM4MGVjYjJiN2Q2NDMzMjM4IiwiaCI6Im11cm11cjEyOCJ9';

// initializating sdk...
const modularSdk = new ModularSdk({ privateKey: process.env.WALLET_PRIVATE_KEY }, { chainId: Number(process.env.CHAIN_ID), bundlerProvider: new EtherspotBundler(Number(process.env.CHAIN_ID), bundlerApiKey) })

console.log('address: ', modularSdk.state.EOAAddress);

// get address of EtherspotWallet
const address: string = await modularSdk.getCounterFactualAddress();

console.log('\x1b[33m%s\x1b[0m', `EtherspotWallet address: ${address}`);

const deInitData = ethers.utils.defaultAbiCoder.encode(
["address", "bytes"],
['0x0000000000000000000000000000000000000001', '0x00']
);

const uoHash = await modularSdk.uninstallModule(MODULE_TYPE.VALIDATOR, '0x1417aDC5308a32265E0fA0690ea1408FFA62F37c', deInitData);
console.log(`UserOpHash: ${uoHash}`);
}

main()
.catch(console.error)
.finally(() => process.exit());
30 changes: 0 additions & 30 deletions examples/17-token-list.ts

This file was deleted.

29 changes: 0 additions & 29 deletions examples/18-exchange-rates.ts

This file was deleted.

46 changes: 0 additions & 46 deletions examples/25-get-quotes.ts

This file was deleted.

Loading

0 comments on commit d2da7f6

Please sign in to comment.