Skip to content

Commit

Permalink
Merge pull request #155 from moleculeprotocol/feat/deploy-sepolia
Browse files Browse the repository at this point in the history
Sepolia Deployment
  • Loading branch information
elmariachi111 authored Feb 19, 2024
2 parents 9362140 + 09a7a01 commit d68af8d
Show file tree
Hide file tree
Showing 25 changed files with 3,923 additions and 3,747 deletions.
33 changes: 18 additions & 15 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,37 @@ MAINNET_RPC_URL=
INUFRA_KEY=
ETHERSCAN_API_KEY=
ETHERSCAN_API_KEY_OPTIMISM=
MODERATOR_ADDRESS=
RELAYER_ADDRESS=
#this is the private key of the first account of a default hardhat/anvil setup
PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80

#optional:
ALCHEMY_KEY=
THEGRAPH_API_TOKEN=
SATSUMA_DEPLOY_KEY=

#these are deterministic when deployed in that order on a fresh node with hardhat (anvil) seed
IPNFT_ADDRESS=0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512
SOS_ADDRESS=0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9
AUTHORIZER_ADDRESS=0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9
SOS_ADDRESS=0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0
AUTHORIZER_ADDRESS=0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9

USDC_ADDRESS=0x0165878A594ca255338adfa4d48449f69242Eb8F
DAO_TOKEN_ADDRESS=0xa513E6E4b8f2a923D98304ec87F64353C4D5C853
VDAO_TOKEN_ADDRESS=0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6
USDC_ADDRESS=0x5FC8d32690cc91D4c39d9d3abcBD16989F875707
DAO_TOKEN_ADDRESS=0x0165878A594ca255338adfa4d48449f69242Eb8F
VDAO_TOKEN_ADDRESS=0xa513E6E4b8f2a923D98304ec87F64353C4D5C853

PRICEFEED_ADDRESS=0x8A791620dd6260079BF849Dc5567aDC3F2FdC318
TERMS_ACCEPTED_PERMISSIONER_ADDRESS=0x610178dA211FEF7D417bC0e6FeD39F05609AD788
PRICEFEED_ADDRESS=0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6
TERMS_ACCEPTED_PERMISSIONER_ADDRESS=0x8A791620dd6260079BF849Dc5567aDC3F2FdC318

TOKENIZER_ADDRESS=0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0
STAKED_LOCKING_CROWDSALE_ADDRESS=0x9A676e781A523b5d0C0e43731313A708CB607508
TOKENIZER_ADDRESS=0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e
STAKED_LOCKING_CROWDSALE_ADDRESS=0x0B306BF915C4d645ff596e518fAf3F9669b97016

USDC6_ADDRESS=0x9A9f2CCfdE556A7E9Ff0848998Aa4a0CFD8863AE
WETH_ADDRESS=0x59b670e9fA9D0A427751Af201D676719a970857b
USDC6_ADDRESS=0x68B1D87F95878fE05B998F19b66F4baba5De1aed
WETH_ADDRESS=0x4ed7c70F96B99c776995fB64377f0d4aB3B0e1C1
PLAIN_CROWDSALE_ADDRESS=0x7a2088a1bFc9d81c55368AE168C2C02570cB814F

PLAIN_CROWDSALE_ADDRESS=0x4A679253410272dd5232B3Ff7cF5dbB88f295319
#this is created during the tokenizer deployment
IPTOKEN_IMPLEMENTATION_ADDRESS=0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82

#these are generated when running the fixture scripts
IPTS_ADDRESS=0x1F708C24a0D3A740cD47cC0444E9480899f3dA7D
LOCKED_IPTS_ADDRESS=0x06cd7788D77332cF1156f1E327eBC090B5FF16a3
IPTS_ADDRESS=0x8dAF17A20c9DBA35f005b6324F493785D239719d
LOCKED_IPTS_ADDRESS=0x16eBC21B3d38Db5e3EE1a022bEBA8Ec87D4CDbe6
73 changes: 64 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,78 @@ IP-NFTs allow their users to tokenize intellectual property. This repo contains
| Crowdsale | [0xf0a8d23f38e9cbbe01c4ed37f23bd519b65bc6c2](https://etherscan.io/address/0xf0a8d23f38e9cbbe01c4ed37f23bd519b65bc6c2#code) | <a href="https://thirdweb.com/ethereum/0xf0a8d23f38e9cbbe01c4ed37f23bd519b65bc6c2?utm_source=contract_badge" target="_blank"><img width="200" height="45" src="https://badges.thirdweb.com/contract?address=0xf0a8d23f38e9cbbe01c4ed37f23bd519b65bc6c2&theme=dark&chainId=1" alt="View contract" /></a> |
| StakedLockingCrowdSale | [0x35Bce29F52f51f547998717CD598068Afa2B29B7](https://etherscan.io/address/0x35Bce29F52f51f547998717CD598068Afa2B29B7#code) | <a href="https://thirdweb.com/ethereum/0x35Bce29F52f51f547998717CD598068Afa2B29B7?utm_source=contract_badge" target="_blank"><img width="200" height="45" src="https://badges.thirdweb.com/contract?address=0x35Bce29F52f51f547998717CD598068Afa2B29B7&theme=dark&chainId=1" alt="View contract" /></a> |

- Subgraph: <https://api.thegraph.com/subgraphs/name/moleculeprotocol/ip-nft-mainnet>
#### Subgraph

API: https://api.thegraph.com/subgraphs/name/moleculeprotocol/ip-nft-mainnet
Playground: https://api.thegraph.com/subgraphs/name/moleculeprotocol/ip-nft-mainnet/graphql

tokenizer implementation 1.2: 0xE8701330F196FeFe415b28dAA767AB076F42557A
tokenizer implementation 1.1: 0x9C70FA8c87D7e94Fd63eeCCcA657D5c4224a36f3
iptoken implementation: 0x9E4fc6E6d1A64e3429aB852d3CB31AD7aa06997A
ipnft implementation 2.4: 0x6B179Dffac5E190c670176606f552cB792847f80

Defender Relayer that signs off minting requests from our side:
0x3D30452c48F2448764d5819a9A2b684Ae2CC5AcF
#### Defender Relayer

signs off minting requests from our side: 0x3D30452c48F2448764d5819a9A2b684Ae2CC5AcF

---

### Goerli
### Sepolia

| Contract | Address | Explorer |
| ------------------ | ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| IPNFT | 0x152B444e60C526fe4434C721561a077269FcF61a | <a href="https://sepolia.etherscan.io/address/0x152B444e60C526fe4434C721561a077269FcF61a#code" target="_blank"><img width="200" height="45" src="https://badges.thirdweb.com/contract?address=0x152B444e60C526fe4434C721561a077269FcF61a&theme=dark&chainId=1" alt="View contract" /></a> |
| Swap | 0x9e4c638e703d0Af3a3B9eb488dE79A16d402698f | <a href="https://sepolia.etherscan.io/address/0x9e4c638e703d0Af3a3B9eb488dE79A16d402698f#code" target="_blank"><img width="200" height="45" src="https://badges.thirdweb.com/contract?address=0x9e4c638e703d0Af3a3B9eb488dE79A16d402698f&theme=dark&chainId=1" alt="View contract" /></a> |
| Authorizer | 0x7a9F3773352e4ee0Da6307Cd32C45fE89602129A | <a href="https://sepolia.etherscan.io/address/0x7a9F3773352e4ee0Da6307Cd32C45fE89602129A#code" target="_blank"><img width="200" height="45" src="https://badges.thirdweb.com/contract?address=0x7a9F3773352e4ee0Da6307Cd32C45fE89602129A&theme=dark&chainId=1" alt="View contract" /></a> |
| Terms Permissioner | 0xC05D649368d8A5e2E98CAa205d47795de5fCB599 | <a href="https://sepolia.etherscan.io/address/0xC05D649368d8A5e2E98CAa205d47795de5fCB599#code" target="_blank"><img width="200" height="45" src="https://badges.thirdweb.com/contract?address=0xC05D649368d8A5e2E98CAa205d47795de5fCB599&theme=dark&chainId=1" alt="View contract" /></a> |
| Tokenizer | 0xca63411FF5187431028d003eD74B57531408d2F9 | <a href="https://sepolia.etherscan.io/address/0xca63411FF5187431028d003eD74B57531408d2F9#code" target="_blank"><img width="200" height="45" src="https://badges.thirdweb.com/contract?address=0xca63411FF5187431028d003eD74B57531408d2F9&theme=dark&chainId=1" alt="View contract" /></a> |
| Crowdsale | 0x8cA737E2cdaE1Ceb332bEf7ba9eA711a3a2f8037 | <a href="https://sepolia.etherscan.io/address/0x8cA737E2cdaE1Ceb332bEf7ba9eA711a3a2f8037#code" target="_blank"><img width="200" height="45" src="https://badges.thirdweb.com/contract?address=0x8cA737E2cdaE1Ceb332bEf7ba9eA711a3a2f8037&theme=dark&chainId=1" alt="View contract" /></a> |
| Staked Crowdsale | 0xd1cE2EA7d3b0C9cAB025A4aD762FC00315141ad7 | <a href="https://sepolia.etherscan.io/address/0xd1cE2EA7d3b0C9cAB025A4aD762FC00315141ad7#code" target="_blank"><img width="200" height="45" src="https://badges.thirdweb.com/contract?address=0xd1cE2EA7d3b0C9cAB025A4aD762FC00315141ad7&theme=dark&chainId=1" alt="View contract" /></a> |

#### Subgraphs

on Satsuma, Tech Account

API: https://subgraph.satsuma-prod.com/techs-team--4017766/moleculexyz-ipnft-sepolia/version/v0.0.1/api
Playground: https://subgraph.satsuma-prod.com/techs-team--4017766/moleculexyz-ipnft-sepolia/playground

#### Defender Relayer

signs off minting requests from our side: 0xd7B298c9fB0377124d01D4E826d9D5beFB7CD6FE

#### Tokens

| Contract | Address | |
| -------------- | ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| USDC | 0x309EFD49752803D0B3Ddba2B66A7A900F99B4E70 | <a href="https://sepolia.etherscan.io/address/0x309EFD49752803D0B3Ddba2B66A7A900F99B4E70#code" target="_blank"><img width="200" height="45" src="https://badges.thirdweb.com/contract?address=0x309EFD49752803D0B3Ddba2B66A7A900F99B4E70&theme=dark&chainId=1" alt="View contract" /></a> |
| Bio Dao | 0x62f3cBab2C84fbA31DEc50CD21dbb5577333C69a | <a href="https://sepolia.etherscan.io/address/0x62f3cBab2C84fbA31DEc50CD21dbb5577333C69a#code" target="_blank"><img width="200" height="45" src="https://badges.thirdweb.com/contract?address=0x62f3cBab2C84fbA31DEc50CD21dbb5577333C69a&theme=dark&chainId=1" alt="View contract" /></a> |
| vested Bio Dao | 0x19A3036b828bffB5E14da2659E950E76f8e6BAA2 | <a href="https://sepolia.etherscan.io/address/0x19A3036b828bffB5E14da2659E950E76f8e6BAA2#code" target="_blank"><img width="200" height="45" src="https://badges.thirdweb.com/contract?address=0x19A3036b828bffB5E14da2659E950E76f8e6BAA2&theme=dark&chainId=1" alt="View contract" /></a> |

old
Plain Crowdsale 0xc272b3e980ee3c1e52a9814b1a1d6c48295e8d91 https://sepolia.etherscan.io/address/0xc272b3e980ee3c1e52a9814b1a1d6c48295e8d91

```
IPNFT_ADDRESS=0x152B444e60C526fe4434C721561a077269FcF61a
ipnft impl 0x67881bbE2d58f5eeb2f2cad3a1FB7Bb6CB834A5A
SOS_ADDRESS=0x9e4c638e703d0Af3a3B9eb488dE79A16d402698f
AUTHORIZER_ADDRESS=0x7a9F3773352e4ee0Da6307Cd32C45fE89602129A
TERMS_ACCEPTED_PERMISSIONER_ADDRESS=0xC05D649368d8A5e2E98CAa205d47795de5fCB599
TOKENIZER_ADDRESS=0xca63411FF5187431028d003eD74B57531408d2F9
CROWDSALE_ADDRESS=0x8cA737E2cdaE1Ceb332bEf7ba9eA711a3a2f8037
STAKED_LOCKING_CROWDSALE_ADDRESS=0xd1cE2EA7d3b0C9cAB025A4aD762FC00315141ad7
initial IP Token implementation=0xB16e92029De283800df9030De2F255DcB99F19e9
tokenizer imple 0x672d3389b5c5a050ad93100d548817d87edc8597
USDC_ADDRESS=0x309EFD49752803D0B3Ddba2B66A7A900F99B4E70
DAO_TOKEN_ADDRESS=0x62f3cBab2C84fbA31DEc50CD21dbb5577333C69a
VDAO_TOKEN_ADDRESS=0x19A3036b828bffB5E14da2659E950E76f8e6BAA2
```

---

### ~~Deprecated Goerli~~

| Contract | Address | Actions |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
Expand All @@ -54,11 +113,7 @@ Defender Relayer that signs off minting requests from our side:
- Blind Permissioner: 0xec68a1fc8d4c2834f8dfbdb56691f9f0a3d6be11
<https://goerli.etherscan.io/address/0xec68a1fc8d4c2834f8dfbdb56691f9f0a3d6be11#code>

### Sepolia

Plain Crowdsale 0xc272b3e980ee3c1e52a9814b1a1d6c48295e8d91 https://sepolia.etherscan.io/address/0xc272b3e980ee3c1e52a9814b1a1d6c48295e8d91

#### some test tokens
#### ~~Tokens~~

| Token name | Symbol | address |
| ------------------------ | ------- | --------------------------------------------------------------------------------------------------------------------------------- |
Expand Down
10 changes: 4 additions & 6 deletions script/DeploySuite.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@ import { SignedMintAuthorizer } from "../src/SignedMintAuthorizer.sol";
*/
contract DeploySuite is Script {
function run() public {
address moderator = vm.envAddress("MODERATOR_ADDRESS");
address relayer = vm.envAddress("RELAYER_ADDRESS");
vm.startBroadcast();
IPNFT implementation = new IPNFT();
ERC1967Proxy proxy = new ERC1967Proxy(address(implementation), "");
IPNFT ipnft = IPNFT(address(proxy));
ipnft.initialize();

IPNFT ipnft = IPNFT(address(new ERC1967Proxy(address(new IPNFT()), abi.encodeWithSelector(IPNFT.initialize.selector, ""))));

SchmackoSwap swap = new SchmackoSwap();
SignedMintAuthorizer authorizer = new SignedMintAuthorizer(moderator);
SignedMintAuthorizer authorizer = new SignedMintAuthorizer(relayer);
ipnft.setAuthorizer(authorizer);

console.log("IPNFT_ADDRESS=%s", address(ipnft));
Expand Down
19 changes: 10 additions & 9 deletions script/DeployTokenizer.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,36 @@ import "forge-std/Script.sol";
import "forge-std/console.sol";
import { IPNFT } from "../src/IPNFT.sol";
import { Tokenizer } from "../src/Tokenizer.sol";
import { IPToken } from "../src/IPToken.sol";
import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
import { BioPriceFeed } from "../src/BioPriceFeed.sol";
import { IPermissioner, TermsAcceptedPermissioner } from "../src/Permissioner.sol";
import { CrowdSale } from "../src/crowdsale/CrowdSale.sol";
import { StakedLockingCrowdSale } from "../src/crowdsale/StakedLockingCrowdSale.sol";

contract DeployTokenizerInfrastructure is Script {
function run() public {
vm.startBroadcast();
address ipnftAddress = vm.envAddress("IPNFT_ADDRESS");
BioPriceFeed feed = new BioPriceFeed();
IPermissioner p = new TermsAcceptedPermissioner();
IPermissioner permissioner = new TermsAcceptedPermissioner();

Tokenizer tokenizer = Tokenizer(
address(
new ERC1967Proxy(
address(new Tokenizer()), ""
)
address(new ERC1967Proxy(address(new Tokenizer()), abi.encodeWithSelector(Tokenizer.initialize.selector, ipnftAddress, permissioner)))
)
);
tokenizer.initialize(IPNFT(ipnftAddress), p);
IPToken initialIpTokenImplementation = new IPToken();
tokenizer.setIPTokenImplementation(initialIpTokenImplementation);

CrowdSale crowdSale = new CrowdSale();
StakedLockingCrowdSale stakedLockingCrowdSale = new StakedLockingCrowdSale();

vm.stopBroadcast();

console.log("PRICEFEED_ADDRESS=%s", address(feed));
console.log("TERMS_ACCEPTED_PERMISSIONER_ADDRESS=%s", address(p));
console.log("TERMS_ACCEPTED_PERMISSIONER_ADDRESS=%s", address(permissioner));
console.log("TOKENIZER_ADDRESS=%s", address(tokenizer));
console.log("CROWDSALE_ADDRESS=%s", address(crowdSale));
console.log("STAKED_LOCKING_CROWDSALE_ADDRESS=%s", address(stakedLockingCrowdSale));
console.log("initial IP Token implementation=%s", address(initialIpTokenImplementation));
}
}

Expand Down
8 changes: 6 additions & 2 deletions script/IPNFT.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ import "../src/IPNFT.sol";
contract Deploy is Script {
function run() public {
vm.startBroadcast();
IPNFT ipnft = IPNFT(address(new ERC1967Proxy(address(new IPNFT()), "")));
ipnft.initialize();
IPNFT ipnft = IPNFT(
address(
new ERC1967Proxy(address(new IPNFT()),
abi.encodeWithSelector(IPNFT.initialize.selector, ""))
)
);
vm.stopBroadcast();

console.log("IPNFT_ADDRESS=%s", address(ipnft));
Expand Down
8 changes: 6 additions & 2 deletions script/dev/Ipnft.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ contract DeployIpnftSuite is CommonScript {
function run() public {
prepareAddresses();
vm.startBroadcast(deployer);
IPNFT ipnft = IPNFT(address(new ERC1967Proxy(address(new IPNFT()), "")));
ipnft.initialize();
IPNFT ipnft = IPNFT(
address(
new ERC1967Proxy(address(new IPNFT()),
abi.encodeWithSelector(IPNFT.initialize.selector, ""))
)
);

SchmackoSwap swap = new SchmackoSwap();

Expand Down
13 changes: 6 additions & 7 deletions script/dev/Tokenizer.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,16 @@ contract DeployTokenizer is CommonScript {
function run() public {
prepareAddresses();
vm.startBroadcast(deployer);
Tokenizer tokenizer = Tokenizer(
address(
new ERC1967Proxy(
address(new Tokenizer()), ""
)
)
);
Tokenizer tokenizer = Tokenizer(address(new ERC1967Proxy(address(new Tokenizer()), "")));
IPermissioner permissioner = IPermissioner(vm.envAddress("TERMS_ACCEPTED_PERMISSIONER_ADDRESS"));
tokenizer.initialize(IPNFT(vm.envAddress("IPNFT_ADDRESS")), permissioner);

IPToken initialIpTokenImplementation = new IPToken();
tokenizer.setIPTokenImplementation(initialIpTokenImplementation);

vm.stopBroadcast();
console.log("TOKENIZER_ADDRESS=%s", address(tokenizer));
console.log("IPTOKEN_IMPLEMENTATION_ADDRESS=%s", address(initialIpTokenImplementation));
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/SignedMintAuthorizer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ import { IAuthorizeMints, SignedMintAuthorization } from "./IAuthorizeMints.sol"
contract SignedMintAuthorizer is IAuthorizeMints, Ownable {
mapping(address => bool) trustedSigners;

event SignerTrustChanged(address indexed signer, bool trusted);

constructor(address initialSigner) Ownable() {
trustedSigners[initialSigner] = true;
emit SignerTrustChanged(initialSigner, true);
}

function trustSigner(address signer, bool trust) external onlyOwner {
trustedSigners[signer] = trust;
emit SignerTrustChanged(signer, trust);
}

/// @inheritdoc IAuthorizeMints
Expand Down
10 changes: 10 additions & 0 deletions subgraph/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# IPNFT subgraph

## Sepolia

API: https://subgraph.satsuma-prod.com/techs-team--4017766/moleculexyz-ipnft-sepolia/version/v0.0.1/api
Playground: https://subgraph.satsuma-prod.com/techs-team--4017766/moleculexyz-ipnft-sepolia/playground

## Mainnet

API: https://api.thegraph.com/subgraphs/name/moleculeprotocol/ip-nft-mainnet
Playground: https://api.thegraph.com/subgraphs/name/moleculeprotocol/ip-nft-mainnet/graphql

## Prerequisites

- you can deploy contracts locally (see [the main README](../README.md))
Expand Down
Loading

0 comments on commit d68af8d

Please sign in to comment.