@@ -99,8 +99,6 @@ async function deployContractIfCodeChanged(
99
99
* (overriding env: RELEASE_VERSION)
100
100
* @param {string } options.outputFile Name of file where to log addresses of newly deployed contracts
101
101
* (overriding env: OUTPUT_FILE)
102
- * @param {Address } options.cfaHookContract Address of the contract to be set up as CFA hooks receiver
103
- * (overriding env: CFA_HOOK_CONTRACT)
104
102
*
105
103
* Usage: npx truffle exec ops-scripts/deploy-framework.js
106
104
*/
@@ -117,7 +115,6 @@ module.exports = eval(`(${S.toString()})({skipArgv: true})`)(async function (
117
115
appWhiteListing,
118
116
protocolReleaseVersion,
119
117
outputFile,
120
- cfaHookContract,
121
118
} = options ;
122
119
resetSuperfluidFramework = options . resetSuperfluidFramework ;
123
120
@@ -126,10 +123,9 @@ module.exports = eval(`(${S.toString()})({skipArgv: true})`)(async function (
126
123
console . log ( "reset superfluid framework: " , resetSuperfluidFramework ) ;
127
124
128
125
outputFile = outputFile || process . env . OUTPUT_FILE ;
129
- console . log ( "output file: " , outputFile ) ;
130
-
131
- cfaHookContract = cfaHookContract || process . env . CFA_HOOK_CONTRACT ;
132
- console . log ( "CFA hook contract" , cfaHookContract ) ;
126
+ if ( outputFile !== undefined ) {
127
+ console . log ( "output file: " , outputFile ) ;
128
+ }
133
129
134
130
// string to build a list of newly deployed contracts, written to a file if "outputFile" option set
135
131
let output = "" ;
@@ -363,15 +359,10 @@ module.exports = eval(`(${S.toString()})({skipArgv: true})`)(async function (
363
359
364
360
// list CFA v1
365
361
const deployCFAv1 = async ( ) => {
366
- // @note Once we have the actual implementation for the hook contract,
367
- // we will need to deploy it and put it here instead of ZERO_ADDRESS
368
- const hookContractAddress = cfaHookContract || ZERO_ADDRESS ;
369
- console . log ( "CFA Hook Contract Address:" , hookContractAddress ) ;
370
-
371
362
const agreement = await web3tx (
372
363
ConstantFlowAgreementV1 . new ,
373
364
"ConstantFlowAgreementV1.new"
374
- ) ( superfluid . address , hookContractAddress ) ;
365
+ ) ( superfluid . address , ZERO_ADDRESS ) ;
375
366
376
367
console . log ( "New ConstantFlowAgreementV1 address" , agreement . address ) ;
377
368
output += `CFA_LOGIC=${ agreement . address } \n` ;
@@ -532,6 +523,7 @@ module.exports = eval(`(${S.toString()})({skipArgv: true})`)(async function (
532
523
[
533
524
// See SuperToken constructor parameter
534
525
superfluid . address . toLowerCase ( ) . slice ( 2 ) . padStart ( 64 , "0" ) ,
526
+ ZERO_ADDRESS . toLowerCase ( ) . slice ( 2 ) . padStart ( 64 , "0" ) ,
535
527
]
536
528
) ;
537
529
if ( cfaNewLogicAddress !== ZERO_ADDRESS )
@@ -691,27 +683,30 @@ module.exports = eval(`(${S.toString()})({skipArgv: true})`)(async function (
691
683
UUPSProxy . new ,
692
684
`Create ConstantOutflowNFT proxy`
693
685
) ( ) ;
694
- output += `CONSTANT_OUTFLOW_NFT_ADDRESS=${ constantOutflowNFTProxy . address } \n` ;
686
+ console . log ( "ConstantOutflowNFT Proxy address" , constantOutflowNFTProxy . address ) ;
687
+ output += `CONSTANT_OUTFLOW_NFT_PROXY=${ constantOutflowNFTProxy . address } \n` ;
688
+
695
689
const constantInflowNFTProxy = await web3tx (
696
690
UUPSProxy . new ,
697
- `Create ConstantOutflowNFT proxy`
691
+ `Create ConstantInflowNFT proxy`
698
692
) ( ) ;
699
- output += `CONSTANT_INFLOW_NFT_ADDRESS=${ constantInflowNFTProxy . address } \n` ;
693
+ console . log ( "ConstantInflowNFT Proxy address" , constantInflowNFTProxy . address ) ;
694
+ output += `CONSTANT_INFLOW_NFT_PROXY=${ constantInflowNFTProxy . address } \n` ;
700
695
701
696
const constantOutflowNFTLogic = await web3tx (
702
697
ConstantOutflowNFT . new ,
703
698
`ConstantOutflowNFT.new`
704
699
) ( superfluid . address , constantInflowNFTProxy . address ) ;
705
- output += `CONSTANT_OUTFLOW_NFT_LOGIC_ADDRESS= ${ constantOutflowNFTLogic . address } \n` ;
706
-
700
+ console . log ( "ConstantOutflowNFT Logic address" , constantOutflowNFTLogic . address ) ;
701
+ output += `CONSTANT_OUTFLOW_NFT_LOGIC= ${ constantOutflowNFTLogic . address } \n` ;
707
702
await constantOutflowNFTLogic . castrate ( ) ;
708
703
709
704
const constantInflowNFTLogic = await web3tx (
710
- ConstantOutflowNFT . new ,
711
- `ConstantOutflowNFT .new`
705
+ ConstantInflowNFT . new ,
706
+ `ConstantInflowNFT .new`
712
707
) ( superfluid . address , constantOutflowNFTProxy . address ) ;
713
- output += `CONSTANT_INFLOW_NFT_LOGIC_ADDRESS= ${ constantInflowNFTLogic . address } \n` ;
714
-
708
+ console . log ( "ConstantInflowNFT Logic address" , constantInflowNFTLogic . address ) ;
709
+ output += `CONSTANT_INFLOW_NFT_LOGIC= ${ constantInflowNFTLogic . address } \n` ;
715
710
await constantInflowNFTLogic . castrate ( ) ;
716
711
717
712
// set the nft logic addresses (to be consumed by the super token factory logic constructor)
@@ -745,7 +740,7 @@ module.exports = eval(`(${S.toString()})({skipArgv: true})`)(async function (
745
740
// set the nft proxy addresses (to be consumed by the super token logic constructor)
746
741
cofNFTProxyAddress = constantOutflowNFTProxy . address ;
747
742
cifNFTProxyAddress = constantInflowNFTProxy . address ;
748
- } else {
743
+ } else { // nft proxies already exist
749
744
const newCOFNFTLogic = await deployContractIfCodeChanged (
750
745
web3 ,
751
746
ConstantOutflowNFT ,
@@ -757,7 +752,7 @@ module.exports = eval(`(${S.toString()})({skipArgv: true})`)(async function (
757
752
ConstantOutflowNFT . new ,
758
753
"ConstantOutflowNFT.new"
759
754
) ( superfluid . address , cifNFTProxyAddress ) ;
760
- output += `CONSTANT_OUTFLOW_NFT_LOGIC_ADDRESS =${ cofNFTLogic . address } \n` ;
755
+ output += `CONSTANT_OUTFLOW_NFT_LOGIC =${ cofNFTLogic . address } \n` ;
761
756
// castrate flow nft logic contract
762
757
await cofNFTLogic . castrate ( ) ;
763
758
return cofNFTLogic ;
@@ -779,7 +774,7 @@ module.exports = eval(`(${S.toString()})({skipArgv: true})`)(async function (
779
774
ConstantInflowNFT . new ,
780
775
"ConstantInflowNFT.new"
781
776
) ( superfluid . address , cofNFTProxyAddress ) ;
782
- output += `CONSTANT_INFLOW_NFT_LOGIC_ADDRESS =${ cifNFTLogic . address } \n` ;
777
+ output += `CONSTANT_INFLOW_NFT_LOGIC =${ cifNFTLogic . address } \n` ;
783
778
// castrate flow nft logic contract
784
779
await cifNFTLogic . castrate ( ) ;
785
780
return cifNFTLogic ;
0 commit comments