Skip to content

Instantly share code, notes, and snippets.

@donoso-eth
Last active June 22, 2022 19:44
Show Gist options
  • Save donoso-eth/bacd13ccb9718d70f618eca6c82587f7 to your computer and use it in GitHub Desktop.
Save donoso-eth/bacd13ccb9718d70f618eca6c82587f7 to your computer and use it in GitHub Desktop.
//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