Skip to content

dittonetwork/blast-contracts

Repository files navigation

Ditto Network Smart Contracts

Stability

Ditto

Table of Contents

Getting started

Refer to the deployed instance at testnet. Our npm sdk is the best fit for interaction with ditto factory. And please, enjoy!

First, download repository:

git clone https://github.com/dittonetwork/blast-contracts
cd blast-contracts

Install dependencies:

forge install

Copy the .env.example to .env and fill it in:

cp .env.example .env
ETH_RPC_URL=
POL_RPC_URL=
ARB_RPC_URL=
OPT_RPC_URL=

POLYGON_API_KEY=
ARB_API_KEY=
BNB_API_KEY=
AVAX_API_KEY=
CELO_API_KEY=

PRIVATE_KEY=0x

Run tests

forge test

Deployment

Env variables must be added to the terminal before deployment

source .env

Contract addresses stored in the Registry

For each network there is a file with a script to deploy to dev or prod (dev deploy is partially involved in creating the test environment)

to run the deploy script on dev

forge script script/FullDeploy.s.sol -vvvv --rpc-url $<network>_RPC_URL --sig "run(bool,bool)" true false --broadcast [--with-gas-price <gas price>]

Where:

  1. network - the network to which the script will be run
  2. true - add new implementation to the factory
  3. false - deploy contracts for dev
  4. gas price - optional parameter for gas price (e.g., gas price on arb is 0.1 gwei, but foundry takes 3.2 gwei)

Note:

  1. All contracts that do not equal a address(0) in the Registry file will not be re-deployed while script execution.
  2. Contracts deployed on the Ditto protocol must be cleared in order to deploy your own env and the factory address must be modified in the deployFactory method to your own:
  • vaultFactoryProxyAdmin
  • vaultFactoryProxy
  • vaultProxyAdmin
  • dittoBridgeReceiver
  • protocolFees
  • entryPointLogic
  • executionLogic
  • stargateLogic
  • layerZeroLogic

Adding new modules

After writing a new module, you need to add it to the logics structure in the Registry file and add it to the network script where it is needed:

  1. its methods to the private function _getData
  2. its deployment to the public function `deploySystemContracts`` similar to the contracts already existing there

Project structure

  1. script - the logic of deployment, test environment creation and the registry of contracts
  2. src - code of contracts
  3. test - tests for contracts

License

You can copy and paste the MIT license summary from below.

MIT License

Copyright (c) 2023 Ditto Network

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

About

aa compatible smart wallet factory with automation modules for vaults. Read more: https://ditto-network-1.gitbook.io/ditto-network-documentation/overview/account-vault-factory.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •