Created
March 30, 2018 11:25
-
-
Save ukstv/97b70749546e832093c9370e3aa6794a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 3: Prepare counterfactual deployment of Bidirectional, and update Lineup | |
let bidirectionalB = bytecodeManager.constructBytecode(Bidirectional, multisig.address, bidirectionalSettlementPeriod) | |
let bidirectionalA = await registry.counterfactualAddress(bidirectionalB, REGISTRY_NONCE) | |
let bidirectionalDeployment = registry.deploy.request(bidirectionalB, REGISTRY_NONCE).params[0].data | |
let bidirectionalCodehash = await conditional.callHash(registry.address, new BigNumber.BigNumber(0), bidirectionalDeployment) | |
// 4. Prepare counterfactual transfer, and update Lineup | |
let transferB = proxy.doCall.request(registry.address, bidirectionalA, depositA, '0x').params[0].data | |
let transferCodehash = await conditional.callHash(proxy.address, depositA, transferB) | |
// 5: Conditionally counterfactually deploy Bidirectional | |
let conditionalBidirectionalB = conditional.doCall.request(registry.address, lineupA, proof(lineupU, bidirectionalCodehash), registry.address, new BigNumber.BigNumber(0), bidirectionalDeployment) | |
let conditionalBidirectionalI = await counterFactory.call(conditionalBidirectionalB, 1) | |
// 5. Conditionally counterfactually move money to deployed Bidirectional | |
let conditionalTransferB = conditional.doDelegate.request(registry.address, lineupA, proof(lineupU, transferCodehash), proxy.address, depositA, transferB) | |
let conditionalTransferI = await counterFactory.delegatecall(conditionalTransferB, 2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment