@@ -4,22 +4,12 @@ import { ApiError } from "./errors";
44import { NetworkConfig , encodeName } from "./networks" ;
55import {
66 HypercertExchangeAbi ,
7- deployments ,
8- asDeployedChain ,
97 HypercertMinterAbi ,
108} from "@hypercerts-org/contracts" ;
119
1210export const rollOut = async ( networks : NetworkConfig [ ] ) => {
1311 return await Promise . all (
1412 networks . map ( async ( network ) => {
15- console . log (
16- "Contract address" ,
17- network . chainId . toString ( ) ,
18- asDeployedChain ( network . chainId . toString ( ) ) ,
19- deployments [ asDeployedChain ( network . chainId . toString ( ) ) ] ,
20- deployments [ asDeployedChain ( network . chainId . toString ( ) ) ]
21- . HypercertExchange ,
22- ) ;
2313 // On allowlist created
2414 const autoTaskOnAllowlistCreated = await createTask (
2515 encodeName ( network , "minter" , "on-allowlist-created" ) ,
@@ -37,7 +27,7 @@ export const rollOut = async (networks: NetworkConfig[]) => {
3727 await createSentinel ( {
3828 name : encodeName ( network , "minter" , "AllowlistCreated" ) ,
3929 network : network ,
40- contractAddress : network . contractAddress ,
30+ contractAddress : network . hypercertMinterContractAddress ,
4131 abi : HypercertMinterAbi ,
4232 eventConditions : [
4333 { eventSignature : "AllowlistCreated(uint256,bytes32)" } ,
@@ -62,7 +52,7 @@ export const rollOut = async (networks: NetworkConfig[]) => {
6252 await createSentinel ( {
6353 name : encodeName ( network , "minter" , "batchMintClaimsFromAllowlists" ) ,
6454 network : network ,
65- contractAddress : network . contractAddress ,
55+ contractAddress : network . hypercertMinterContractAddress ,
6656 abi : HypercertMinterAbi ,
6757 autotaskID : autoTaskOnBatchMintClaimsFromAllowlists . autotaskId ,
6858 functionConditions : [
@@ -90,7 +80,7 @@ export const rollOut = async (networks: NetworkConfig[]) => {
9080 await createSentinel ( {
9181 name : encodeName ( network , "minter" , "mintClaimFromAllowlist" ) ,
9282 network : network ,
93- contractAddress : network . contractAddress ,
83+ contractAddress : network . hypercertMinterContractAddress ,
9484 abi : HypercertMinterAbi ,
9585 autotaskID : autoTaskOnMintClaimFromAllowlist . autotaskId ,
9686 functionConditions : [
@@ -101,35 +91,35 @@ export const rollOut = async (networks: NetworkConfig[]) => {
10191 ] ,
10292 } ) ;
10393
104- // On execute taker bid
105- const autoTaskExecuteTakerBid = await createTask (
106- encodeName ( network , "exchange" , "execute-taker-bid" ) ,
107- "execute-taker-bid" ,
108- ) ;
109- if ( ! autoTaskExecuteTakerBid ) {
110- throw new ApiError (
111- encodeName (
112- network ,
113- "exchange" ,
114- "Could not create autoTask for execute-taker-bid" ,
115- ) ,
94+ if ( network . hypercertExchangeContractAddress ) {
95+ // On execute taker bid
96+ const autoTaskExecuteTakerBid = await createTask (
97+ encodeName ( network , "exchange" , "execute-taker-bid" ) ,
98+ "execute-taker-bid" ,
11699 ) ;
100+ if ( ! autoTaskExecuteTakerBid ) {
101+ throw new ApiError (
102+ encodeName (
103+ network ,
104+ "exchange" ,
105+ "Could not create autoTask for execute-taker-bid" ,
106+ ) ,
107+ ) ;
108+ }
109+ await createSentinel ( {
110+ name : encodeName ( network , "exchange" , "executeTakerBid" ) ,
111+ network : network ,
112+ autotaskID : autoTaskExecuteTakerBid . autotaskId ,
113+ contractAddress : network . hypercertExchangeContractAddress ,
114+ abi : HypercertExchangeAbi ,
115+ functionConditions : [
116+ {
117+ functionSignature :
118+ "executeTakerBid((address,bytes),(uint8,uint256,uint256,uint256,uint256,uint8,address,address,address,uint256,uint256,uint256,uint256[],uint256[],bytes),bytes,(bytes32,(bytes32,uint8)[]))" ,
119+ } ,
120+ ] ,
121+ } ) ;
117122 }
118- await createSentinel ( {
119- name : encodeName ( network , "exchange" , "executeTakerBid" ) ,
120- network : network ,
121- autotaskID : autoTaskExecuteTakerBid . autotaskId ,
122- contractAddress :
123- deployments [ asDeployedChain ( network . chainId . toString ( ) ) ]
124- . HypercertExchange ,
125- abi : HypercertExchangeAbi ,
126- functionConditions : [
127- {
128- functionSignature :
129- "executeTakerBid((address,bytes),(uint8,uint256,uint256,uint256,uint256,uint8,address,address,address,uint256,uint256,uint256,uint256[],uint256[],bytes),bytes,(bytes32,(bytes32,uint8)[]))" ,
130- } ,
131- ] ,
132- } ) ;
133123 } ) ,
134124 ) ;
135125} ;
0 commit comments