Closed Ivshti closed 3 years ago
Work in progress decisions & research
execute
methods depending on whether we call directly or not, we can just add Signature type Caller; 0x had an interesting exploit with that https://github.com/ConsenSys/0x_audit_report_2018-07-23#32-mixinsignaturevalidator-insecure-signature-validator-signaturetypecaller, but it's not applicable in our case, as we require signees to have privileges RESOLVED: will do itisValidSignature
{r}{s}{v}
as that's the openzeppelin and more common in the industrydeployAndExecute
won't be needed, as we can simply batch a safeDeploy
+ execute
/magicAcc.send
togetherprivileges[]
to avoid using an extra storage slot when setting up a MagicAccount; RESOLVED: yes, it saves us 20k gas during deployment; allows us to store data for other account managers in the future, such as MultiSigAccManager; to minimize the chance of bricking, we recommend that this is modified only directly via the acc manager calling executeBySender()
with setAddrPrivilege
, so that it doesn't set a gibberish value or simply true
How to generate min proxy code
sstore code: {pushVal}{val}7f{slotHash}55,
0x{sstoreCode}3d602d8060{codeOffset}3d3981f3363d3d373d3d3d363d73{masterContract}5af43d82803e903d91602b57fd5bf3
example
> require('./js/IdentityProxyDeploy').getMappingSstore(0, 'address', '0xe5a4Dad2Ea987215460379Ab285DF87136E83BEA','0x01')
'sstore(0x02c94ba85f2ea274a3869293a0a9bf447d073c83c617963b0be7c862ec2ee44e, 0x01)'
starting with deploy code 0x3d602d80600a3d3981f3363d3d373d3d3d363d73bebebebebebebebebebebebebebebebebebebebe5af43d82803e903d91602b57fd5bf3 (taken from https://github.com/optionality/clone-factory/blob/master/contracts/CloneFactory.sol#L32 )
then 6001 to push the val (push1 0x01), followed by 7f{slotHash}55
replace bebebebebebebebe
finally, 60e2 instead of 600a to adjust the start of the code
0x60017f02c94ba85f2ea274a3869293a0a9bf447d073c83c617963b0be7c862ec2ee44e553d602d80602e3d3981f3363d3d373d3d3d363d7302a63ec1bced5545296a5193e652e25ec0bae4105af43d82803e903d91602b57fd5bf3
Decided against specific anti-bricking mechanisms in QuickAccManager
The reason for this is that code becomes complicated with two separate schedule/execscheduled routines
We can employ off-chain anti bricking by tracking scheduled txns; if one doesn't make sense (eg no adex control after it), cancel it; we have to simulate executeBySender() call with all the txns
We need a round of improvements to the Identity/IdentityFactory system
End goals
End goal: deploy & make it work with opensea through WalletConnect; on Polygon too
To be implemented
free
on the gasToken from relayer's Identity andtipMiner