Last active
June 22, 2022 19:44
-
-
Save donoso-eth/bacd13ccb9718d70f618eca6c82587f7 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
//params | |
let _txFee = ethers.utils.parse("0.1"); | |
let _feeToken = ETH; | |
let _taskCreator = partyApp.address // task creator is the contract | |
let _useTaskTreasuryFunds = true // yes or no depending on funding | |
let _revertOnFailure = true | |
// resolver hash is a bit more complicated: | |
let resolverHash = ethers.utils.keccak256(new ethers.utils.AbiCoder().encode( | |
['address', 'bytes'] | |
[resolverAddress, resolverData] | |
) | |
// being | |
let resolverAddress = partyApp.address // resolver is same contract | |
let resolverData = await partyApp.interface.encodeFunctionData('checkerStartParty'); /// encoded checker function | |
let _execAddress = partyApp.address // is same contract | |
let _execData = await partyApp.interface.encodeFunctionData ('startParty'); // excoded exutable function | |
//// now we can call the exec() function in Ops contract and the task will be executed if the conditions are met | |
ops.connect(executor).exec( | |
_txFee, | |
_feeToken, | |
_taskCreator, | |
_useTaskTreasuryFunds, | |
_revertOnFailure, | |
_resolverHash, | |
_execAddress, | |
_execData | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment