Whoops! 😨 Something unexpected happened...
[Error Code: 1101] error caused by: 1 error occurred:
* transaction execute failed: [Error Code: 1101] cadence runtime error: Execution failed:
error: cannot deploy invalid contract
--> 847131017925b6c20a516a21ae2c2e24e412d3009bfe020b5c752ee06e8f3a16:4:3
|
4 | signer.contracts.add(name: name, code: code.decodeHex() )
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: cannot find variable in this scope: `UFix64ToScaledUInt256`
--> 9829c926abe95d7c.SwapConfig:148:16
|
148 | let f = UFix64ToScaledUInt256(0.997);
| ^^^^^^^^^^^^^^^^^^^^^ not found in this scope
error: cannot find variable in this scope: `UFix64ToScaledUInt256`
--> 9829c926abe95d7c.SwapConfig:149:18
|
149 | let r1s = UFix64ToScaledUInt256(r1)
| ^^^^^^^^^^^^^^^^^^^^^ not found in this scope
error: cannot find variable in this scope: `UFix64ToScaledUInt256`
--> 9829c926abe95d7c.SwapConfig:150:18
|
150 | let r2s = UFix64ToScaledUInt256(r2)
| ^^^^^^^^^^^^^^^^^^^^^ not found in this scope
error: cannot find variable in this scope: `UFix64ToScaledUInt256`
--> 9829c926abe95d7c.SwapConfig:151:22
|
151 | let B = r1s * UFix64ToScaledUInt256(1.997) / f;
| ^^^^^^^^^^^^^^^^^^^^^ not found in this scope
error: cannot find variable in this scope: `UFix64ToScaledUInt256`
--> 9829c926abe95d7c.SwapConfig:153:29
|
153 | let C2 = r1s * r2s / UFix64ToScaledUInt256(t)
| ^^^^^^^^^^^^^^^^^^^^^ not found in this scope
error: cannot apply binary operation * to types: `Int`, `UInt256`
--> 9829c926abe95d7c.SwapConfig:154:46
|
154 | if (C1 < C2 || B * B / scaleFactor >= 4 * (C1-C2)*scaleFactor/f) {
| ^^^^^^^^^^^^^^^^^^^^^^^
error: cannot find variable in this scope: `sqrt`
--> 9829c926abe95d7c.SwapConfig:156:31
|
156 | if (C1 < C2) { D = sqrt(B * B / scaleFactor + 4 * (C2-C1)*scaleFactor/f) }
| ^^^^ not found in this scope
error: cannot apply binary operation * to types: `Int`, `UInt256`
--> 9829c926abe95d7c.SwapConfig:156:58
|
156 | if (C1 < C2) { D = sqrt(B * B / scaleFactor + 4 * (C2-C1)*scaleFactor/f) }
| ^^^^^^^^^^^^^^^^^^^^^^^
error: cannot find variable in this scope: `sqrt`
--> 9829c926abe95d7c.SwapConfig:157:23
|
157 | else { D = sqrt(B * B / scaleFactor - 4 * (C1-C2)*scaleFactor/f) }
| ^^^^ not found in this scope
error: cannot apply binary operation * to types: `Int`, `UInt256`
--> 9829c926abe95d7c.SwapConfig:157:50
|
157 | else { D = sqrt(B * B / scaleFactor - 4 * (C1-C2)*scaleFactor/f) }
| ^^^^^^^^^^^^^^^^^^^^^^^
error: cannot find variable in this scope: `ScaledUInt256ToUFix64`
--> 9829c926abe95d7c.SwapConfig:159:19
|
159 | return ScaledUInt256ToUFix64((D - B)/2)
| ^^^^^^^^^^^^^^^^^^^^^ not found in this scope