Created
February 1, 2021 13:00
-
-
Save cswenor/ab88c3e148e655a45eb7afc9f0fd5859 to your computer and use it in GitHub Desktop.
Build File of the Reach secured loan.
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
// Automatically generated with Reach 0.1.2 | |
/* eslint-disable no-unused-vars, no-empty-pattern, no-useless-escape, no-loop-func */ | |
export const _version = '0.1.2'; | |
export async function Borrower(ctc, interact) { | |
const stdlib = ctc.stdlib; | |
const v0 = await ctc.creationTime(); | |
const v3 = stdlib.protect(stdlib.T_Object({ | |
collateral: stdlib.T_UInt, | |
maturation: stdlib.T_UInt, | |
maxLenderDelay: stdlib.T_UInt, | |
post: stdlib.T_UInt, | |
pre: stdlib.T_UInt | |
}), await interact.getParams(), { | |
at: './index.rsh:38:51:application', | |
fs: ['at ./index.rsh:39:43:after expr stmt semicolon call to [unknown function] (defined at: ./index.rsh:37:22:function exp)'], | |
msg: 'getParams', | |
who: 'Borrower' | |
}); | |
const v4 = v3.pre; | |
const v5 = v3.post; | |
const v6 = stdlib.lt(v4, v5); | |
stdlib.assert(v6, { | |
at: './index.rsh:39:13:application', | |
fs: ['at ./index.rsh:39:43:after expr stmt semicolon call to [unknown function] (defined at: ./index.rsh:37:22:function exp)'], | |
msg: null, | |
who: 'Borrower' | |
}); | |
const v7 = v3.collateral; | |
const txn1 = await (ctc.sendrecv('Borrower', 1, 1, stdlib.checkedBigNumberify('./index.rsh:40:14:dot', stdlib.UInt_max, 0), [stdlib.T_UInt, stdlib.T_Object({ | |
collateral: stdlib.T_UInt, | |
maturation: stdlib.T_UInt, | |
maxLenderDelay: stdlib.T_UInt, | |
post: stdlib.T_UInt, | |
pre: stdlib.T_UInt | |
})], [v0, v3], v7, [stdlib.T_Object({ | |
collateral: stdlib.T_UInt, | |
maturation: stdlib.T_UInt, | |
maxLenderDelay: stdlib.T_UInt, | |
post: stdlib.T_UInt, | |
pre: stdlib.T_UInt | |
})], true, true, false, ((txn1) => { | |
const sim_r = { txns: [] }; | |
sim_r.prevSt = stdlib.digest(stdlib.T_Tuple([stdlib.T_UInt, stdlib.T_UInt]), [stdlib.checkedBigNumberify('./index.rsh:40:14:dot', stdlib.UInt_max, 0), v0]); | |
sim_r.prevSt_noPrevTime = stdlib.digest(stdlib.T_Tuple([stdlib.T_UInt]), [stdlib.checkedBigNumberify('./index.rsh:40:14:dot', stdlib.UInt_max, 0)]); | |
const [v9] = txn1.data; | |
const v10 = txn1.value; | |
const v17 = txn1.time; | |
const v8 = txn1.from; | |
stdlib.assert(true, { | |
at: './index.rsh:40:14:dot', | |
fs: [], | |
msg: 'sender correct', | |
who: 'Borrower' | |
}); | |
const v11 = v9.collateral; | |
const v12 = stdlib.eq(v10, v11); | |
stdlib.assert(v12, { | |
at: './index.rsh:40:14:dot', | |
fs: [], | |
msg: 'pay amount correct', | |
who: 'Borrower' | |
}); | |
const v13 = stdlib.checkedBigNumberify('./index.rsh:compileDApp', stdlib.UInt_max, 0); | |
const v16 = stdlib.add(v13, v10); | |
const v19 = v9.pre; | |
const v20 = v9.post; | |
const v21 = v9.maturation; | |
const v22 = v9.maxLenderDelay; | |
const v23 = stdlib.lt(v19, v20); | |
stdlib.assert(v23, { | |
at: './index.rsh:44:12:application', | |
fs: [], | |
msg: null, | |
who: 'Borrower' | |
}); | |
sim_r.nextSt = stdlib.digest(stdlib.T_Tuple([stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_Address, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt]), [stdlib.checkedBigNumberify('./index.rsh:45:13:after expr stmt semicolon', stdlib.UInt_max, 1), v17, v16, v8, v11, v19, v20, v21, v22]); | |
sim_r.nextSt_noTime = stdlib.digest(stdlib.T_Tuple([stdlib.T_UInt, stdlib.T_UInt, stdlib.T_Address, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt]), [stdlib.checkedBigNumberify('./index.rsh:45:13:after expr stmt semicolon', stdlib.UInt_max, 1), v16, v8, v11, v19, v20, v21, v22]); | |
sim_r.isHalt = false; | |
return sim_r; | |
}))); | |
const [v9] = txn1.data; | |
const v10 = txn1.value; | |
const v17 = txn1.time; | |
const v8 = txn1.from; | |
stdlib.assert(true, { | |
at: './index.rsh:40:14:dot', | |
fs: [], | |
msg: 'sender correct', | |
who: 'Borrower' | |
}); | |
const v11 = v9.collateral; | |
const v12 = stdlib.eq(v10, v11); | |
stdlib.assert(v12, { | |
at: './index.rsh:40:14:dot', | |
fs: [], | |
msg: 'pay amount correct', | |
who: 'Borrower' | |
}); | |
const v13 = stdlib.checkedBigNumberify('./index.rsh:compileDApp', stdlib.UInt_max, 0); | |
const v16 = stdlib.add(v13, v10); | |
const v19 = v9.pre; | |
const v20 = v9.post; | |
const v21 = v9.maturation; | |
const v22 = v9.maxLenderDelay; | |
const v23 = stdlib.lt(v19, v20); | |
stdlib.assert(v23, { | |
at: './index.rsh:44:12:application', | |
fs: [], | |
msg: null, | |
who: 'Borrower' | |
}); | |
const txn2 = await (ctc.recv('Borrower', 2, 0, [], false, v22)); | |
if (txn2.didTimeout) { | |
const txn3 = await (ctc.sendrecv('Borrower', 5, 0, stdlib.checkedBigNumberify('reach standard library:67:7:dot', stdlib.UInt_max, 0), [stdlib.T_UInt, stdlib.T_UInt, stdlib.T_Address, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt], [v17, v16, v8, v11, v19, v20, v21, v22], stdlib.checkedBigNumberify('reach standard library:decimal', stdlib.UInt_max, 0), [], true, true, false, ((txn3) => { | |
const sim_r = { txns: [] }; | |
sim_r.prevSt = stdlib.digest(stdlib.T_Tuple([stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_Address, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt]), [stdlib.checkedBigNumberify('reach standard library:67:7:dot', stdlib.UInt_max, 1), v17, v16, v8, v11, v19, v20, v21, v22]); | |
sim_r.prevSt_noPrevTime = stdlib.digest(stdlib.T_Tuple([stdlib.T_UInt, stdlib.T_UInt, stdlib.T_Address, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt]), [stdlib.checkedBigNumberify('reach standard library:67:7:dot', stdlib.UInt_max, 1), v16, v8, v11, v19, v20, v21, v22]); | |
const [] = txn3.data; | |
const v31 = txn3.value; | |
const v38 = txn3.time; | |
const v30 = txn3.from; | |
const v33 = stdlib.addressEq(v8, v30); | |
stdlib.assert(v33, { | |
at: 'reach standard library:67:7:dot', | |
fs: ['at ./index.rsh:52:16:application call to [unknown function] (defined at: reach standard library:66:8:function exp)'], | |
msg: 'sender correct', | |
who: 'Borrower' | |
}); | |
const v32 = stdlib.eq(v31, stdlib.checkedBigNumberify('reach standard library:decimal', stdlib.UInt_max, 0)); | |
stdlib.assert(v32, { | |
at: 'reach standard library:67:7:dot', | |
fs: ['at ./index.rsh:52:16:application call to [unknown function] (defined at: reach standard library:66:8:function exp)'], | |
msg: 'pay amount correct', | |
who: 'Borrower' | |
}); | |
const v37 = stdlib.add(v16, v31); | |
sim_r.txns.push({ | |
amt: v37, | |
to: v8 | |
}); | |
sim_r.nextSt = stdlib.digest(stdlib.T_Tuple([]), []); | |
sim_r.nextSt_noTime = stdlib.digest(stdlib.T_Tuple([]), []); | |
sim_r.isHalt = true; | |
return sim_r; | |
}))); | |
const [] = txn3.data; | |
const v31 = txn3.value; | |
const v38 = txn3.time; | |
const v30 = txn3.from; | |
const v33 = stdlib.addressEq(v8, v30); | |
stdlib.assert(v33, { | |
at: 'reach standard library:67:7:dot', | |
fs: ['at ./index.rsh:52:16:application call to [unknown function] (defined at: reach standard library:66:8:function exp)'], | |
msg: 'sender correct', | |
who: 'Borrower' | |
}); | |
const v32 = stdlib.eq(v31, stdlib.checkedBigNumberify('reach standard library:decimal', stdlib.UInt_max, 0)); | |
stdlib.assert(v32, { | |
at: 'reach standard library:67:7:dot', | |
fs: ['at ./index.rsh:52:16:application call to [unknown function] (defined at: reach standard library:66:8:function exp)'], | |
msg: 'pay amount correct', | |
who: 'Borrower' | |
}); | |
const v37 = stdlib.add(v16, v31); | |
; | |
stdlib.protect(stdlib.T_Null, await interact.sendOutcome('Lender failed to lend on time'), { | |
at: './index.rsh:32:31:application', | |
fs: ['at ./index.rsh:33:11:after expr stmt semicolon call to [unknown function] (defined at: ./index.rsh:31:37:function exp)', 'at reach standard library:70:8:application call to [unknown function] (defined at: ./index.rsh:30:18:function exp)', 'at ./index.rsh:52:16:application call to [unknown function] (defined at: reach standard library:66:8:function exp)'], | |
msg: 'sendOutcome', | |
who: 'Borrower' | |
}); | |
return; | |
} | |
else { | |
const [] = txn2.data; | |
const v55 = txn2.value; | |
const v61 = txn2.time; | |
const v54 = txn2.from; | |
stdlib.assert(true, { | |
at: './index.rsh:50:12:dot', | |
fs: [], | |
msg: 'sender correct', | |
who: 'Borrower' | |
}); | |
const v56 = stdlib.eq(v55, v19); | |
stdlib.assert(v56, { | |
at: './index.rsh:50:12:dot', | |
fs: [], | |
msg: 'pay amount correct', | |
who: 'Borrower' | |
}); | |
const v60 = stdlib.add(v16, v55); | |
; | |
const v66 = stdlib.sub(v60, v19); | |
stdlib.protect(stdlib.T_Null, await interact.waitForPayback(), { | |
at: './index.rsh:59:30:application', | |
fs: ['at ./index.rsh:60:7:after expr stmt semicolon call to [unknown function] (defined at: ./index.rsh:58:22:function exp)'], | |
msg: 'waitForPayback', | |
who: 'Borrower' | |
}); | |
const txn3 = await (ctc.sendrecv('Borrower', 3, 0, stdlib.checkedBigNumberify('./index.rsh:61:14:dot', stdlib.UInt_max, 3), [stdlib.T_UInt, stdlib.T_Address, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_Address, stdlib.T_UInt, stdlib.T_UInt], [v66, v8, v11, v61, v54, v20, v21], v20, [], true, true, v21, ((txn3) => { | |
const sim_r = { txns: [] }; | |
sim_r.prevSt = stdlib.digest(stdlib.T_Tuple([stdlib.T_UInt, stdlib.T_UInt, stdlib.T_Address, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_Address, stdlib.T_UInt, stdlib.T_UInt]), [stdlib.checkedBigNumberify('./index.rsh:61:14:dot', stdlib.UInt_max, 2), v66, v8, v11, v61, v54, v20, v21]); | |
sim_r.prevSt_noPrevTime = stdlib.digest(stdlib.T_Tuple([stdlib.T_UInt, stdlib.T_UInt, stdlib.T_Address, stdlib.T_UInt, stdlib.T_Address, stdlib.T_UInt, stdlib.T_UInt]), [stdlib.checkedBigNumberify('./index.rsh:61:14:dot', stdlib.UInt_max, 2), v66, v8, v11, v54, v20, v21]); | |
const [] = txn3.data; | |
const v98 = txn3.value; | |
const v105 = txn3.time; | |
const v97 = txn3.from; | |
const v100 = stdlib.addressEq(v8, v97); | |
stdlib.assert(v100, { | |
at: './index.rsh:61:14:dot', | |
fs: [], | |
msg: 'sender correct', | |
who: 'Borrower' | |
}); | |
const v99 = stdlib.eq(v98, v20); | |
stdlib.assert(v99, { | |
at: './index.rsh:61:14:dot', | |
fs: [], | |
msg: 'pay amount correct', | |
who: 'Borrower' | |
}); | |
sim_r.txns.push({ | |
amt: v20, | |
to: v54 | |
}); | |
sim_r.txns.push({ | |
amt: v11, | |
to: v8 | |
}); | |
sim_r.nextSt = stdlib.digest(stdlib.T_Tuple([]), []); | |
sim_r.nextSt_noTime = stdlib.digest(stdlib.T_Tuple([]), []); | |
sim_r.isHalt = true; | |
return sim_r; | |
}))); | |
if (txn3.didTimeout) { | |
const txn4 = await (ctc.recv('Borrower', 4, 0, [], false, false)); | |
const [] = txn4.data; | |
const v74 = txn4.value; | |
const v81 = txn4.time; | |
const v73 = txn4.from; | |
const v76 = stdlib.addressEq(v54, v73); | |
stdlib.assert(v76, { | |
at: 'reach standard library:67:7:dot', | |
fs: ['at ./index.rsh:63:16:application call to [unknown function] (defined at: reach standard library:66:8:function exp)'], | |
msg: 'sender correct', | |
who: 'Borrower' | |
}); | |
const v75 = stdlib.eq(v74, stdlib.checkedBigNumberify('reach standard library:decimal', stdlib.UInt_max, 0)); | |
stdlib.assert(v75, { | |
at: 'reach standard library:67:7:dot', | |
fs: ['at ./index.rsh:63:16:application call to [unknown function] (defined at: reach standard library:66:8:function exp)'], | |
msg: 'pay amount correct', | |
who: 'Borrower' | |
}); | |
const v80 = stdlib.add(v66, v74); | |
; | |
stdlib.protect(stdlib.T_Null, await interact.sendOutcome('Borrower failed to pay on time'), { | |
at: './index.rsh:32:31:application', | |
fs: ['at ./index.rsh:33:11:after expr stmt semicolon call to [unknown function] (defined at: ./index.rsh:31:37:function exp)', 'at reach standard library:70:8:application call to [unknown function] (defined at: ./index.rsh:30:18:function exp)', 'at ./index.rsh:63:16:application call to [unknown function] (defined at: reach standard library:66:8:function exp)'], | |
msg: 'sendOutcome', | |
who: 'Borrower' | |
}); | |
return; | |
} | |
else { | |
const [] = txn3.data; | |
const v98 = txn3.value; | |
const v105 = txn3.time; | |
const v97 = txn3.from; | |
const v100 = stdlib.addressEq(v8, v97); | |
stdlib.assert(v100, { | |
at: './index.rsh:61:14:dot', | |
fs: [], | |
msg: 'sender correct', | |
who: 'Borrower' | |
}); | |
const v99 = stdlib.eq(v98, v20); | |
stdlib.assert(v99, { | |
at: './index.rsh:61:14:dot', | |
fs: [], | |
msg: 'pay amount correct', | |
who: 'Borrower' | |
}); | |
; | |
; | |
return; } | |
} | |
} | |
export async function Lender(ctc, interact) { | |
const stdlib = ctc.stdlib; | |
const v0 = await ctc.creationTime(); | |
const txn1 = await (ctc.recv('Lender', 1, 1, [stdlib.T_Object({ | |
collateral: stdlib.T_UInt, | |
maturation: stdlib.T_UInt, | |
maxLenderDelay: stdlib.T_UInt, | |
post: stdlib.T_UInt, | |
pre: stdlib.T_UInt | |
})], false, false)); | |
const [v9] = txn1.data; | |
const v10 = txn1.value; | |
const v17 = txn1.time; | |
const v8 = txn1.from; | |
stdlib.assert(true, { | |
at: './index.rsh:40:14:dot', | |
fs: [], | |
msg: 'sender correct', | |
who: 'Lender' | |
}); | |
const v11 = v9.collateral; | |
const v12 = stdlib.eq(v10, v11); | |
stdlib.assert(v12, { | |
at: './index.rsh:40:14:dot', | |
fs: [], | |
msg: 'pay amount correct', | |
who: 'Lender' | |
}); | |
const v13 = stdlib.checkedBigNumberify('./index.rsh:compileDApp', stdlib.UInt_max, 0); | |
const v16 = stdlib.add(v13, v10); | |
const v19 = v9.pre; | |
const v20 = v9.post; | |
const v21 = v9.maturation; | |
const v22 = v9.maxLenderDelay; | |
const v23 = stdlib.lt(v19, v20); | |
stdlib.assert(v23, { | |
at: './index.rsh:44:12:application', | |
fs: [], | |
msg: null, | |
who: 'Lender' | |
}); | |
stdlib.protect(stdlib.T_Null, await interact.acceptParams(v9), { | |
at: './index.rsh:48:28:application', | |
fs: ['at ./index.rsh:49:7:after expr stmt semicolon call to [unknown function] (defined at: ./index.rsh:47:20:function exp)'], | |
msg: 'acceptParams', | |
who: 'Lender' | |
}); | |
const txn2 = await (ctc.sendrecv('Lender', 2, 0, stdlib.checkedBigNumberify('./index.rsh:50:12:dot', stdlib.UInt_max, 0), [stdlib.T_UInt, stdlib.T_UInt, stdlib.T_Address, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt], [v17, v16, v8, v11, v19, v20, v21, v22], v19, [], true, true, v22, ((txn2) => { | |
const sim_r = { txns: [] }; | |
sim_r.prevSt = stdlib.digest(stdlib.T_Tuple([stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_Address, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt]), [stdlib.checkedBigNumberify('./index.rsh:50:12:dot', stdlib.UInt_max, 1), v17, v16, v8, v11, v19, v20, v21, v22]); | |
sim_r.prevSt_noPrevTime = stdlib.digest(stdlib.T_Tuple([stdlib.T_UInt, stdlib.T_UInt, stdlib.T_Address, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_UInt]), [stdlib.checkedBigNumberify('./index.rsh:50:12:dot', stdlib.UInt_max, 1), v16, v8, v11, v19, v20, v21, v22]); | |
const [] = txn2.data; | |
const v55 = txn2.value; | |
const v61 = txn2.time; | |
const v54 = txn2.from; | |
stdlib.assert(true, { | |
at: './index.rsh:50:12:dot', | |
fs: [], | |
msg: 'sender correct', | |
who: 'Lender' | |
}); | |
const v56 = stdlib.eq(v55, v19); | |
stdlib.assert(v56, { | |
at: './index.rsh:50:12:dot', | |
fs: [], | |
msg: 'pay amount correct', | |
who: 'Lender' | |
}); | |
const v60 = stdlib.add(v16, v55); | |
sim_r.txns.push({ | |
amt: v19, | |
to: v8 | |
}); | |
const v66 = stdlib.sub(v60, v19); | |
sim_r.nextSt = stdlib.digest(stdlib.T_Tuple([stdlib.T_UInt, stdlib.T_UInt, stdlib.T_Address, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_Address, stdlib.T_UInt, stdlib.T_UInt]), [stdlib.checkedBigNumberify('./index.rsh:56:13:after expr stmt semicolon', stdlib.UInt_max, 2), v66, v8, v11, v61, v54, v20, v21]); | |
sim_r.nextSt_noTime = stdlib.digest(stdlib.T_Tuple([stdlib.T_UInt, stdlib.T_UInt, stdlib.T_Address, stdlib.T_UInt, stdlib.T_Address, stdlib.T_UInt, stdlib.T_UInt]), [stdlib.checkedBigNumberify('./index.rsh:56:13:after expr stmt semicolon', stdlib.UInt_max, 2), v66, v8, v11, v54, v20, v21]); | |
sim_r.isHalt = false; | |
return sim_r; | |
}))); | |
if (txn2.didTimeout) { | |
const txn3 = await (ctc.recv('Lender', 5, 0, [], false, false)); | |
const [] = txn3.data; | |
const v31 = txn3.value; | |
const v38 = txn3.time; | |
const v30 = txn3.from; | |
const v33 = stdlib.addressEq(v8, v30); | |
stdlib.assert(v33, { | |
at: 'reach standard library:67:7:dot', | |
fs: ['at ./index.rsh:52:16:application call to [unknown function] (defined at: reach standard library:66:8:function exp)'], | |
msg: 'sender correct', | |
who: 'Lender' | |
}); | |
const v32 = stdlib.eq(v31, stdlib.checkedBigNumberify('reach standard library:decimal', stdlib.UInt_max, 0)); | |
stdlib.assert(v32, { | |
at: 'reach standard library:67:7:dot', | |
fs: ['at ./index.rsh:52:16:application call to [unknown function] (defined at: reach standard library:66:8:function exp)'], | |
msg: 'pay amount correct', | |
who: 'Lender' | |
}); | |
const v37 = stdlib.add(v16, v31); | |
; | |
stdlib.protect(stdlib.T_Null, await interact.sendOutcome('Lender failed to lend on time'), { | |
at: './index.rsh:32:31:application', | |
fs: ['at ./index.rsh:33:11:after expr stmt semicolon call to [unknown function] (defined at: ./index.rsh:31:37:function exp)', 'at reach standard library:70:8:application call to [unknown function] (defined at: ./index.rsh:30:18:function exp)', 'at ./index.rsh:52:16:application call to [unknown function] (defined at: reach standard library:66:8:function exp)'], | |
msg: 'sendOutcome', | |
who: 'Lender' | |
}); | |
return; | |
} | |
else { | |
const [] = txn2.data; | |
const v55 = txn2.value; | |
const v61 = txn2.time; | |
const v54 = txn2.from; | |
stdlib.assert(true, { | |
at: './index.rsh:50:12:dot', | |
fs: [], | |
msg: 'sender correct', | |
who: 'Lender' | |
}); | |
const v56 = stdlib.eq(v55, v19); | |
stdlib.assert(v56, { | |
at: './index.rsh:50:12:dot', | |
fs: [], | |
msg: 'pay amount correct', | |
who: 'Lender' | |
}); | |
const v60 = stdlib.add(v16, v55); | |
; | |
const v66 = stdlib.sub(v60, v19); | |
const txn3 = await (ctc.recv('Lender', 3, 0, [], false, v21)); | |
if (txn3.didTimeout) { | |
const txn4 = await (ctc.sendrecv('Lender', 4, 0, stdlib.checkedBigNumberify('reach standard library:67:7:dot', stdlib.UInt_max, 3), [stdlib.T_UInt, stdlib.T_Address, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_Address, stdlib.T_UInt, stdlib.T_UInt], [v66, v8, v11, v61, v54, v20, v21], stdlib.checkedBigNumberify('reach standard library:decimal', stdlib.UInt_max, 0), [], true, true, false, ((txn4) => { | |
const sim_r = { txns: [] }; | |
sim_r.prevSt = stdlib.digest(stdlib.T_Tuple([stdlib.T_UInt, stdlib.T_UInt, stdlib.T_Address, stdlib.T_UInt, stdlib.T_UInt, stdlib.T_Address, stdlib.T_UInt, stdlib.T_UInt]), [stdlib.checkedBigNumberify('reach standard library:67:7:dot', stdlib.UInt_max, 2), v66, v8, v11, v61, v54, v20, v21]); | |
sim_r.prevSt_noPrevTime = stdlib.digest(stdlib.T_Tuple([stdlib.T_UInt, stdlib.T_UInt, stdlib.T_Address, stdlib.T_UInt, stdlib.T_Address, stdlib.T_UInt, stdlib.T_UInt]), [stdlib.checkedBigNumberify('reach standard library:67:7:dot', stdlib.UInt_max, 2), v66, v8, v11, v54, v20, v21]); | |
const [] = txn4.data; | |
const v74 = txn4.value; | |
const v81 = txn4.time; | |
const v73 = txn4.from; | |
const v76 = stdlib.addressEq(v54, v73); | |
stdlib.assert(v76, { | |
at: 'reach standard library:67:7:dot', | |
fs: ['at ./index.rsh:63:16:application call to [unknown function] (defined at: reach standard library:66:8:function exp)'], | |
msg: 'sender correct', | |
who: 'Lender' | |
}); | |
const v75 = stdlib.eq(v74, stdlib.checkedBigNumberify('reach standard library:decimal', stdlib.UInt_max, 0)); | |
stdlib.assert(v75, { | |
at: 'reach standard library:67:7:dot', | |
fs: ['at ./index.rsh:63:16:application call to [unknown function] (defined at: reach standard library:66:8:function exp)'], | |
msg: 'pay amount correct', | |
who: 'Lender' | |
}); | |
const v80 = stdlib.add(v66, v74); | |
sim_r.txns.push({ | |
amt: v80, | |
to: v54 | |
}); | |
sim_r.nextSt = stdlib.digest(stdlib.T_Tuple([]), []); | |
sim_r.nextSt_noTime = stdlib.digest(stdlib.T_Tuple([]), []); | |
sim_r.isHalt = true; | |
return sim_r; | |
}))); | |
const [] = txn4.data; | |
const v74 = txn4.value; | |
const v81 = txn4.time; | |
const v73 = txn4.from; | |
const v76 = stdlib.addressEq(v54, v73); | |
stdlib.assert(v76, { | |
at: 'reach standard library:67:7:dot', | |
fs: ['at ./index.rsh:63:16:application call to [unknown function] (defined at: reach standard library:66:8:function exp)'], | |
msg: 'sender correct', | |
who: 'Lender' | |
}); | |
const v75 = stdlib.eq(v74, stdlib.checkedBigNumberify('reach standard library:decimal', stdlib.UInt_max, 0)); | |
stdlib.assert(v75, { | |
at: 'reach standard library:67:7:dot', | |
fs: ['at ./index.rsh:63:16:application call to [unknown function] (defined at: reach standard library:66:8:function exp)'], | |
msg: 'pay amount correct', | |
who: 'Lender' | |
}); | |
const v80 = stdlib.add(v66, v74); | |
; | |
stdlib.protect(stdlib.T_Null, await interact.sendOutcome('Borrower failed to pay on time'), { | |
at: './index.rsh:32:31:application', | |
fs: ['at ./index.rsh:33:11:after expr stmt semicolon call to [unknown function] (defined at: ./index.rsh:31:37:function exp)', 'at reach standard library:70:8:application call to [unknown function] (defined at: ./index.rsh:30:18:function exp)', 'at ./index.rsh:63:16:application call to [unknown function] (defined at: reach standard library:66:8:function exp)'], | |
msg: 'sendOutcome', | |
who: 'Lender' | |
}); | |
return; | |
} | |
else { | |
const [] = txn3.data; | |
const v98 = txn3.value; | |
const v105 = txn3.time; | |
const v97 = txn3.from; | |
const v100 = stdlib.addressEq(v8, v97); | |
stdlib.assert(v100, { | |
at: './index.rsh:61:14:dot', | |
fs: [], | |
msg: 'sender correct', | |
who: 'Lender' | |
}); | |
const v99 = stdlib.eq(v98, v20); | |
stdlib.assert(v99, { | |
at: './index.rsh:61:14:dot', | |
fs: [], | |
msg: 'pay amount correct', | |
who: 'Lender' | |
}); | |
; | |
; | |
return; } | |
} | |
} | |
const _ALGO = { | |
appApproval: `#pragma version 2 | |
// Check that we're an App | |
txn TypeEnum | |
int appl | |
== | |
assert | |
txn RekeyTo | |
global ZeroAddress | |
== | |
assert | |
// Check that everyone's here | |
global GroupSize | |
int 4 | |
>= | |
assert | |
// Check txnAppl (us) | |
txn GroupIndex | |
int 0 | |
== | |
assert | |
// Check txnFromHandler | |
int 0 | |
gtxn 2 Sender | |
byte "{{m1}}" | |
== | |
|| | |
gtxn 2 Sender | |
byte "{{m2}}" | |
== | |
|| | |
gtxn 2 Sender | |
byte "{{m3}}" | |
== | |
|| | |
gtxn 2 Sender | |
byte "{{m4}}" | |
== | |
|| | |
gtxn 2 Sender | |
byte "{{m5}}" | |
== | |
|| | |
assert | |
byte base64(cw==) | |
app_global_get | |
gtxna 2 Args 0 | |
== | |
assert | |
byte base64(bA==) | |
app_global_get | |
gtxna 2 Args 4 | |
btoi | |
== | |
assert | |
// Don't check anyone else, because Handler does | |
// Update state | |
byte base64(cw==) | |
gtxna 2 Args 1 | |
app_global_put | |
byte base64(bA==) | |
global Round | |
app_global_put | |
byte base64(aA==) | |
gtxna 2 Args 2 | |
btoi | |
app_global_put | |
byte base64(aA==) | |
app_global_get | |
bnz halted | |
txn OnCompletion | |
int NoOp | |
== | |
assert | |
b done | |
halted: | |
txn OnCompletion | |
int DeleteApplication | |
== | |
assert | |
done: | |
int 1 | |
return | |
`, | |
appApproval0: `#pragma version 2 | |
// Check that we're an App | |
txn TypeEnum | |
int appl | |
== | |
assert | |
txn RekeyTo | |
global ZeroAddress | |
== | |
assert | |
txn Sender | |
byte "{{Deployer}}" | |
== | |
assert | |
txn ApplicationID | |
bz init | |
global GroupSize | |
int 7 | |
== | |
assert | |
txn OnCompletion | |
int UpdateApplication | |
== | |
assert | |
byte base64(cw==) | |
// compute state in HM_Set | |
int 0 | |
itob | |
keccak256 | |
app_global_put | |
byte base64(bA==) | |
global Round | |
app_global_put | |
byte base64(aA==) | |
int 0 | |
app_global_put | |
b done | |
init: | |
global GroupSize | |
int 1 | |
== | |
assert | |
txn OnCompletion | |
int NoOp | |
== | |
assert | |
done: | |
int 1 | |
return | |
`, | |
appClear: `#pragma version 2 | |
// We're alone | |
global GroupSize | |
int 1 | |
== | |
assert | |
// We're halted | |
byte base64(aA==) | |
app_global_get | |
int 1 | |
== | |
assert | |
done: | |
int 1 | |
return | |
`, | |
ctc: `#pragma version 2 | |
// Check size | |
global GroupSize | |
int 4 | |
>= | |
assert | |
// Check txnAppl | |
gtxn 0 TypeEnum | |
int appl | |
== | |
assert | |
gtxn 0 ApplicationID | |
byte "{{ApplicationID}}" | |
btoi | |
== | |
assert | |
// Don't check anything else, because app does | |
// Check us | |
txn TypeEnum | |
int pay | |
== | |
assert | |
txn RekeyTo | |
global ZeroAddress | |
== | |
assert | |
txn CloseRemainderTo | |
global ZeroAddress | |
== | |
assert | |
txn GroupIndex | |
int 4 | |
>= | |
assert | |
done: | |
int 1 | |
return | |
`, | |
stepargs: [0, 121, 161, 177, 177, 161], | |
steps: [null, `#pragma version 2 | |
// Handler 1 | |
// Check txnAppl | |
gtxn 0 TypeEnum | |
int appl | |
== | |
assert | |
gtxn 0 ApplicationID | |
byte "{{ApplicationID}}" | |
btoi | |
== | |
assert | |
// Check txnToHandler | |
gtxn 1 TypeEnum | |
int pay | |
== | |
assert | |
gtxn 1 Receiver | |
txn Sender | |
== | |
assert | |
gtxn 1 Amount | |
gtxn 2 Fee | |
== | |
assert | |
// Check txnToContract | |
gtxn 3 TypeEnum | |
int pay | |
== | |
assert | |
gtxn 3 Receiver | |
byte "{{ContractAddr}}" | |
== | |
assert | |
// Check txnFromHandler (us) | |
txn GroupIndex | |
int 2 | |
== | |
assert | |
txn TypeEnum | |
int pay | |
== | |
assert | |
txn Amount | |
int 0 | |
== | |
assert | |
txn Receiver | |
gtxn 1 Sender | |
== | |
assert | |
txn NumArgs | |
int 6 | |
== | |
assert | |
// compute state in HM_Check 0 | |
int 0 | |
itob | |
keccak256 | |
arg 0 | |
== | |
assert | |
// Run body | |
// Just "sender correct" | |
// "./index.rsh:40:14:dot" | |
// "[]" | |
int 1 | |
assert | |
arg 5 | |
substring 0 8 | |
btoi | |
store 255 | |
// Just "pay amount correct" | |
// "./index.rsh:40:14:dot" | |
// "[]" | |
gtxn 3 Amount | |
arg 3 | |
btoi | |
- | |
load 255 | |
== | |
assert | |
int 0 | |
gtxn 3 Amount | |
arg 3 | |
btoi | |
- | |
+ | |
store 254 | |
arg 5 | |
substring 32 40 | |
btoi | |
store 253 | |
arg 5 | |
substring 24 32 | |
btoi | |
store 252 | |
arg 5 | |
substring 8 16 | |
btoi | |
store 251 | |
arg 5 | |
substring 16 24 | |
btoi | |
store 250 | |
// Nothing | |
// "./index.rsh:44:12:application" | |
// "[]" | |
load 253 | |
load 252 | |
< | |
assert | |
// compute state in HM_Set | |
int 1 | |
itob | |
load 254 | |
itob | |
concat | |
gtxn 3 Sender | |
concat | |
load 255 | |
itob | |
concat | |
load 253 | |
itob | |
concat | |
load 252 | |
itob | |
concat | |
load 251 | |
itob | |
concat | |
load 250 | |
itob | |
concat | |
keccak256 | |
arg 1 | |
== | |
assert | |
arg 2 | |
btoi | |
int 0 | |
== | |
assert | |
b done | |
// Check GroupSize | |
global GroupSize | |
int 4 | |
== | |
assert | |
arg 3 | |
btoi | |
int 0 | |
== | |
assert | |
// Check time limits | |
done: | |
int 1 | |
return | |
`, `#pragma version 2 | |
// Handler 2 | |
// Check txnAppl | |
gtxn 0 TypeEnum | |
int appl | |
== | |
assert | |
gtxn 0 ApplicationID | |
byte "{{ApplicationID}}" | |
btoi | |
== | |
assert | |
// Check txnToHandler | |
gtxn 1 TypeEnum | |
int pay | |
== | |
assert | |
gtxn 1 Receiver | |
txn Sender | |
== | |
assert | |
gtxn 1 Amount | |
gtxn 2 Fee | |
== | |
assert | |
// Check txnToContract | |
gtxn 3 TypeEnum | |
int pay | |
== | |
assert | |
gtxn 3 Receiver | |
byte "{{ContractAddr}}" | |
== | |
assert | |
// Check txnFromHandler (us) | |
txn GroupIndex | |
int 2 | |
== | |
assert | |
txn TypeEnum | |
int pay | |
== | |
assert | |
txn Amount | |
int 0 | |
== | |
assert | |
txn Receiver | |
gtxn 1 Sender | |
== | |
assert | |
txn NumArgs | |
int 12 | |
== | |
assert | |
// compute state in HM_Check 1 | |
int 1 | |
itob | |
arg 5 | |
concat | |
arg 6 | |
concat | |
arg 7 | |
concat | |
arg 8 | |
concat | |
arg 9 | |
concat | |
arg 10 | |
concat | |
arg 11 | |
concat | |
keccak256 | |
arg 0 | |
== | |
assert | |
// Run body | |
// Just "sender correct" | |
// "./index.rsh:50:12:dot" | |
// "[]" | |
int 1 | |
assert | |
// Just "pay amount correct" | |
// "./index.rsh:50:12:dot" | |
// "[]" | |
gtxn 3 Amount | |
arg 3 | |
btoi | |
- | |
arg 8 | |
btoi | |
== | |
assert | |
gtxn 4 TypeEnum | |
int pay | |
== | |
assert | |
gtxn 4 Receiver | |
arg 6 | |
== | |
assert | |
gtxn 4 Amount | |
arg 8 | |
btoi | |
== | |
assert | |
gtxn 4 Sender | |
byte "{{ContractAddr}}" | |
== | |
assert | |
// compute state in HM_Set | |
int 2 | |
itob | |
arg 5 | |
btoi | |
gtxn 3 Amount | |
arg 3 | |
btoi | |
- | |
+ | |
arg 8 | |
btoi | |
- | |
itob | |
concat | |
arg 6 | |
concat | |
arg 7 | |
concat | |
gtxn 3 Sender | |
concat | |
arg 9 | |
concat | |
arg 10 | |
concat | |
keccak256 | |
arg 1 | |
== | |
assert | |
arg 2 | |
btoi | |
int 0 | |
== | |
assert | |
b done | |
// Check GroupSize | |
global GroupSize | |
int 5 | |
== | |
assert | |
arg 3 | |
btoi | |
gtxn 4 Fee | |
== | |
assert | |
// Check time limits | |
arg 4 | |
btoi | |
arg 11 | |
btoi | |
+ | |
dup | |
gtxn 0 LastValid | |
== | |
assert | |
dup | |
gtxn 1 LastValid | |
== | |
assert | |
dup | |
gtxn 2 LastValid | |
== | |
assert | |
dup | |
gtxn 3 LastValid | |
== | |
assert | |
dup | |
gtxn 4 LastValid | |
== | |
assert | |
pop | |
done: | |
int 1 | |
return | |
`, `#pragma version 2 | |
// Handler 3 | |
// Check txnAppl | |
gtxn 0 TypeEnum | |
int appl | |
== | |
assert | |
gtxn 0 ApplicationID | |
byte "{{ApplicationID}}" | |
btoi | |
== | |
assert | |
// Check txnToHandler | |
gtxn 1 TypeEnum | |
int pay | |
== | |
assert | |
gtxn 1 Receiver | |
txn Sender | |
== | |
assert | |
gtxn 1 Amount | |
gtxn 2 Fee | |
== | |
assert | |
// Check txnToContract | |
gtxn 3 TypeEnum | |
int pay | |
== | |
assert | |
gtxn 3 Receiver | |
byte "{{ContractAddr}}" | |
== | |
assert | |
// Check txnFromHandler (us) | |
txn GroupIndex | |
int 2 | |
== | |
assert | |
txn TypeEnum | |
int pay | |
== | |
assert | |
txn Amount | |
int 0 | |
== | |
assert | |
txn Receiver | |
gtxn 1 Sender | |
== | |
assert | |
txn NumArgs | |
int 11 | |
== | |
assert | |
// compute state in HM_Check 2 | |
int 2 | |
itob | |
arg 5 | |
concat | |
arg 6 | |
concat | |
arg 7 | |
concat | |
arg 8 | |
concat | |
arg 9 | |
concat | |
arg 10 | |
concat | |
keccak256 | |
arg 0 | |
== | |
assert | |
// Run body | |
// Just "sender correct" | |
// "./index.rsh:61:14:dot" | |
// "[]" | |
arg 6 | |
gtxn 3 Sender | |
== | |
assert | |
// Just "pay amount correct" | |
// "./index.rsh:61:14:dot" | |
// "[]" | |
gtxn 3 Amount | |
arg 3 | |
btoi | |
- | |
arg 9 | |
btoi | |
== | |
assert | |
gtxn 4 TypeEnum | |
int pay | |
== | |
assert | |
gtxn 4 Receiver | |
arg 8 | |
== | |
assert | |
gtxn 4 Amount | |
arg 9 | |
btoi | |
== | |
assert | |
gtxn 4 Sender | |
byte "{{ContractAddr}}" | |
== | |
assert | |
gtxn 5 TypeEnum | |
int pay | |
== | |
assert | |
gtxn 5 Receiver | |
arg 6 | |
== | |
assert | |
gtxn 5 Amount | |
arg 7 | |
btoi | |
== | |
assert | |
gtxn 5 Sender | |
byte "{{ContractAddr}}" | |
== | |
assert | |
arg 2 | |
btoi | |
int 1 | |
== | |
assert | |
b done | |
// Check GroupSize | |
global GroupSize | |
int 6 | |
== | |
assert | |
arg 3 | |
btoi | |
gtxn 5 Fee | |
gtxn 4 Fee | |
+ | |
== | |
assert | |
// Check time limits | |
arg 4 | |
btoi | |
arg 10 | |
btoi | |
+ | |
dup | |
gtxn 0 LastValid | |
== | |
assert | |
dup | |
gtxn 1 LastValid | |
== | |
assert | |
dup | |
gtxn 2 LastValid | |
== | |
assert | |
dup | |
gtxn 3 LastValid | |
== | |
assert | |
dup | |
gtxn 4 LastValid | |
== | |
assert | |
dup | |
gtxn 5 LastValid | |
== | |
assert | |
pop | |
done: | |
int 1 | |
return | |
`, `#pragma version 2 | |
// Handler 4 | |
// Check txnAppl | |
gtxn 0 TypeEnum | |
int appl | |
== | |
assert | |
gtxn 0 ApplicationID | |
byte "{{ApplicationID}}" | |
btoi | |
== | |
assert | |
// Check txnToHandler | |
gtxn 1 TypeEnum | |
int pay | |
== | |
assert | |
gtxn 1 Receiver | |
txn Sender | |
== | |
assert | |
gtxn 1 Amount | |
gtxn 2 Fee | |
== | |
assert | |
// Check txnToContract | |
gtxn 3 TypeEnum | |
int pay | |
== | |
assert | |
gtxn 3 Receiver | |
byte "{{ContractAddr}}" | |
== | |
assert | |
// Check txnFromHandler (us) | |
txn GroupIndex | |
int 2 | |
== | |
assert | |
txn TypeEnum | |
int pay | |
== | |
assert | |
txn Amount | |
int 0 | |
== | |
assert | |
txn Receiver | |
gtxn 1 Sender | |
== | |
assert | |
txn NumArgs | |
int 11 | |
== | |
assert | |
// compute state in HM_Check 2 | |
int 2 | |
itob | |
arg 5 | |
concat | |
arg 6 | |
concat | |
arg 7 | |
concat | |
arg 8 | |
concat | |
arg 9 | |
concat | |
arg 10 | |
concat | |
keccak256 | |
arg 0 | |
== | |
assert | |
// Run body | |
// Just "sender correct" | |
// "reach standard library:67:7:dot" | |
// "[at ./index.rsh:63:16:application call to [unknown function] (defined at: reach standard library:66:8:function exp)]" | |
arg 8 | |
gtxn 3 Sender | |
== | |
assert | |
// Just "pay amount correct" | |
// "reach standard library:67:7:dot" | |
// "[at ./index.rsh:63:16:application call to [unknown function] (defined at: reach standard library:66:8:function exp)]" | |
gtxn 3 Amount | |
arg 3 | |
btoi | |
- | |
int 0 | |
== | |
assert | |
gtxn 4 TypeEnum | |
int pay | |
== | |
assert | |
gtxn 4 Receiver | |
arg 8 | |
== | |
assert | |
gtxn 4 Amount | |
arg 5 | |
btoi | |
gtxn 3 Amount | |
arg 3 | |
btoi | |
- | |
+ | |
== | |
assert | |
gtxn 4 Sender | |
byte "{{ContractAddr}}" | |
== | |
assert | |
arg 2 | |
btoi | |
int 1 | |
== | |
assert | |
b done | |
// Check GroupSize | |
global GroupSize | |
int 5 | |
== | |
assert | |
arg 3 | |
btoi | |
gtxn 4 Fee | |
== | |
assert | |
// Check time limits | |
arg 4 | |
btoi | |
arg 10 | |
btoi | |
+ | |
dup | |
gtxn 0 FirstValid | |
== | |
assert | |
dup | |
gtxn 1 FirstValid | |
== | |
assert | |
dup | |
gtxn 2 FirstValid | |
== | |
assert | |
dup | |
gtxn 3 FirstValid | |
== | |
assert | |
dup | |
gtxn 4 FirstValid | |
== | |
assert | |
pop | |
done: | |
int 1 | |
return | |
`, `#pragma version 2 | |
// Handler 5 | |
// Check txnAppl | |
gtxn 0 TypeEnum | |
int appl | |
== | |
assert | |
gtxn 0 ApplicationID | |
byte "{{ApplicationID}}" | |
btoi | |
== | |
assert | |
// Check txnToHandler | |
gtxn 1 TypeEnum | |
int pay | |
== | |
assert | |
gtxn 1 Receiver | |
txn Sender | |
== | |
assert | |
gtxn 1 Amount | |
gtxn 2 Fee | |
== | |
assert | |
// Check txnToContract | |
gtxn 3 TypeEnum | |
int pay | |
== | |
assert | |
gtxn 3 Receiver | |
byte "{{ContractAddr}}" | |
== | |
assert | |
// Check txnFromHandler (us) | |
txn GroupIndex | |
int 2 | |
== | |
assert | |
txn TypeEnum | |
int pay | |
== | |
assert | |
txn Amount | |
int 0 | |
== | |
assert | |
txn Receiver | |
gtxn 1 Sender | |
== | |
assert | |
txn NumArgs | |
int 12 | |
== | |
assert | |
// compute state in HM_Check 1 | |
int 1 | |
itob | |
arg 5 | |
concat | |
arg 6 | |
concat | |
arg 7 | |
concat | |
arg 8 | |
concat | |
arg 9 | |
concat | |
arg 10 | |
concat | |
arg 11 | |
concat | |
keccak256 | |
arg 0 | |
== | |
assert | |
// Run body | |
// Just "sender correct" | |
// "reach standard library:67:7:dot" | |
// "[at ./index.rsh:52:16:application call to [unknown function] (defined at: reach standard library:66:8:function exp)]" | |
arg 6 | |
gtxn 3 Sender | |
== | |
assert | |
// Just "pay amount correct" | |
// "reach standard library:67:7:dot" | |
// "[at ./index.rsh:52:16:application call to [unknown function] (defined at: reach standard library:66:8:function exp)]" | |
gtxn 3 Amount | |
arg 3 | |
btoi | |
- | |
int 0 | |
== | |
assert | |
gtxn 4 TypeEnum | |
int pay | |
== | |
assert | |
gtxn 4 Receiver | |
arg 6 | |
== | |
assert | |
gtxn 4 Amount | |
arg 5 | |
btoi | |
gtxn 3 Amount | |
arg 3 | |
btoi | |
- | |
+ | |
== | |
assert | |
gtxn 4 Sender | |
byte "{{ContractAddr}}" | |
== | |
assert | |
arg 2 | |
btoi | |
int 1 | |
== | |
assert | |
b done | |
// Check GroupSize | |
global GroupSize | |
int 5 | |
== | |
assert | |
arg 3 | |
btoi | |
gtxn 4 Fee | |
== | |
assert | |
// Check time limits | |
arg 4 | |
btoi | |
arg 11 | |
btoi | |
+ | |
dup | |
gtxn 0 FirstValid | |
== | |
assert | |
dup | |
gtxn 1 FirstValid | |
== | |
assert | |
dup | |
gtxn 2 FirstValid | |
== | |
assert | |
dup | |
gtxn 3 FirstValid | |
== | |
assert | |
dup | |
gtxn 4 FirstValid | |
== | |
assert | |
pop | |
done: | |
int 1 | |
return | |
`], | |
unsupported: false | |
}; | |
const _ETH = { | |
ABI: `[ | |
{ | |
"inputs": [], | |
"stateMutability": "payable", | |
"type": "constructor" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [], | |
"name": "e0", | |
"type": "event" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"components": [ | |
{ | |
"components": [ | |
{ | |
"internalType": "uint256", | |
"name": "v0", | |
"type": "uint256" | |
} | |
], | |
"internalType": "struct ReachContract.a0postsvs", | |
"name": "svs", | |
"type": "tuple" | |
}, | |
{ | |
"components": [ | |
{ | |
"components": [ | |
{ | |
"internalType": "uint256", | |
"name": "collateral", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "maturation", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "maxLenderDelay", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "post", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "pre", | |
"type": "uint256" | |
} | |
], | |
"internalType": "struct ReachContract.T0", | |
"name": "v9", | |
"type": "tuple" | |
} | |
], | |
"internalType": "struct ReachContract.a1msg", | |
"name": "msg", | |
"type": "tuple" | |
} | |
], | |
"indexed": false, | |
"internalType": "struct ReachContract.a1", | |
"name": "_a", | |
"type": "tuple" | |
} | |
], | |
"name": "e1", | |
"type": "event" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"components": [ | |
{ | |
"components": [ | |
{ | |
"internalType": "uint256", | |
"name": "v17", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v16", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "address payable", | |
"name": "v8", | |
"type": "address" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v11", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v19", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v20", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v21", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v22", | |
"type": "uint256" | |
} | |
], | |
"internalType": "struct ReachContract.a1postsvs", | |
"name": "svs", | |
"type": "tuple" | |
} | |
], | |
"indexed": false, | |
"internalType": "struct ReachContract.a2", | |
"name": "_a", | |
"type": "tuple" | |
} | |
], | |
"name": "e2", | |
"type": "event" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"components": [ | |
{ | |
"components": [ | |
{ | |
"internalType": "uint256", | |
"name": "v66", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "address payable", | |
"name": "v8", | |
"type": "address" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v11", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v61", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "address payable", | |
"name": "v54", | |
"type": "address" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v20", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v21", | |
"type": "uint256" | |
} | |
], | |
"internalType": "struct ReachContract.a2postsvs", | |
"name": "svs", | |
"type": "tuple" | |
} | |
], | |
"indexed": false, | |
"internalType": "struct ReachContract.a3", | |
"name": "_a", | |
"type": "tuple" | |
} | |
], | |
"name": "e3", | |
"type": "event" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"components": [ | |
{ | |
"components": [ | |
{ | |
"internalType": "uint256", | |
"name": "v66", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "address payable", | |
"name": "v8", | |
"type": "address" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v11", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v61", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "address payable", | |
"name": "v54", | |
"type": "address" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v20", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v21", | |
"type": "uint256" | |
} | |
], | |
"internalType": "struct ReachContract.a2postsvs", | |
"name": "svs", | |
"type": "tuple" | |
} | |
], | |
"indexed": false, | |
"internalType": "struct ReachContract.a4", | |
"name": "_a", | |
"type": "tuple" | |
} | |
], | |
"name": "e4", | |
"type": "event" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"components": [ | |
{ | |
"components": [ | |
{ | |
"internalType": "uint256", | |
"name": "v17", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v16", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "address payable", | |
"name": "v8", | |
"type": "address" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v11", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v19", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v20", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v21", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v22", | |
"type": "uint256" | |
} | |
], | |
"internalType": "struct ReachContract.a1postsvs", | |
"name": "svs", | |
"type": "tuple" | |
} | |
], | |
"indexed": false, | |
"internalType": "struct ReachContract.a5", | |
"name": "_a", | |
"type": "tuple" | |
} | |
], | |
"name": "e5", | |
"type": "event" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"components": [ | |
{ | |
"components": [ | |
{ | |
"internalType": "uint256", | |
"name": "v0", | |
"type": "uint256" | |
} | |
], | |
"internalType": "struct ReachContract.a0postsvs", | |
"name": "svs", | |
"type": "tuple" | |
}, | |
{ | |
"components": [ | |
{ | |
"components": [ | |
{ | |
"internalType": "uint256", | |
"name": "collateral", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "maturation", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "maxLenderDelay", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "post", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "pre", | |
"type": "uint256" | |
} | |
], | |
"internalType": "struct ReachContract.T0", | |
"name": "v9", | |
"type": "tuple" | |
} | |
], | |
"internalType": "struct ReachContract.a1msg", | |
"name": "msg", | |
"type": "tuple" | |
} | |
], | |
"internalType": "struct ReachContract.a1", | |
"name": "_a", | |
"type": "tuple" | |
} | |
], | |
"name": "m1", | |
"outputs": [], | |
"stateMutability": "payable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"components": [ | |
{ | |
"components": [ | |
{ | |
"internalType": "uint256", | |
"name": "v17", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v16", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "address payable", | |
"name": "v8", | |
"type": "address" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v11", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v19", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v20", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v21", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v22", | |
"type": "uint256" | |
} | |
], | |
"internalType": "struct ReachContract.a1postsvs", | |
"name": "svs", | |
"type": "tuple" | |
} | |
], | |
"internalType": "struct ReachContract.a2", | |
"name": "_a", | |
"type": "tuple" | |
} | |
], | |
"name": "m2", | |
"outputs": [], | |
"stateMutability": "payable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"components": [ | |
{ | |
"components": [ | |
{ | |
"internalType": "uint256", | |
"name": "v66", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "address payable", | |
"name": "v8", | |
"type": "address" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v11", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v61", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "address payable", | |
"name": "v54", | |
"type": "address" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v20", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v21", | |
"type": "uint256" | |
} | |
], | |
"internalType": "struct ReachContract.a2postsvs", | |
"name": "svs", | |
"type": "tuple" | |
} | |
], | |
"internalType": "struct ReachContract.a3", | |
"name": "_a", | |
"type": "tuple" | |
} | |
], | |
"name": "m3", | |
"outputs": [], | |
"stateMutability": "payable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"components": [ | |
{ | |
"components": [ | |
{ | |
"internalType": "uint256", | |
"name": "v66", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "address payable", | |
"name": "v8", | |
"type": "address" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v11", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v61", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "address payable", | |
"name": "v54", | |
"type": "address" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v20", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v21", | |
"type": "uint256" | |
} | |
], | |
"internalType": "struct ReachContract.a2postsvs", | |
"name": "svs", | |
"type": "tuple" | |
} | |
], | |
"internalType": "struct ReachContract.a4", | |
"name": "_a", | |
"type": "tuple" | |
} | |
], | |
"name": "m4", | |
"outputs": [], | |
"stateMutability": "payable", | |
"type": "function" | |
}, | |
{ | |
"inputs": [ | |
{ | |
"components": [ | |
{ | |
"components": [ | |
{ | |
"internalType": "uint256", | |
"name": "v17", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v16", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "address payable", | |
"name": "v8", | |
"type": "address" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v11", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v19", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v20", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v21", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "v22", | |
"type": "uint256" | |
} | |
], | |
"internalType": "struct ReachContract.a1postsvs", | |
"name": "svs", | |
"type": "tuple" | |
} | |
], | |
"internalType": "struct ReachContract.a5", | |
"name": "_a", | |
"type": "tuple" | |
} | |
], | |
"name": "m5", | |
"outputs": [], | |
"stateMutability": "payable", | |
"type": "function" | |
} | |
]`, | |
Bytecode: `0x608060408190527f49ff028a829527a47ec6839c7147b484eccf5a2a94853eddac09cef44d9d4e9e90600090a161003461007a565b43815261003f61007a565b8151815260405161005790600090839060200161008d565b60408051601f1981840301815291905280516020909101206000555061009c9050565b6040518060200160405280600081525090565b91825251602082015260400190565b610b47806100ab6000396000f3fe60806040526004361061004a5760003560e01c80631016bf211461004f5780632a1899ab1461006457806337e6622614610077578063910f77e11461008a578063b85d68db1461009d575b600080fd5b61006261005d366004610888565b6100b0565b005b61006261007236600461085b565b610211565b61006261008536600461086c565b610372565b610062610098366004610888565b610502565b6100626100ab36600461086c565b610612565b6040516100c4906002908390602001610a53565b6040516020818303038152906040528051906020012060001c600054146100ea57600080fd5b6100fc60c08201356060830135610acc565b431061010757600080fd5b33610118604083016020840161083a565b6001600160a01b03161461012b57600080fd5b3460a08201351461013b57600080fd5b61014b60a082016080830161083a565b6040516001600160a01b03919091169060a083013580156108fc02916000818181858888f19350505050158015610186573d6000803e3d6000fd5b50610197604082016020830161083a565b604080516001600160a01b0392909216919083013580156108fc02916000818181858888f193505050501580156101d2573d6000803e3d6000fd5b507f679ffdad22a131bf64d9cd5060afdf3f2695c3f5abbd9a40fb065f68fb1cdbf68160405161020291906109b8565b60405180910390a16000805533ff5b6040516102259060009083906020016109c6565b6040516020818303038152906040528051906020012060001c6000541461024b57600080fd5b610253610722565b602080830135908201819052341461026a57600080fd5b610275346000610acc565b815260a0808301356040808401829052608080860135606080870182905292870135918601919091529085013592840192909252106102b357600080fd5b7ff97498a7844e37bcb0a53689353371875e956eb67010c6bcb423bdf0ab534acf826040516102e2919061095f565b60405180910390a16102f2610758565b43815281516020808301919091523360408084019190915281840151606080850191909152818501516080808601919091529085015160a0808601919091529085015160c085015284015160e084015251610352916001918491016109ea565b60408051601f198184030181529190528051602090910120600055505050565b6040516103869060019083906020016109d5565b6040516020818303038152906040528051906020012060001c600054146103ac57600080fd5b6103bb60e08201358235610acc565b43106103c657600080fd5b346080820135146103d657600080fd5b6103e6606082016040830161083a565b6040516001600160a01b039190911690608083013580156108fc02916000818181858888f19350505050158015610421573d6000803e3d6000fd5b507f3160f9d1da6f99178a8c2039a1f598788d8715e87634d1f90fba29f7c9009fb78160405161045191906109a3565b60405180910390a16104616107a6565b6080820135610474346020850135610acc565b61047e9190610ae4565b8152610490606083016040840161083a565b6001600160a01b0316602080830191909152606080840135604080850191909152439184019190915233608084015260a0808501359084015260c08085013590840152516104e391600291849101610a68565b60408051601f1981840301815291905280516020909101206000555050565b604051610516906002908390602001610a53565b6040516020818303038152906040528051906020012060001c6000541461053c57600080fd5b61054e60c08201356060830135610acc565b431015801561055b575060015b61056457600080fd5b3361057560a083016080840161083a565b6001600160a01b03161461058857600080fd5b341561059357600080fd5b6105a360a082016080830161083a565b6001600160a01b03166108fc6105ba348435610acc565b6040518115909202916000818181858888f193505050501580156105e2573d6000803e3d6000fd5b507fbfb9582fafa0fe7d7e414a03622948632b5595dbeaff289584ee1cbf829bd33f8160405161020291906109b8565b6040516106269060019083906020016109d5565b6040516020818303038152906040528051906020012060001c6000541461064c57600080fd5b61065b60e08201358235610acc565b4310158015610668575060015b61067157600080fd5b33610682606083016040840161083a565b6001600160a01b03161461069557600080fd5b34156106a057600080fd5b6106b0606082016040830161083a565b6001600160a01b03166108fc6106ca346020850135610acc565b6040518115909202916000818181858888f193505050501580156106f2573d6000803e3d6000fd5b507fe86ffb291a8833ab38307c55c4ddb814164b0a6cb7e3b743a09a5941dcc375d08160405161020291906109a3565b6040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b604051806101000160405280600081526020016000815260200160006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081525090565b6040518060e001604052806000815260200160006001600160a01b03168152602001600081526020016000815260200160006001600160a01b0316815260200160008152602001600081525090565b80356001600160a01b038116811461080c57600080fd5b919050565b60006101008284031215610823578081fd5b50919050565b600060e08284031215610823578081fd5b60006020828403121561084b578081fd5b610854826107f5565b9392505050565b600060c08284031215610823578081fd5b6000610100828403121561087e578081fd5b6108548383610811565b600060e08284031215610899578081fd5b6108548383610829565b80358252602080820135908301526001600160a01b036108c5604083016107f5565b166040830152606081013560608301526080810135608083015260a081013560a083015260c081013560c083015260e081013560e08301525050565b80358252610911602082016107f5565b6001600160a01b038181166020850152604083810135908501526060808401359085015280610942608085016107f5565b166080850152505060a0818101359083015260c090810135910152565b600060c082019050823582526020830135602083015260408301356040830152606083013560608301526080830135608083015260a083013560a083015292915050565b61010081016109b282846108a3565b92915050565b60e081016109b28284610901565b91825235602082015260400190565b828152610120810161085460208301846108a3565b600061012082019050838252825160208301526020830151604083015260018060a01b03604084015116606083015260608301516080830152608083015160a083015260a083015160c083015260c083015160e083015260e08301516101008301529392505050565b82815261010081016108546020830184610901565b60006101008201905083825282516020830152602083015160018060a01b03808216604085015260408501516060850152606085015160808501528060808601511660a0850152505060a083015160c083015260c083015160e08301529392505050565b60008219821115610adf57610adf610afb565b500190565b600082821015610af657610af6610afb565b500390565b634e487b7160e01b600052601160045260246000fdfea264697066735822122027c58568b689ebc71674e1c85c5ba72f85c32c2d9b3e119c80ca9423b63f18d564736f6c63430008000033`, | |
deployMode: `DM_constructor` | |
}; | |
export const _Connectors = { | |
ALGO: _ALGO, | |
ETH: _ETH | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment