Skip to content

masslbs/contracts

Repository files navigation

DMP SMART CONTRACTS

The smart contracts that implement the Decentralized Market Protocol.

OVERVIEW

This repo contains store registry, relay registry and the payments factory.

DEVELOP

nix is used for dependancy managment.

Run nix develop to enter the devShell.

Delpoy to local test nest

To create and delopy the contract to a local testnet first

  • start anvil and deploy the contract locally run run-and-deploy
  • to redeploy the contract run deploy-market

Generate Go abi

rm -rf abis/sol
solc --abi --base-path . --include-path lib/  \
  --input-file src/store-reg.sol \
  --input-file src/relay-reg.sol \
  --input-file src/payment-factory.sol \
  -o abis/sol
# overwrite for abis/sol/IERC1155Errors.abi
solc --abi --input-file lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol -o abis/sol --overwrite
abigen --abi abis/sol/StoreReg.abi --pkg main --type RegStore --out abis/go/registry-store.go
abigen --abi abis/sol/RelayReg.abi --pkg main --type RegRelay --out abis/go/registry-relay.go

TODO: need to find a way to include deployed addresses

Generate TS ABI

The TS interface for the ABI is generated by wagmi cli. The generated code will be stored in ./abis/js/src/

To update the code run the following.

cd  abis/js
pnpm install
pnpm wagmi generate

TESTING

forge test --no-auto-detect

DEPLOYMENTS

RelayReg

  • Sepolia 0x0311095a513A8Aa2Ff413a5728e807dA00D4f05D

StoreReg

  • Sepolia 0x98bBce2e30c80b5648E6579D9CcC3A5eF639a775

PaymentFactory

  • Sepolia 0xB09631fB4cb86FE2CD0106705E6cB373EE4fC078

LICENSE

GPL-3

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published