diff --git a/__mocks__/cairo/cairo2100/deployer.cairo.md b/__mocks__/cairo/cairo2100/deployer.cairo.md new file mode 100644 index 000000000..476a61061 --- /dev/null +++ b/__mocks__/cairo/cairo2100/deployer.cairo.md @@ -0,0 +1 @@ +Cairo source : https://github.com/OpenZeppelin/cairo-contracts/blob/v2.0.0/packages/presets/src/universal_deployer.cairo diff --git a/__mocks__/cairo/cairo2100/deployer.casm b/__mocks__/cairo/cairo2100/deployer.casm new file mode 100644 index 000000000..b56289510 --- /dev/null +++ b/__mocks__/cairo/cairo2100/deployer.casm @@ -0,0 +1,1714 @@ +{ + "bytecode": [ + "0xa0680017fff8000", + "0x7", + "0x482680017ffa8000", + "0xfffffffffffffffffffffffffffff3e4", + "0x400280007ff97fff", + "0x10780017fff7fff", + "0xfc", + "0x4825800180007ffa", + "0xc1c", + "0x400280007ff97fff", + "0x482680017ff98000", + "0x1", + "0x48127ffe7fff8000", + "0x48297ffc80007ffd", + "0x20680017fff7fff", + "0x4", + "0x10780017fff7fff", + "0xb", + "0x48127ffe7fff8000", + "0x482680017ffc8000", + "0x1", + "0x480a7ffd7fff8000", + "0x480680017fff8000", + "0x0", + "0x480280007ffc8000", + "0x10780017fff7fff", + "0x9", + "0x48127ffe7fff8000", + "0x480a7ffc7fff8000", + "0x480a7ffd7fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x20680017fff7ffe", + "0xd1", + "0x48127ffb7fff8000", + "0xa0680017fff8004", + "0xe", + "0x4824800180047ffd", + "0x800000000000000000000000000000000000000000000000000000000000000", + "0x484480017ffe8000", + "0x110000000000000000", + "0x48307ffe7fff8002", + "0x480080007ff37ffc", + "0x480080017ff27ffc", + "0x402480017ffb7ffd", + "0xffffffffffffffeeffffffffffffffff", + "0x400080027ff17ffd", + "0x10780017fff7fff", + "0xbc", + "0x484480017fff8001", + "0x8000000000000000000000000000000", + "0x48307fff80007ffc", + "0x480080007ff47ffd", + "0x480080017ff37ffd", + "0x402480017ffc7ffe", + "0xf8000000000000000000000000000000", + "0x400080027ff27ffe", + "0x482480017ff28000", + "0x3", + "0x48127ff97fff8000", + "0x48307ff480007ff5", + "0x20680017fff7fff", + "0x4", + "0x10780017fff7fff", + "0xa0", + "0x482480017ff38000", + "0x1", + "0x48127ff37fff8000", + "0x48127ffc7fff8000", + "0x480080007ff08000", + "0x48307ffc80007ffd", + "0x20680017fff7fff", + "0x4", + "0x10780017fff7fff", + "0x8a", + "0x480080007ffb8000", + "0x48127ffc7fff8000", + "0x482480017ff98000", + "0x1", + "0x48127ff97fff8000", + "0x20680017fff7ffc", + "0x7", + "0x48127ffd7fff8000", + "0x480680017fff8000", + "0x1", + "0x10780017fff7fff", + "0x6", + "0x482480017ffd8000", + "0x64", + "0x480680017fff8000", + "0x0", + "0x48127ff27fff8000", + "0x48127ffb7fff8000", + "0x48127ffb7fff8000", + "0x1104800180018000", + "0x1bc", + "0x20680017fff7ffa", + "0x69", + "0x48127fd57fff8000", + "0x20680017fff7ffc", + "0x5a", + "0x48127fff7fff8000", + "0x48307ff980007ffa", + "0x20680017fff7fff", + "0x4", + "0x10780017fff7fff", + "0xe", + "0x1104800180018000", + "0x25c", + "0x480a7ff87fff8000", + "0x48127fef7fff8000", + "0x482480017ff68000", + "0x55a", + "0x480a7ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x208b7fff7fff7ffe", + "0x1104800180018000", + "0x3ad", + "0x482480017fff8000", + "0x3ac", + "0x48127ffb7fff8000", + "0x480080007ffe8000", + "0x480080007fff8000", + "0x482480017fff8000", + "0xac8a", + "0xa0680017fff8000", + "0x8", + "0x48307ffe80007ffb", + "0x482480017fff8000", + "0x100000000000000000000000000000000", + "0x400080007fec7fff", + "0x10780017fff7fff", + "0x2b", + "0x48307ffe80007ffb", + "0x400080007fed7fff", + "0x480680017fff8000", + "0x1", + "0x482480017fec8000", + "0x1", + "0x48127ffd7fff8000", + "0x480a7ff87fff8000", + "0x480a7ffb7fff8000", + "0x48127fb17fff8000", + "0x48127fbd7fff8000", + "0x48307fc380007ff9", + "0x48127fea7fff8000", + "0x48127fea7fff8000", + "0x1104800180018000", + "0x23a", + "0x20680017fff7ffd", + "0xf", + "0x40780017fff7fff", + "0x1", + "0x400080007fff7ffe", + "0x48127ffa7fff8000", + "0x48127ff77fff8000", + "0x48127ff77fff8000", + "0x48127ff87fff8000", + "0x480680017fff8000", + "0x0", + "0x48127ffa7fff8000", + "0x482480017ff98000", + "0x1", + "0x208b7fff7fff7ffe", + "0x48127ffb7fff8000", + "0x48127ff87fff8000", + "0x482480017ff88000", + "0xc8", + "0x48127ff97fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x208b7fff7fff7ffe", + "0x1104800180018000", + "0x2cd", + "0x480a7ff87fff8000", + "0x482480017fe58000", + "0x1", + "0x48127ff17fff8000", + "0x480a7ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x208b7fff7fff7ffe", + "0x1104800180018000", + "0x2ca", + "0x480a7ff87fff8000", + "0x48127ff17fff8000", + "0x482480017ff78000", + "0x686", + "0x480a7ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x208b7fff7fff7ffe", + "0x480a7ff87fff8000", + "0x48127ff87fff8000", + "0x482480017fd38000", + "0xa0a", + "0x480a7ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x208b7fff7fff7ffe", + "0x1104800180018000", + "0x2bd", + "0x480a7ff87fff8000", + "0x48127ff17fff8000", + "0x482480017ff58000", + "0x1fb8", + "0x480a7ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x208b7fff7fff7ffe", + "0x1104800180018000", + "0x2ba", + "0x480a7ff87fff8000", + "0x48127ff67fff8000", + "0x482480017ff68000", + "0x2210", + "0x480a7ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x208b7fff7fff7ffe", + "0x482480017ff18000", + "0x3", + "0x482480017ff88000", + "0x2210", + "0x10780017fff7fff", + "0x5", + "0x48127ff87fff8000", + "0x482480017ffa8000", + "0x272e", + "0x1104800180018000", + "0x2ae", + "0x480a7ff87fff8000", + "0x48127ff77fff8000", + "0x48127ff77fff8000", + "0x480a7ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x208b7fff7fff7ffe", + "0x1104800180018000", + "0x27f", + "0x480a7ff87fff8000", + "0x482680017ff98000", + "0x1", + "0x482680017ffa8000", + "0x1fc2", + "0x480a7ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x208b7fff7fff7ffe", + "0xa0680017fff8000", + "0x7", + "0x482680017ffa8000", + "0xfffffffffffffffffffffffffffff3e4", + "0x400280007ff97fff", + "0x10780017fff7fff", + "0xfc", + "0x4825800180007ffa", + "0xc1c", + "0x400280007ff97fff", + "0x482680017ff98000", + "0x1", + "0x48127ffe7fff8000", + "0x48297ffc80007ffd", + "0x20680017fff7fff", + "0x4", + "0x10780017fff7fff", + "0xb", + "0x48127ffe7fff8000", + "0x482680017ffc8000", + "0x1", + "0x480a7ffd7fff8000", + "0x480680017fff8000", + "0x0", + "0x480280007ffc8000", + "0x10780017fff7fff", + "0x9", + "0x48127ffe7fff8000", + "0x480a7ffc7fff8000", + "0x480a7ffd7fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x20680017fff7ffe", + "0xd1", + "0x48127ffb7fff8000", + "0xa0680017fff8004", + "0xe", + "0x4824800180047ffd", + "0x800000000000000000000000000000000000000000000000000000000000000", + "0x484480017ffe8000", + "0x110000000000000000", + "0x48307ffe7fff8002", + "0x480080007ff37ffc", + "0x480080017ff27ffc", + "0x402480017ffb7ffd", + "0xffffffffffffffeeffffffffffffffff", + "0x400080027ff17ffd", + "0x10780017fff7fff", + "0xbc", + "0x484480017fff8001", + "0x8000000000000000000000000000000", + "0x48307fff80007ffc", + "0x480080007ff47ffd", + "0x480080017ff37ffd", + "0x402480017ffc7ffe", + "0xf8000000000000000000000000000000", + "0x400080027ff27ffe", + "0x482480017ff28000", + "0x3", + "0x48127ff97fff8000", + "0x48307ff480007ff5", + "0x20680017fff7fff", + "0x4", + "0x10780017fff7fff", + "0xa0", + "0x482480017ff38000", + "0x1", + "0x48127ff37fff8000", + "0x48127ffc7fff8000", + "0x480080007ff08000", + "0x48307ffc80007ffd", + "0x20680017fff7fff", + "0x4", + "0x10780017fff7fff", + "0x8a", + "0x480080007ffb8000", + "0x48127ffc7fff8000", + "0x482480017ff98000", + "0x1", + "0x48127ff97fff8000", + "0x20680017fff7ffc", + "0x7", + "0x48127ffd7fff8000", + "0x480680017fff8000", + "0x1", + "0x10780017fff7fff", + "0x6", + "0x482480017ffd8000", + "0x64", + "0x480680017fff8000", + "0x0", + "0x48127ff27fff8000", + "0x48127ffb7fff8000", + "0x48127ffb7fff8000", + "0x1104800180018000", + "0xae", + "0x20680017fff7ffa", + "0x69", + "0x48127fd57fff8000", + "0x20680017fff7ffc", + "0x5a", + "0x48127fff7fff8000", + "0x48307ff980007ffa", + "0x20680017fff7fff", + "0x4", + "0x10780017fff7fff", + "0xe", + "0x1104800180018000", + "0x14e", + "0x480a7ff87fff8000", + "0x48127fef7fff8000", + "0x482480017ff68000", + "0x55a", + "0x480a7ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x208b7fff7fff7ffe", + "0x1104800180018000", + "0x29f", + "0x482480017fff8000", + "0x29e", + "0x48127ffb7fff8000", + "0x480080007ffe8000", + "0x480080007fff8000", + "0x482480017fff8000", + "0xac8a", + "0xa0680017fff8000", + "0x8", + "0x48307ffe80007ffb", + "0x482480017fff8000", + "0x100000000000000000000000000000000", + "0x400080007fec7fff", + "0x10780017fff7fff", + "0x2b", + "0x48307ffe80007ffb", + "0x400080007fed7fff", + "0x480680017fff8000", + "0x1", + "0x482480017fec8000", + "0x1", + "0x48127ffd7fff8000", + "0x480a7ff87fff8000", + "0x480a7ffb7fff8000", + "0x48127fb17fff8000", + "0x48127fbd7fff8000", + "0x48307fc380007ff9", + "0x48127fea7fff8000", + "0x48127fea7fff8000", + "0x1104800180018000", + "0x12c", + "0x20680017fff7ffd", + "0xf", + "0x40780017fff7fff", + "0x1", + "0x400080007fff7ffe", + "0x48127ffa7fff8000", + "0x48127ff77fff8000", + "0x48127ff77fff8000", + "0x48127ff87fff8000", + "0x480680017fff8000", + "0x0", + "0x48127ffa7fff8000", + "0x482480017ff98000", + "0x1", + "0x208b7fff7fff7ffe", + "0x48127ffb7fff8000", + "0x48127ff87fff8000", + "0x482480017ff88000", + "0xc8", + "0x48127ff97fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x208b7fff7fff7ffe", + "0x1104800180018000", + "0x1bf", + "0x480a7ff87fff8000", + "0x482480017fe58000", + "0x1", + "0x48127ff17fff8000", + "0x480a7ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x208b7fff7fff7ffe", + "0x1104800180018000", + "0x1bc", + "0x480a7ff87fff8000", + "0x48127ff17fff8000", + "0x482480017ff78000", + "0x686", + "0x480a7ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x208b7fff7fff7ffe", + "0x480a7ff87fff8000", + "0x48127ff87fff8000", + "0x482480017fd38000", + "0xa0a", + "0x480a7ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x208b7fff7fff7ffe", + "0x1104800180018000", + "0x1af", + "0x480a7ff87fff8000", + "0x48127ff17fff8000", + "0x482480017ff58000", + "0x1fb8", + "0x480a7ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x208b7fff7fff7ffe", + "0x1104800180018000", + "0x1ac", + "0x480a7ff87fff8000", + "0x48127ff67fff8000", + "0x482480017ff68000", + "0x2210", + "0x480a7ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x208b7fff7fff7ffe", + "0x482480017ff18000", + "0x3", + "0x482480017ff88000", + "0x2210", + "0x10780017fff7fff", + "0x5", + "0x48127ff87fff8000", + "0x482480017ffa8000", + "0x272e", + "0x1104800180018000", + "0x1a0", + "0x480a7ff87fff8000", + "0x48127ff77fff8000", + "0x48127ff77fff8000", + "0x480a7ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x208b7fff7fff7ffe", + "0x1104800180018000", + "0x171", + "0x480a7ff87fff8000", + "0x482680017ff98000", + "0x1", + "0x482680017ffa8000", + "0x1fc2", + "0x480a7ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x208b7fff7fff7ffe", + "0x48297ffc80007ffd", + "0x20680017fff7fff", + "0x4", + "0x10780017fff7fff", + "0xa", + "0x482680017ffc8000", + "0x1", + "0x480a7ffd7fff8000", + "0x480680017fff8000", + "0x0", + "0x480a7ffc7fff8000", + "0x10780017fff7fff", + "0x8", + "0x480a7ffc7fff8000", + "0x480a7ffd7fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x20680017fff7ffe", + "0x8c", + "0x480080007fff8000", + "0xa0680017fff8000", + "0x12", + "0x4824800180007ffe", + "0x100000000", + "0x4844800180008002", + "0x8000000000000110000000000000000", + "0x4830800080017ffe", + "0x480280007ffb7fff", + "0x482480017ffe8000", + "0xefffffffffffffde00000000ffffffff", + "0x480280017ffb7fff", + "0x400280027ffb7ffb", + "0x402480017fff7ffb", + "0xffffffffffffffffffffffffffffffff", + "0x20680017fff7fff", + "0x6c", + "0x402780017fff7fff", + "0x1", + "0x400280007ffb7ffe", + "0x482480017ffe8000", + "0xffffffffffffffffffffffff00000000", + "0x400280017ffb7fff", + "0x480680017fff8000", + "0x0", + "0x48307ff880007ff9", + "0x48307ffb7ffe8000", + "0xa0680017fff8000", + "0x8", + "0x482480017ffd8000", + "0x1", + "0x48307fff80007ffd", + "0x400280027ffb7fff", + "0x10780017fff7fff", + "0x49", + "0x48307ffe80007ffd", + "0x400280027ffb7fff", + "0x48307ff480007ff5", + "0x48307ffa7ff38000", + "0x48307ffb7ff28000", + "0x48307ff580017ffd", + "0xa0680017fff7fff", + "0x7", + "0x482480017fff8000", + "0x100000000000000000000000000000000", + "0x400280037ffb7fff", + "0x10780017fff7fff", + "0x2b", + "0x400280037ffb7fff", + "0x48307fef80007ff0", + "0x48307ffe7ff28000", + "0xa0680017fff8000", + "0x8", + "0x482480017ffd8000", + "0x1", + "0x48307fff80007ffd", + "0x400280047ffb7fff", + "0x10780017fff7fff", + "0x11", + "0x48307ffe80007ffd", + "0x400280047ffb7fff", + "0x40780017fff7fff", + "0x7", + "0x482680017ffb8000", + "0x5", + "0x480680017fff8000", + "0x0", + "0x48307fe67fe28000", + "0x48307ff37fe18000", + "0x480680017fff8000", + "0x0", + "0x48127fec7fff8000", + "0x48127fec7fff8000", + "0x208b7fff7fff7ffe", + "0x1104800180018000", + "0x132", + "0x482680017ffb8000", + "0x5", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x0", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x4", + "0x1104800180018000", + "0x12a", + "0x482680017ffb8000", + "0x4", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x0", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x9", + "0x1104800180018000", + "0x110", + "0x482680017ffb8000", + "0x3", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x0", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x10", + "0x482680017ffb8000", + "0x3", + "0x480680017fff8000", + "0x0", + "0x48127fe27fff8000", + "0x48127fe27fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x0", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x18", + "0x480a7ffb7fff8000", + "0x480680017fff8000", + "0x0", + "0x48127fe27fff8000", + "0x48127fe27fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x0", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x1", + "0x480680017fff8000", + "0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473", + "0x400080007ffe7fff", + "0x48127ffe7fff8000", + "0x482480017ffd8000", + "0x1", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x3", + "0x480680017fff8000", + "0x476574457865637574696f6e496e666f", + "0x400280007ff87fff", + "0x400380017ff87ff6", + "0x480280037ff88000", + "0x20680017fff7fff", + "0x94", + "0x480280027ff88000", + "0x480280047ff88000", + "0x482680017ff88000", + "0x5", + "0x48127ffd7fff8000", + "0x480080027ffd8000", + "0x20780017fff7ffb", + "0xf", + "0x1104800180018000", + "0x143", + "0x482480017fff8000", + "0x142", + "0x480080007fff8000", + "0x480080007fff8000", + "0x482480017fff8000", + "0x0", + "0x48307fff7ff88000", + "0x480a7ff77fff8000", + "0x480a7ffa7fff8000", + "0x10780017fff7fff", + "0xb", + "0x40780017fff7fff", + "0x6", + "0x400280007ff77ff9", + "0x400380017ff77ffa", + "0x482480017ff88000", + "0x154", + "0x482680017ff78000", + "0x3", + "0x480280027ff78000", + "0x480680017fff8000", + "0x1", + "0x48287ffb80007fff", + "0x40137ffc7fff8002", + "0x480680017fff8000", + "0x4465706c6f79", + "0x400080007ff17fff", + "0x400080017ff17ffa", + "0x400180027ff17ff9", + "0x400080037ff17ffc", + "0x400180047ff17ffc", + "0x400180057ff17ffd", + "0x400080067ff17ffe", + "0x480080087ff18000", + "0x20680017fff7fff", + "0x5a", + "0x480080077ff08000", + "0x40780017fff7fff", + "0x1", + "0x40780017fff7fff", + "0x1", + "0x400180097fed8001", + "0x480680017fff8000", + "0x0", + "0x480a80017fff8000", + "0x48127fed7fff8000", + "0x480a7ffb7fff8000", + "0x480a7ff97fff8000", + "0x480a7ffc7fff8000", + "0x480a7ffd7fff8000", + "0x480a7ffa7fff8000", + "0x48127ff57fff8000", + "0x480680017fff8000", + "0x26b160f10156dea0639bec90696772c640b9706a47f5b8c52ea1abe5858b34d", + "0x400080007ff47fff", + "0x480a7ff57fff8000", + "0x48127ffd7fff8000", + "0x48127ff57fff8000", + "0x48127ff57fff8000", + "0x48127ff57fff8000", + "0x48127ff57fff8000", + "0x48127ff57fff8000", + "0x48127ff57fff8000", + "0x48127ff57fff8000", + "0x48127feb7fff8000", + "0x482480017fea8000", + "0x1", + "0x48127fea7fff8000", + "0x48127fe97fff8000", + "0x402580017fd68000", + "0xc", + "0x1104800180018000", + "0x93", + "0x20680017fff7ffb", + "0x23", + "0x48127ffa7fff8000", + "0x480680017fff8000", + "0x456d69744576656e74", + "0x4002800080007fff", + "0x4002800180007ffe", + "0x4002800280007ffa", + "0x4002800380007ffb", + "0x4002800480007ffc", + "0x4002800580007ffd", + "0x4802800780008000", + "0x20680017fff7fff", + "0xf", + "0x4802800680008000", + "0x48127ff57fff8000", + "0x482480017ffe8000", + "0x1f4", + "0x480a80027fff8000", + "0x4826800180008000", + "0x8", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x0", + "0x480a80017fff8000", + "0x208b7fff7fff7ffe", + "0x4802800680008000", + "0x48127fff7fff8000", + "0x4826800180008000", + "0xa", + "0x4802800880008000", + "0x4802800980008000", + "0x10780017fff7fff", + "0x9", + "0x40780017fff7fff", + "0x4", + "0x482480017ff68000", + "0x2b34", + "0x480a80007fff8000", + "0x48127ff87fff8000", + "0x48127ff87fff8000", + "0x48127ff17fff8000", + "0x48127ffb7fff8000", + "0x480a80027fff8000", + "0x48127ffa7fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x208b7fff7fff7ffe", + "0x480080077ff08000", + "0x480a7ff57fff8000", + "0x482480017ffe8000", + "0x4b32", + "0x480a80027fff8000", + "0x482480017fec8000", + "0xb", + "0x480680017fff8000", + "0x1", + "0x480080097fea8000", + "0x4800800a7fe98000", + "0x208b7fff7fff7ffe", + "0x480280027ff88000", + "0x1104800180018000", + "0xb8", + "0x482480017fff8000", + "0xb7", + "0x480080007fff8000", + "0x480080007fff8000", + "0x482480017fff8000", + "0x7b34", + "0x480a7ff57fff8000", + "0x48307ffe7ff88000", + "0x480a7ff77fff8000", + "0x482680017ff88000", + "0x6", + "0x480680017fff8000", + "0x1", + "0x480280047ff88000", + "0x480280057ff88000", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x1", + "0x480680017fff8000", + "0x4f7574206f6620676173", + "0x400080007ffe7fff", + "0x48127ffe7fff8000", + "0x482480017ffd8000", + "0x1", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x1", + "0x480680017fff8000", + "0x4661696c656420746f20646573657269616c697a6520706172616d202334", + "0x400080007ffe7fff", + "0x48127ffe7fff8000", + "0x482480017ffd8000", + "0x1", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x1", + "0x480680017fff8000", + "0x4661696c656420746f20646573657269616c697a6520706172616d202333", + "0x400080007ffe7fff", + "0x48127ffe7fff8000", + "0x482480017ffd8000", + "0x1", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x1", + "0x480680017fff8000", + "0x4661696c656420746f20646573657269616c697a6520706172616d202332", + "0x400080007ffe7fff", + "0x48127ffe7fff8000", + "0x482480017ffd8000", + "0x1", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x1", + "0x480680017fff8000", + "0x4661696c656420746f20646573657269616c697a6520706172616d202331", + "0x400080007ffe7fff", + "0x48127ffe7fff8000", + "0x482480017ffd8000", + "0x1", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x1", + "0x480680017fff8000", + "0x496e646578206f7574206f6620626f756e6473", + "0x400080007ffe7fff", + "0x48127ffe7fff8000", + "0x482480017ffd8000", + "0x1", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x1", + "0x480680017fff8000", + "0x7533325f737562204f766572666c6f77", + "0x400080007ffe7fff", + "0x48127ffe7fff8000", + "0x482480017ffd8000", + "0x1", + "0x208b7fff7fff7ffe", + "0x400380007ffd7ff3", + "0x400380017ffd7ff4", + "0x480a7ffc7fff8000", + "0x482680017ffd8000", + "0x2", + "0x20780017fff7ff5", + "0x7", + "0x480a7ff27fff8000", + "0x480680017fff8000", + "0x0", + "0x10780017fff7fff", + "0x6", + "0x482680017ff28000", + "0x64", + "0x480680017fff8000", + "0x1", + "0x400080007ffd7fff", + "0x400180017ffd7ff6", + "0x48297ff780007ff8", + "0x400080027ffc7fff", + "0x480a7ff17fff8000", + "0x48127ffc7fff8000", + "0x480a7ff77fff8000", + "0x480a7ff87fff8000", + "0x48127ff77fff8000", + "0x482480017ff78000", + "0x3", + "0x1104800180018000", + "0x1b", + "0x20680017fff7ffd", + "0xd", + "0x400180007fff7ff9", + "0x48127ffb7fff8000", + "0x48127ffb7fff8000", + "0x480680017fff8000", + "0x0", + "0x480a7ffa7fff8000", + "0x480a7ffb7fff8000", + "0x48127ff97fff8000", + "0x482480017ff98000", + "0x1", + "0x208b7fff7fff7ffe", + "0x48127ffb7fff8000", + "0x482480017ffb8000", + "0x64", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x0", + "0x480680017fff8000", + "0x0", + "0x48127ff97fff8000", + "0x48127ff97fff8000", + "0x208b7fff7fff7ffe", + "0xa0680017fff8000", + "0x7", + "0x482680017ff98000", + "0xfffffffffffffffffffffffffffff916", + "0x400280007ff87fff", + "0x10780017fff7fff", + "0x22", + "0x4825800180007ff9", + "0x6ea", + "0x400280007ff87fff", + "0x482680017ff88000", + "0x1", + "0x48127ffe7fff8000", + "0x48297ffa80007ffb", + "0x20680017fff7fff", + "0x4", + "0x10780017fff7fff", + "0xf", + "0x480280007ffa8000", + "0x400280007ffd7fff", + "0x48127ffc7fff8000", + "0x48127ffc7fff8000", + "0x482680017ffa8000", + "0x1", + "0x480a7ffb7fff8000", + "0x480a7ffc7fff8000", + "0x482680017ffd8000", + "0x1", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffe5", + "0x208b7fff7fff7ffe", + "0x48127ffd7fff8000", + "0x482480017ffd8000", + "0x816", + "0x480680017fff8000", + "0x0", + "0x480a7ffc7fff8000", + "0x480a7ffd7fff8000", + "0x208b7fff7fff7ffe", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff65", + "0x482680017ff88000", + "0x1", + "0x480a7ff97fff8000", + "0x480680017fff8000", + "0x1", + "0x48127ffb7fff8000", + "0x48127ffb7fff8000", + "0x208b7fff7fff7ffe" + ], + "bytecode_segment_lengths": [ + 270, + 270, + 173, + 9, + 174, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 54, + 49 + ], + "compiler_version": "2.10.0", + "entry_points_by_type": { + "CONSTRUCTOR": [], + "EXTERNAL": [ + { + "builtins": [ + "pedersen", + "range_check" + ], + "offset": 270, + "selector": "0x1987cbd17808b9a23693d4de7e246a443cfe37e6e7fbaeabd7d7e6532b07c3d" + }, + { + "builtins": [ + "pedersen", + "range_check" + ], + "offset": 0, + "selector": "0x2730079d734ee55315f4f141eaed376bddd8c2133523d223a344c5604e0f7f8" + } + ], + "L1_HANDLER": [] + }, + "hints": [ + [ + 0, + [ + { + "TestLessThanOrEqual": { + "dst": { + "offset": 0, + "register": "AP" + }, + "lhs": { + "Immediate": "0xc1c" + }, + "rhs": { + "Deref": { + "offset": -6, + "register": "FP" + } + } + } + } + ] + ], + [ + 37, + [ + { + "TestLessThan": { + "dst": { + "offset": 4, + "register": "AP" + }, + "lhs": { + "Deref": { + "offset": -2, + "register": "AP" + } + }, + "rhs": { + "Immediate": "0x800000000000000000000000000000000000000000000000000000000000000" + } + } + } + ] + ], + [ + 41, + [ + { + "LinearSplit": { + "max_x": { + "Immediate": "0xffffffffffffffffffffffffffffffff" + }, + "scalar": { + "Immediate": "0x110000000000000000" + }, + "value": { + "Deref": { + "offset": 3, + "register": "AP" + } + }, + "x": { + "offset": -2, + "register": "AP" + }, + "y": { + "offset": -1, + "register": "AP" + } + } + } + ] + ], + [ + 51, + [ + { + "LinearSplit": { + "max_x": { + "Immediate": "0xffffffffffffffffffffffffffffffff" + }, + "scalar": { + "Immediate": "0x8000000000000000000000000000000" + }, + "value": { + "Deref": { + "offset": -3, + "register": "AP" + } + }, + "x": { + "offset": -1, + "register": "AP" + }, + "y": { + "offset": 0, + "register": "AP" + } + } + } + ] + ], + [ + 130, + [ + { + "TestLessThanOrEqual": { + "dst": { + "offset": 0, + "register": "AP" + }, + "lhs": { + "Deref": { + "offset": -1, + "register": "AP" + } + }, + "rhs": { + "Deref": { + "offset": -4, + "register": "AP" + } + } + } + } + ] + ], + [ + 156, + [ + { + "AllocSegment": { + "dst": { + "offset": 0, + "register": "AP" + } + } + } + ] + ], + [ + 270, + [ + { + "TestLessThanOrEqual": { + "dst": { + "offset": 0, + "register": "AP" + }, + "lhs": { + "Immediate": "0xc1c" + }, + "rhs": { + "Deref": { + "offset": -6, + "register": "FP" + } + } + } + } + ] + ], + [ + 307, + [ + { + "TestLessThan": { + "dst": { + "offset": 4, + "register": "AP" + }, + "lhs": { + "Deref": { + "offset": -2, + "register": "AP" + } + }, + "rhs": { + "Immediate": "0x800000000000000000000000000000000000000000000000000000000000000" + } + } + } + ] + ], + [ + 311, + [ + { + "LinearSplit": { + "max_x": { + "Immediate": "0xffffffffffffffffffffffffffffffff" + }, + "scalar": { + "Immediate": "0x110000000000000000" + }, + "value": { + "Deref": { + "offset": 3, + "register": "AP" + } + }, + "x": { + "offset": -2, + "register": "AP" + }, + "y": { + "offset": -1, + "register": "AP" + } + } + } + ] + ], + [ + 321, + [ + { + "LinearSplit": { + "max_x": { + "Immediate": "0xffffffffffffffffffffffffffffffff" + }, + "scalar": { + "Immediate": "0x8000000000000000000000000000000" + }, + "value": { + "Deref": { + "offset": -3, + "register": "AP" + } + }, + "x": { + "offset": -1, + "register": "AP" + }, + "y": { + "offset": 0, + "register": "AP" + } + } + } + ] + ], + [ + 400, + [ + { + "TestLessThanOrEqual": { + "dst": { + "offset": 0, + "register": "AP" + }, + "lhs": { + "Deref": { + "offset": -1, + "register": "AP" + } + }, + "rhs": { + "Deref": { + "offset": -4, + "register": "AP" + } + } + } + } + ] + ], + [ + 426, + [ + { + "AllocSegment": { + "dst": { + "offset": 0, + "register": "AP" + } + } + } + ] + ], + [ + 562, + [ + { + "TestLessThan": { + "dst": { + "offset": 0, + "register": "AP" + }, + "lhs": { + "BinOp": { + "a": { + "offset": -1, + "register": "AP" + }, + "b": { + "Immediate": "0x0" + }, + "op": "Add" + } + }, + "rhs": { + "Immediate": "0x100000000" + } + } + } + ] + ], + [ + 566, + [ + { + "LinearSplit": { + "max_x": { + "Immediate": "0xfffffffffffffffffffffffffffffffe" + }, + "scalar": { + "Immediate": "0x8000000000000110000000000000000" + }, + "value": { + "Deref": { + "offset": -1, + "register": "AP" + } + }, + "x": { + "offset": 0, + "register": "AP" + }, + "y": { + "offset": 1, + "register": "AP" + } + } + } + ] + ], + [ + 588, + [ + { + "TestLessThanOrEqual": { + "dst": { + "offset": 0, + "register": "AP" + }, + "lhs": { + "Deref": { + "offset": -1, + "register": "AP" + } + }, + "rhs": { + "Deref": { + "offset": -2, + "register": "AP" + } + } + } + } + ] + ], + [ + 602, + [ + { + "TestLessThan": { + "dst": { + "offset": -1, + "register": "AP" + }, + "lhs": { + "Deref": { + "offset": 0, + "register": "AP" + } + }, + "rhs": { + "Immediate": "0x100000000" + } + } + } + ] + ], + [ + 612, + [ + { + "TestLessThanOrEqual": { + "dst": { + "offset": 0, + "register": "AP" + }, + "lhs": { + "Deref": { + "offset": -1, + "register": "AP" + } + }, + "rhs": { + "Deref": { + "offset": -2, + "register": "AP" + } + } + } + } + ] + ], + [ + 713, + [ + { + "AllocSegment": { + "dst": { + "offset": 0, + "register": "AP" + } + } + } + ] + ], + [ + 728, + [ + { + "SystemCall": { + "system": { + "Deref": { + "offset": -8, + "register": "FP" + } + } + } + } + ] + ], + [ + 774, + [ + { + "SystemCall": { + "system": { + "Deref": { + "offset": -15, + "register": "AP" + } + } + } + } + ] + ], + [ + 778, + [ + { + "AllocSegment": { + "dst": { + "offset": 0, + "register": "AP" + } + } + } + ] + ], + [ + 780, + [ + { + "AllocSegment": { + "dst": { + "offset": 0, + "register": "AP" + } + } + } + ] + ], + [ + 825, + [ + { + "SystemCall": { + "system": { + "Deref": { + "offset": 0, + "register": "FP" + } + } + } + } + ] + ], + [ + 896, + [ + { + "AllocSegment": { + "dst": { + "offset": 0, + "register": "AP" + } + } + } + ] + ], + [ + 905, + [ + { + "AllocSegment": { + "dst": { + "offset": 0, + "register": "AP" + } + } + } + ] + ], + [ + 914, + [ + { + "AllocSegment": { + "dst": { + "offset": 0, + "register": "AP" + } + } + } + ] + ], + [ + 923, + [ + { + "AllocSegment": { + "dst": { + "offset": 0, + "register": "AP" + } + } + } + ] + ], + [ + 932, + [ + { + "AllocSegment": { + "dst": { + "offset": 0, + "register": "AP" + } + } + } + ] + ], + [ + 941, + [ + { + "AllocSegment": { + "dst": { + "offset": 0, + "register": "AP" + } + } + } + ] + ], + [ + 950, + [ + { + "AllocSegment": { + "dst": { + "offset": 0, + "register": "AP" + } + } + } + ] + ], + [ + 1013, + [ + { + "TestLessThanOrEqual": { + "dst": { + "offset": 0, + "register": "AP" + }, + "lhs": { + "Immediate": "0x6ea" + }, + "rhs": { + "Deref": { + "offset": -7, + "register": "FP" + } + } + } + } + ] + ] + ], + "prime": "0x800000000000011000000000000000000000000000000000000000000000001" +} \ No newline at end of file diff --git a/__mocks__/cairo/cairo2100/deployer.sierra.json b/__mocks__/cairo/cairo2100/deployer.sierra.json new file mode 100644 index 000000000..a6c441e3d --- /dev/null +++ b/__mocks__/cairo/cairo2100/deployer.sierra.json @@ -0,0 +1,819 @@ +{ + "abi": [ + { + "type": "impl", + "name": "UniversalDeployerImpl", + "interface_name": "openzeppelin_utils::deployments::interface::UniversalDeployerABI" + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "interface", + "name": "openzeppelin_utils::deployments::interface::UniversalDeployerABI", + "items": [ + { + "type": "function", + "name": "deploy_contract", + "inputs": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "salt", + "type": "core::felt252" + }, + { + "name": "not_from_zero", + "type": "core::bool" + }, + { + "name": "calldata", + "type": "core::array::Span::" + } + ], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "deployContract", + "inputs": [ + { + "name": "classHash", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "salt", + "type": "core::felt252" + }, + { + "name": "notFromZero", + "type": "core::bool" + }, + { + "name": "calldata", + "type": "core::array::Span::" + } + ], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "openzeppelin_presets::universal_deployer::UniversalDeployer::ContractDeployed", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "deployer", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "not_from_zero", + "type": "core::bool", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "calldata", + "type": "core::array::Span::", + "kind": "data" + }, + { + "name": "salt", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "openzeppelin_presets::universal_deployer::UniversalDeployer::Event", + "kind": "enum", + "variants": [ + { + "name": "ContractDeployed", + "type": "openzeppelin_presets::universal_deployer::UniversalDeployer::ContractDeployed", + "kind": "nested" + } + ] + } + ], + "contract_class_version": "0.1.0", + "entry_points_by_type": { + "CONSTRUCTOR": [], + "EXTERNAL": [ + { + "function_idx": 1, + "selector": "0x1987cbd17808b9a23693d4de7e246a443cfe37e6e7fbaeabd7d7e6532b07c3d" + }, + { + "function_idx": 0, + "selector": "0x2730079d734ee55315f4f141eaed376bddd8c2133523d223a344c5604e0f7f8" + } + ], + "L1_HANDLER": [] + }, + "sierra_program": [ + "0x1", + "0x7", + "0x0", + "0x2", + "0xb", + "0x4", + "0x147", + "0xb9", + "0x3e", + "0x52616e6765436865636b", + "0x800000000000000100000000000000000000000000000000", + "0x456e756d", + "0x800000000000000700000000000000000000000000000001", + "0x0", + "0x1e7cc030b6a62e51219c7055ff773a8dff8fb71637d893064207dc67ba74304", + "0x4172726179", + "0x800000000000000300000000000000000000000000000001", + "0x1", + "0x19", + "0x537472756374", + "0x800000000000000f00000000000000000000000000000001", + "0x2ee1e2b1b89f8c495f200e4956278a4d47395fe262f27b52e5865c9524c08c3", + "0x800000000000000300000000000000000000000000000003", + "0x2", + "0x3", + "0x16a4c8d7c05909052238a862d8cc3e7975bf05a07b3a69c6b28951083a6d672", + "0x5", + "0x74584e9f10ffb1a40aa5a3582e203f6758defc4a497d1a2d5a89f274a320e9", + "0x4", + "0x6", + "0x436f6e7374", + "0x800000000000000000000000000000000000000000000002", + "0x7533325f737562204f766572666c6f77", + "0x496e646578206f7574206f6620626f756e6473", + "0x4661696c656420746f20646573657269616c697a6520706172616d202331", + "0x4661696c656420746f20646573657269616c697a6520706172616d202332", + "0x4661696c656420746f20646573657269616c697a6520706172616d202333", + "0x4661696c656420746f20646573657269616c697a6520706172616d202334", + "0x4f7574206f6620676173", + "0x800000000000000300000000000000000000000000000004", + "0x104eb68e98232f2362ae8fd62c9465a5910d805fa88b305d1f7721b8727f04", + "0x11", + "0x26b160f10156dea0639bec90696772c640b9706a47f5b8c52ea1abe5858b34d", + "0x436f6e747261637441646472657373", + "0x800000000000000700000000000000000000000000000000", + "0x800000000000000700000000000000000000000000000003", + "0x3288d594b9a45d15bb2fcb7903f06cdb06b27f0ba88186ec4cfaa98307cb972", + "0x436c61737348617368", + "0x536e617073686f74", + "0x800000000000000700000000000000000000000000000002", + "0x1baeba72e79e9db2587cf44fedb2f3700b2075a5e8e39a562584862c4b71f62", + "0x17", + "0x66656c74323532", + "0x800000000000000700000000000000000000000000000007", + "0x338d16334c0a706762ef0d355ecb050a48247cf99a25c012de083e3cf0ea3ec", + "0x14", + "0x15", + "0x16", + "0x18", + "0xabd7a88fd677970dc688769a74ab341a2e1e229d10e8d3b1aee50c9246944e", + "0x1a", + "0x426f78", + "0x23", + "0x25", + "0x75313238", + "0x26", + "0x1f", + "0x1597b831feeb60c71f259624b79cf66995ea4f7e383403583674ab9c33b9cec", + "0x20", + "0x753332", + "0x80000000000000070000000000000000000000000000000e", + "0x348a62b7a38c0673e61e888d83a3ac1bf334ee7361a8514593d3d9532ed8b39", + "0x1e", + "0x21", + "0x22", + "0x753634", + "0x800000000000000700000000000000000000000000000004", + "0x3808c701a5d13e100ab11b6c02f91f752ecae7e420d21b56c90ec0a475cc7e5", + "0x24", + "0x3342418ef16b3e2799b906b1e4e89dbb9b111332dd44f72458ce44f9895b508", + "0x800000000000000700000000000000000000000000000006", + "0x7d4d99e9ed8d285b5c61b493cedb63976bc3d9da867933d829f49ce838b5e7", + "0x1d", + "0x1c", + "0x27", + "0x506564657273656e", + "0x556e696e697469616c697a6564", + "0x800000000000000200000000000000000000000000000001", + "0x29", + "0x53797374656d", + "0x2c", + "0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473", + "0x29d7d57c04a880978e7b3689f6218e507f3be17588744b58dc17762447ad0e7", + "0x30", + "0x1038fccf15d21489c6c5fde4ab0b72cb01c02bf8242be2b91673ec10fe4465f", + "0x33", + "0x33a29af9d9e7616713f5d76fbf2bc710ab5b2784a16ba7d30515dd65ef5143a", + "0x34", + "0x4275696c74696e436f737473", + "0x9931c641b913035ae674b400b61a51476d506bbe8bba2ff8a6272790aba9e6", + "0x32", + "0x1d49f7a4b277bf7b55a2664ce8cef5d6922b5ffb806b89644b9e0cdbbcac378", + "0x38", + "0x13fdd7105045794a99550ae1c4ac13faa62610dfab62c16422bfcf5803baa6e", + "0x39", + "0x4e6f6e5a65726f", + "0x11c6d8087e00642489f92d2821ad6ebd6532ad1a3b6d12833da6d6810391511", + "0x4761734275696c74696e", + "0xa5", + "0x7265766f6b655f61705f747261636b696e67", + "0x77697468647261775f676173", + "0x6272616e63685f616c69676e", + "0x72656465706f7369745f676173", + "0x7374727563745f6465636f6e737472756374", + "0x656e61626c655f61705f747261636b696e67", + "0x73746f72655f74656d70", + "0x3d", + "0x61727261795f736e617073686f745f706f705f66726f6e74", + "0x756e626f78", + "0x72656e616d65", + "0x656e756d5f696e6974", + "0x3c", + "0x6a756d70", + "0x7374727563745f636f6e737472756374", + "0x656e756d5f6d61746368", + "0x64697361626c655f61705f747261636b696e67", + "0x636c6173735f686173685f7472795f66726f6d5f66656c74323532", + "0x66656c743235325f69735f7a65726f", + "0x64726f70", + "0x3b", + "0x66756e6374696f6e5f63616c6c", + "0x3a", + "0x37", + "0x6765745f6275696c74696e5f636f737473", + "0x36", + "0x77697468647261775f6761735f616c6c", + "0x626f6f6c5f6e6f745f696d706c", + "0x35", + "0x61727261795f6e6577", + "0x636f6e74726163745f616464726573735f746f5f66656c74323532", + "0x61727261795f617070656e64", + "0x736e617073686f745f74616b65", + "0x7", + "0x8", + "0x9", + "0x31", + "0x647570", + "0x7533325f7472795f66726f6d5f66656c74323532", + "0x636f6e73745f61735f696d6d656469617465", + "0x2f", + "0x61727261795f736c696365", + "0x61727261795f6c656e", + "0x7533325f6f766572666c6f77696e675f737562", + "0xa", + "0xb", + "0x2e", + "0x616c6c6f635f6c6f63616c", + "0x66696e616c697a655f6c6f63616c73", + "0x6765745f657865637574696f6e5f696e666f5f76325f73797363616c6c", + "0x28", + "0x706564657273656e", + "0x73746f72655f6c6f63616c", + "0x6465706c6f795f73797363616c6c", + "0x1b", + "0x13", + "0xc", + "0x12", + "0x656d69745f6576656e745f73797363616c6c", + "0x2d", + "0x2b", + "0x2a", + "0x10", + "0xf", + "0xe", + "0xd", + "0x636c6173735f686173685f746f5f66656c74323532", + "0x7533325f746f5f66656c74323532", + "0x3c8", + "0xffffffffffffffff", + "0xee", + "0xdf", + "0xd9", + "0xcd", + "0xc0", + "0x44", + "0xb3", + "0xa3", + "0x3f", + "0x40", + "0x41", + "0x63", + "0x42", + "0x43", + "0x45", + "0x46", + "0x47", + "0x48", + "0x49", + "0x94", + "0x4a", + "0x4b", + "0x4c", + "0x4d", + "0x4e", + "0x4f", + "0x50", + "0x51", + "0x52", + "0x53", + "0x54", + "0x8b", + "0x55", + "0x56", + "0x57", + "0x58", + "0x59", + "0x5a", + "0x5b", + "0x5c", + "0x5d", + "0x5e", + "0x5f", + "0x60", + "0x61", + "0x62", + "0x64", + "0x65", + "0x66", + "0x67", + "0x68", + "0x69", + "0x6a", + "0x6b", + "0x6c", + "0x6d", + "0x6e", + "0x6f", + "0x70", + "0x71", + "0x72", + "0x73", + "0xe6", + "0x74", + "0x75", + "0x76", + "0x77", + "0x78", + "0x79", + "0x1e7", + "0x10b", + "0x112", + "0x1d8", + "0x1d2", + "0x1c6", + "0x1b9", + "0x136", + "0x13d", + "0x1ac", + "0x19c", + "0x15c", + "0x18d", + "0x184", + "0x1df", + "0x1f9", + "0x1fe", + "0x241", + "0x238", + "0x230", + "0x226", + "0x21f", + "0x2e9", + "0x271", + "0x27b", + "0x2d4", + "0x7a", + "0x7b", + "0x7c", + "0x2c1", + "0x7d", + "0x7e", + "0x2b8", + "0x7f", + "0x80", + "0x81", + "0x2ca", + "0x82", + "0x83", + "0x84", + "0x85", + "0x86", + "0x87", + "0x88", + "0x89", + "0x8a", + "0x8c", + "0x8d", + "0x8e", + "0x8f", + "0x90", + "0x91", + "0x92", + "0x35c", + "0x93", + "0x362", + "0x95", + "0x96", + "0x97", + "0x98", + "0x99", + "0x9a", + "0x396", + "0x9b", + "0x9c", + "0x9d", + "0x9e", + "0x9f", + "0xa0", + "0x3be", + "0x3b4", + "0xa1", + "0xa2", + "0xa4", + "0xf9", + "0x1f2", + "0x24b", + "0x253", + "0x2fd", + "0x305", + "0x30d", + "0x315", + "0x31d", + "0x325", + "0x32d", + "0x335", + "0x39f", + "0x21f2", + "0x440a0c05840120f048340a0e058340a0c058281208038180a04018080200", + "0x3c14090b858120f050242e160a8242809098141c03078242409068141c0b", + "0x5c2c1b0782812170b0681e0a0485c2c190782812170b0601e0a0485c2c05", + "0xc2009078241e09068143e0b0f03c14090b8583a0f050242e160e03c1409", + "0x105024138401210048980a250189046220782812170b0541221048800a0e", + "0xc1409190246209180245e09178245c051682c482c1582454051482c1e09", + "0xec0a29058e81204140e41208038907037048106a36048106a34048cc0a29", + "0x2480092082414090502414091902480091782414091f8147c0b120f47809", + "0x118120a0491c0a44058bc1246049181245029101624218c81242049081232", + "0x138a00927938044d260240835050245e091782496092502492052402c8009", + "0x94060a048106a050790812170b14c1e0a0485c2c520493c9c02288bc124f", + "0x141c0317824ae09068144a0b2b014180b190241a051482c20092a824a805", + "0x340a25058401232049740a2501854125c0496c0a0e01890b415049641258", + "0x1900463080241409310144a030502408610a824c0092f8141c032f0246409", + "0x1b81409049b4d809049ac0a09049ac0a6a190241269029a00a67029980a65", + "0x40120939814e47104824d62b04824d605079c4120f380281209378281209", + "0x1dc6409049ac6409049cc1409049ac0a76029d4e209049d0120f388241e70", + "0x24e80f08024f405078c0120f381e412093c0c01209358241e300483ce005", + "0x1e06009049e06409049e0aa09049e05609049e0bc09049d0c009049a4f609", + "0x24d65204824d65004824d609079f0120f3804020093d0c412093c0281209", + "0x2412740a040127a18824126b2b824127302a000a7f3f024126b029f4f809", + "0x3c12093c03c120942828120942015065704824f05904824d20a048250481", + "0x1e90c10049e82a10049e82009049e02410049e80a0f3e0241e702e0241273", + "0xac1209450241e890483ce08904824d60507a24120f3822020093d21c2009", + "0x240140904a3c140904a388409049ac840904a291a0904a300a8b448241274", + "0x3ce09108024f47b04824d605079ec120f381801209398141e5e0483ce005", + "0x1cc2409049cd260904a30120f2f0241e7049040127a2102412780483cf609", + "0x25c1209358152c054a94012094a0bc12094a14812094a0541209358541209", + "0x24126b18024128a17824127825824127825024127826024126926024126e", + "0x14012094c8c81209450c4120945015302f04825140a04825143004824e82f", + "0x24126b4d82412784d82412850283d3609079c06809049cc5e0904a640a9a", + "0x24e89d08024f45204825320f04824d63404824d69c04825189b04824e89b", + "0x1e02a09049a50209049ac0a0f408241e702c824127302a7c4209049a53c09", + "0x2518a30482518a204824f0a104824f0a004824f00907a04120f380481209", + "0x1a4680904a29220904a31240904a313a0904a314c0904a314a0904a314809", + "0x24de05538c4120937a1c1209462201209460c01209378bc1209378d01209", + "0x1ac0a0f4f0241e701082412730a024126943024127453040127a02aa06409", + "0x2181209358141e860483ce01404824e60907a78120f380d012093c2781209", + "0x21d0c0f55854240f5503c1e09078240a05550240a0502aa4120f430241e70", + "0x2a812050901522095502428090a0151009550242a09080140aaa048141e05", + "0x2793a9207aa81e9104a1c0a8804aa8128804a180a1204aa81212048540a05", + "0x2522055202554094e825100552825540944024200502aa81205078154c09", + "0x2a8129204a740a9e04aa812a504a180a2104aa812a304a480aa304aa812a4", + "0x251009080140aaa048141e05028281205528145e09550244209530153809", + "0x153c09550246009430145609550246209518146209550240aa4028c012aa", + "0x141409560c812aa078bc1221028bc12aa048ac12a602a7012aa04a98129d", + "0xd012aa048d01286028d012aa04a78121002815540902a780a05550240a0f", + "0x10012aa048d012100281554090283c0a4a04ab4969b07aa81e320903d3805", + "0x255c3c1d03d540f4e0250e05200255409200250c054d82554094d8242a05", + "0xe8129d028d812aa048f012880290812aa0490012100281554090283c0a41", + "0x3d540f1d0250e051b02554091b0245e05210255409210250c051d0255409", + "0x25c12aa048dc12880293012aa0490812100281554090283c0a3904abc6e46", + "0x1424055082554094b82522055102554092302460052802554091b0252205", + "0x28812aa04a8812310293012aa04930128602a8412aa04a84122f028155409", + "0x15480550025540926024200502aa8120507814a40936015540f508245605", + "0x2554094682414052a8255409500250c05468255409498246405498255409", + "0x25540926024200502aa81252048d00a05550240a0f02815600902a940a89", + "0x2414052a82554092e0250c052c82554092b82536052b825540902a900a5c", + "0x25449b0792c0aa204aa812a2048c40a9b04aa8129b048540a8904aa81259", + "0x2a81255048400a05550240a0f0297812b13e025540f3f02494053f2041eaa", + "0x1c412aa079e4123a0298012aa049801286029e4f60f55024f80920014c009", + "0x2180ab304aa8127b048500a0004aa81260048400a05550240a0f029b012b2", + "0x153c0502aa81205078156e095b2d5680f5503d6609438140009550240009", + "0x246c0502aa81271049080a05550256a09208140aaa04ad0123c028155409", + "0x157009550240009080140aaa0492c1237028155409280248c0502aa81289", + "0x2502090a8140a09550240a094b8157209550256009260156009550240a39", + "0x2e412aa04ae412a20284012aa04840125002ae012aa04ae0128602a0412aa", + "0x25540900024200502aa812b7048f00a05550240a0f02ae420b8408142409", + "0x4140055d82554095d824a4055d02554095d0250c055d825540902a840aba", + "0x24200502aa812054f0140aaa048141e05602fc1ebe5eaf01eaa07aed7481", + "0x2554095e0242a0561825540902a340ac204aa8128904a4c0ac104aa812bd", + "0x1540a1004aa81210049400a0504aa8120504a5c0ac104aa812c104a180abc", + "0x24e20918815840955025840905014a00955024a009178149609550249609", + "0x320125c02b218ec662b1024aa049c5845025b0c200560af11089029c412aa", + "0x2554090295c0acc04aa812c5048400a05550240a0f02b2c12ca64825540f", + "0x1f00ad004aa812cf049f80a05550259c09408159ece07aa812c9049640acd", + "0x34c123002815540969024c00569b481eaa04b44125e02b4412aa04b419a0f", + "0x255409630252e056b02554096a824f2056a82554096a024f6056a0255409", + "0x2880ac704aa812c7049400acc04aa812cc04a180ac404aa812c4048540ac6", + "0x35c12aa04b1412100281554090283c0ad663b3188c609025ac0955025ac09", + "0x250c05620255409620242a05630255409630252e056c0255409658249805", + "0x31daec46304812d804aa812d804a880ac704aa812c7049400ad704aa812d7", + "0x155409448246c0502aa81271049080a05550240a9e0281554090283c0ad8", + "0x2a81205388156c09550258009080140aaa0492c1237028155409280248c05", + "0x157e09550257e090a8140a09550240a094b815b40955025b20926015b209", + "0x2fc0a1204b6812aa04b6812a20284012aa04840125002ad812aa04ad81286", + "0x24f609210140aaa049b0126c02815540902a780a05550240a0f02b6820b6", + "0x1801210028155409258246e0502aa81250049180a055502512091b0140aaa", + "0x1412aa04814129702b7412aa04b70124c02b7012aa0481400056d8255409", + "0x25440508025540908024a0056d82554096d8250c05408255409408242a05", + "0x246e0502aa812054f0140aaa048141e056e841b6810284812dd04aa812dd", + "0x15bc0955024aa09080140aaa049401246028155409448246c0502aa8124b", + "0x378128602a0412aa04a0412150281412aa04814129702b7c12aa04978124c", + "0x37c20de4081424096f82554096f825440508025540908024a0056f0255409", + "0x1554091b0248c0502aa8124b048dc0a055502472091e0140aaa048141e05", + "0x14129702b8812aa04b84124c02b8412aa048156605700255409210242005", + "0x25540908024a005700255409700250c054d82554094d8242a05028255409", + "0x2482091e0140aaa048141e0571041c09b0284812e204aa812e204a880a10", + "0x24980572025540902ad00ae304aa81240048400a055502496091b8140aaa", + "0x2a812e304a180a9b04aa8129b048540a0504aa8120504a5c0ae504aa812e4", + "0x3c0ae50838d360509025ca0955025ca0951014200955024200928015c609", + "0x39c12aa04928121502b9812aa048d012100281554094e024780502aa81205", + "0x140aaa048153c0502aa81205078140ae9048154a05740255409730250c05", + "0x2a81212048540aea04aa8129e048400a055502538091e0140aaa04828126c", + "0x25c0aec04aa812eb049300aeb04aa812055a815d00955025d40943015ce09", + "0x24200928015d00955025d00943015ce0955025ce090a8140a09550240a09", + "0x24840502aa8120507815d8107439c0a1204bb012aa04bb012a20284012aa", + "0x3bc12aa04bb8124c02bb812aa04814e20576825540943824200502aa81214", + "0x24a005768255409768250c05430255409430242a05028255409028252e05", + "0x140aaa048140a0577841da860284812ef04aa812ef04a880a1004aa81210", + "0x22012aa0485412100281554090283c0a874303de0150903d540f078241e09", + "0x2510094301424095502424090a8140aaa0481424054882554090a0242805", + "0x2a81288048400a05550240a0f02a9812f14ea481eaa07a44128702a2012aa", + "0x144209550254609490154609550254809488154809550253a09440154a09", + "0x240aa5028bc12aa0488412a602a7012aa04a48129d02a7812aa04a941286", + "0xc412a3028c412aa04815480518025540944024200502aa81205078140af2", + "0x255409158254c054e0255409530253a054f0255409180250c05158255409", + "0x24200502aa812054f0140aaa048141e0505025e63204aa81e2f048840a2f", + "0x1494097a12d360f5503c641207a700a3404aa8123404a180a3404aa8129e", + "0x2a8124004a180a9b04aa8129b048540a4004aa81234048400a05550240a0f", + "0x25540920024200502aa812050781482097a8f0740f5503d3809438148009", + "0xbc0a4204aa8124204a180a3a04aa8123a04a740a3604aa8123c04a200a42", + "0x24200502aa812050781472097b0dc8c0f5503c7409438146c09550246c09", + "0x2a81246048c00a5004aa8123604a440a9704aa8123704a200a4c04aa81242", + "0x250c05508255409508245e0502aa81205090154209550252e09488154409", + "0x240a0f0294812f702aa81ea1048ac0aa204aa812a2048c40a4c04aa8124c", + "0x2180a8d04aa81293048c80a9304aa81205520154009550249809080140aaa", + "0x140aaa048141e0502be01205528151209550251a0905014aa09550254009", + "0x2a8125704a6c0a5704aa8120552014b809550249809080140aaa049481234", + "0x1536095502536090a815120955024b20905014aa0955024b80943014b209", + "0x25f27c04aa81e7e049280a7e4083d54095126c1e4b02a8812aa04a881231", + "0x250c053c9ec1eaa049f012400298012aa0495412100281554090283c0a5e", + "0x24c009080140aaa048141e0536025f47104aa81e79048e80a6004aa81260", + "0x2d01eaa07acc12870280012aa04800128602acc12aa049ec12140280012aa", + "0x2d412410281554095a024780502aa812054f0140aaa048141e055b825f6b5", + "0x246e0502aa81250049180a055502512091b0140aaa049c41242028155409", + "0x2e412aa04ac0124c02ac012aa0481472055c025540900024200502aa8124b", + "0x24a0055c02554095c0250c05408255409408242a05028255409028252e05", + "0x140aaa048141e055c84170810284812b904aa812b904a880a1004aa81210", + "0x2a812ba04a180abb04aa81205508157409550240009080140aaa04adc123c", + "0x3c0ac05f83df8bd5e03d540f5dae90210500157609550257609290157409", + "0x158409550251209498158209550257a09080140aaa048153c0502aa81205", + "0x240a094b81582095502582094301578095502578090a8158609550240a8d", + "0x14012aa04940122f0292c12aa0492c12550284012aa0484012500281412aa", + "0x308a04b618400ac15e2211205388255409388246205610255409610241405", + "0x140aaa048141e0565825fac904aa81ec8049700ac863b198ac4092a81271", + "0x338128102b3d9c0f5502592092c8159a09550240a5702b3012aa04b141210", + "0x3d540968824bc05688255409683341e7c02b4012aa04b3c127e028155409", + "0x1e40ad504aa812d4049ec0ad404aa812d3048c00a0555025a40930015a6d2", + "0x2598094301588095502588090a8158c09550258c094b815ac0955025aa09", + "0x15acc7663118c1204b5812aa04b5812a202b1c12aa04b1c125002b3012aa", + "0x2a812c604a5c0ad804aa812cb049300ad704aa812c5048400a05550240a0f", + "0x158e09550258e0928015ae0955025ae094301588095502588090a8158c09", + "0x140aaa048153c0502aa8120507815b0c76bb118c1204b6012aa04b6012a2", + "0x155409258246e0502aa81250049180a055502512091b0140aaa049c41242", + "0x14129702b6812aa04b64124c02b6412aa04814e2055b0255409600242005", + "0x25540908024a0055b02554095b0250c055f82554095f8242a05028255409", + "0x2a812054f0140aaa048141e056d0416cbf0284812da04aa812da04a880a10", + "0x24a009230140aaa04a2412360281554093d824840502aa8126c049b00a05", + "0x2498056e0255409028000adb04aa81260048400a055502496091b8140aaa", + "0x2a812db04a180a8104aa81281048540a0504aa8120504a5c0add04aa812dc", + "0x3c0add0836d020509025ba0955025ba0951014200955024200928015b609", + "0x248c0502aa81289048d80a055502496091b8140aaa048153c0502aa81205", + "0x255409028252e056f82554092f02498056f02554092a824200502aa81250", + "0x2880a1004aa81210049400ade04aa812de04a180a8104aa81281048540a05", + "0x140aaa048e4123c0281554090283c0adf08379020509025be0955025be09", + "0x25540902acc0ae004aa81242048400a05550246c09230140aaa0492c1237", + "0x2180a9b04aa8129b048540a0504aa8120504a5c0ae204aa812e1049300ae1", + "0x381360509025c40955025c40951014200955024200928015c00955025c009", + "0x248009080140aaa0492c123702815540920824780502aa8120507815c410", + "0x140a09550240a094b815ca0955025c80926015c809550240ab402b8c12aa", + "0x39412a20284012aa04840125002b8c12aa04b8c128602a6c12aa04a6c1215", + "0x24200502aa8129c048f00a05550240a0f02b9420e34d8142409728255409", + "0x15fc0902a940ae804aa812e604a180ae704aa8124a048540ae604aa81234", + "0x140aaa04a70123c02815540905024d80502aa812054f0140aaa048141e05", + "0x240ab502ba012aa04ba8128602b9c12aa04848121502ba812aa04a781210", + "0x39c12aa04b9c12150281412aa04814129702bb012aa04bac124c02bac12aa", + "0x14240976025540976025440508025540908024a005740255409740250c05", + "0x1c40aed04aa81287048400a05550242809210140aaa048141e0576041d0e7", + "0x2a81286048540a0504aa8120504a5c0aef04aa812ee049300aee04aa81205", + "0x25de0955025de0951014200955024200928015da0955025da09430150c09", + "0x1424097f850200f5503c1e09438141e095502412090a015de1076a180a12", + "0x2a8121504ae00a8604aa8121004a740a1504aa8121404adc0a05550240a0f", + "0x2a8128804ac00a8804aa81205520140aaa048141e0502c001205528150e09", + "0x2490c0f550250c095c8150e095502522095c0150c095502424094e8152209", + "0x2200a05550240a0f02a94130153025540f4382574054e8255409490246005", + "0x28c0a0f5d8154609550254609178154609550254809488154809550254c09", + "0x25540902af00a05550253a09210140aaa048141e054e026049e1083d540f", + "0xbc12aa048bc12bf028c53c0f550253c095e814608607aa8128604ae40a2f", + "0x2a8128604ae40a05550240a0f028281303190ac1eaa078c45e30108518005", + "0x2554094d8257e0525a781eaa04a7812bd02a6c12aa048d012c1028d10c0f", + "0x141e051e0e81f04201281eaa0792d362b083080a3204aa8123204a740a9b", + "0x24600502aa81205078146c0982908820f5503c809e4312828c0028155409", + "0x246e3907b100a3904aa81242048c00a3704aa8124604b0c0a4604aa81232", + "0x25c12aa04a5c12c60290412aa04904121502a5c12aa0493012c50293012aa", + "0x25900528025540902b1c0a055502464091e0140aaa048141e054b9041e09", + "0x3c0aa21b03c12a204aa812a204b180a3604aa81236048540aa204aa81250", + "0x3240a05550250c091e0140aaa048c8123c0281554091e025920502aa81205", + "0x2554091d0242a0529025540950825900550825540902b2c0a05550253c09", + "0x140aaa04a7812c90281554090283c0a521d03c125204aa8125204b180a3a", + "0x2a8120a048540a9304aa812a004b200aa004aa81205638140aaa04a18123c", + "0x15540943024780502aa8120507815260a078252609550252609630141409", + "0x258a054482554092aa741ec40295412aa04a3412cc02a3412aa048154805", + "0x3c0a5c4e03c125c04aa8125c04b180a9c04aa8129c048540a5c04aa81289", + "0x3300a5704aa81205520140aaa04a18123c02815540952824d80502aa81205", + "0x141215029f812aa04a0412c502a0412aa049653a0f62014b20955024ae09", + "0x240acd0281412aa04814ae053f0141e093f02554093f0258c05028255409", + "0x4012aa048159c05078255409048141e7c0282412aa04824122f0282412aa", + "0x24412aa04815a2050a024121404aa8121404b400a1404aa8120f0803d9e05", + "0x140aaa048153c0502aa812056a0154a09550240ad302a7412aa04815a405", + "0x2a812a404a180a05550240a0f028bd389e0841842a352041540f080241ed5", + "0x1462095502442096b81442095502442096b0146009550254809080154809", + "0x3680a055502464096c8140aaa048ac12b602a6c680a190ac24aa048c412d8", + "0x12d0c0f550250c096d8140aaa04814240502aa8129b049180a05550246809", + "0x25ba0505025540905025b805180255409180250c0551825540951824a005", + "0x2a81230048400a05550249409360140aaa048141e05200260e4a04aa81e4b", + "0x1042a0f550242a096f0154c09550241e094b8147809550247409430147409", + "0x15540920024d80502aa81205078140b08048154a05208255409208245e05", + "0x3780a4604aa81236049f80a360503d540905025be05210255409180242005", + "0x14780955024840943014983907aa812372303c20e0028dc2a0f550242a09", + "0x2526054ba181eaa04a1812db0290412aa04930122f02a9812aa048e41297", + "0x140120a02a850e0f550250e0971015441207aa8121204b840a5004aa81297", + "0x220a4145503ca0a120a89463c0ab900aa604aa812a65283dc605280255409", + "0x140aaa04a80124202815540902a780a05550240a0f029551a93084254092", + "0x2a812052b814b809550240a5702a2412aa0494812100294812aa049481286", + "0x490c0a2c855cc052ca481eaa04a4812df02a4812aa04a493a0f72814ae09", + "0x1f012ea02978f80f55024fc0974014fc09550250209738150209550242a87", + "0x2180a05550240a0f0298012aa0497812ec0297812aa0497812eb028155409", + "0x2a81279048bc0a7904aa8120576814f609550251209080151209550251209", + "0x1ec12aa049ec12860281412aa048141215029c412aa049e4b80f3e014f209", + "0x3e14052b82554092b825de0538825540938825de0530025540930025dc05", + "0x140aaa04814240559800d81055024ae71301ec0a12858151009550251091", + "0x261c055b825540900024200502aa81205078156a0986ad012aa07acc130c", + "0x2e8126002aed740f5502570092f0140aaa04ae4126c02ae560b8082a812b4", + "0x2fc12aa04aec12300281554095e024c0055eaf01eaa04ac0125e028155409", + "0x3041eaa07b017e885b8521e055b82554095b8250c056002554095e8246005", + "0x158209550258209430140aaa048153c0502aa81205078158ac46184220c2", + "0x242a05640255409638262405638255409490501f1102b1812aa04b041210", + "0x2a812c2049400aa604aa812a604a5c0ac604aa812c604a180a6c04aa8126c", + "0x24812da0281554090283c0ac8612998c6c090259009550259009898158409", + "0x159209550258609080158609550258609430140aaa048501281028155409", + "0x240aa502b3412aa04b1412ef02b3012aa04b10125002b2c12aa04b241286", + "0x240009080140aaa04850128102815540949025b40502aa81205078140b14", + "0x32c12aa04b381286028155409678262c056833c1eaa04ad4131502b3812aa", + "0x2a81205670140aaa048153c0566825540968025de0566025540944024a005", + "0x1b012aa049b0121502b4c12aa04b48131702b4812aa04b35a20f67815a209", + "0x26260566025540966024a005530255409530252e05658255409658250c05", + "0x24840502aa812054f0140aaa048141e0569b314ccb3604812d304aa812d3", + "0xdc0a055502414096d0140aaa0485012810281554090a8248c0502aa81287", + "0x140aaa04a74131902815540948826300502aa81286048d80a05550242409", + "0x155aa0f67815aa09550240ace02b5012aa04a4c121002a4c12aa04a4c1286", + "0x2554096a0250c05028255409028242a056b82554096b0262e056b0255409", + "0x4812d704aa812d704c4c0a8d04aa8128d049400aa604aa812a604a5c0ad4", + "0x4680a05550242a09230140aaa04a1c12420281554090283c0ad746a99a805", + "0x140aaa04a181236028155409090246e0502aa8121404a040a05550254a09", + "0x2a8129e048400a9e04aa8129e04a180a05550253a098c8140aaa04a441318", + "0x15b40955025b2098b815b209550245eb607b3c0ab604aa8120567015b009", + "0x27012500283c12aa0483c129702b6012aa04b6012860281412aa048141215", + "0x140a09550240a5702b69380f6c01424096d02554096d02626054e0255409", + "0x240ace0283c12aa048240a0f3e0141209550241209178141209550240b1b", + "0x240a570285012090a02554090a025a0050a0255409078401ecf0284012aa", + "0x3c12aa048240a0f3e0141209550241209178141209550240b1c0281412aa", + "0x5012090a02554090a025a0050a0255409078401ecf0284012aa048159c05", + "0x240a0f3e0141209550241209178141209550240b1d0281412aa04814ae05", + "0x2554090a025a0050a0255409078401ecf0284012aa048159c05078255409", + "0x141209550241209178141209550240aca0281412aa04814ae050a0241214", + "0x25a0050a0255409078401ecf0284012aa048159c05078255409048141e7c", + "0x241209178141209550240b1e0281412aa04814ae050a024121404aa81214", + "0x255409078401ecf0284012aa048159c05078255409048141e7c0282412aa", + "0x141209550240b1f0281412aa04814ae050a024121404aa8121404b400a14", + "0x401ecf0284012aa048159c05078255409048141e7c0282412aa04824122f", + "0x240b200281412aa04814ae050a024121404aa8121404b400a1404aa8120f", + "0x4012aa048159c05078255409048141e7c0282412aa04824122f0282412aa", + "0x140aaa048153c050a024121404aa8121404b400a1404aa8120f0803d9e05", + "0x2a8128604b680a9248a210e860a85554090902644050903c1eaa0483c1321", + "0x252409230140aaa04a441242028155409440246e0502aa81287048d80a05", + "0x29412aa04a98280f3e0154c09550253a093f0153a09550242a09918140aaa", + "0x2546096d014602f4e27842a30aaa812a404c880aa40783d5409078264205", + "0xc0124602815540917824840502aa8129c048dc0a05550253c091b0140aaa", + "0x25540915a941e7c028ac12aa048c4127e028c412aa048841323028155409", + "0xd012da028e8804a25a6c681555024140991014140f07aa8120f04c840a32", + "0x248c0502aa81240049080a055502494091b8140aaa04a6c12da028155409", + "0x146409550246409778140aaa0481424051e025540925826480502aa8123a", + "0x24121002815540920824d80502aa812050781484099290412aa078f012dd", + "0xe412aa04918122f028dc12aa048d812860291812aa048164c051b0255409", + "0x13012aa04824121002815540921024d80502aa81205078140b27048154a05", + "0x240a9e028e412aa04a5c122f028dc12aa04930128602a5c12aa048157c05", + "0x5554095102644055103c1eaa0483c13210294012aa048e4640f3e0140aaa", + "0x155409500246c0502aa8125204b680a055502542096d014aa8d49a80a4a1", + "0x251209948151209550252609940140aaa049541246028155409468248405", + "0x2a8125904c880a590783d54090782642052b82554092e1401e7c0297012aa", + "0x2a8127c048d80a0555024fc096d0140aaa04a0412da029ecc05e3e1f90215", + "0x2654053c9801eaa0498012e20281554093d8248c0502aa8125e048dc0a05", + "0x2a8120004cac0a0004aa8126c04b040a6c04aa81271048500a7104aa81279", + "0x2d412aa04980132a02ad012aa04accae0f3e0156609550256609178156609", + "0x25de055a82554095a82462051b82554091b8250c05028255409028242a05", + "0x4b972095503d60099681560b85b84154095a2d46e050a4b00ab404aa812b4", + "0x1b00abd5e03d54095c8265e055d82554095c024200502aa81205078157409", + "0x3680a05550257e096d01588c36130580bf0aaa8120f04c880a05550257a09", + "0x140aaa04b0c1242028155409610246e0502aa812c1048d80a05550258009", + "0x40213002b1c12aa04815480563025540962af01e7c02b1412aa04b101291", + "0x257609430156e09550256e090a8159209550259009988159009550258ec6", + "0x242009300140aaa048141e0564aed6e1004b2412aa04b24133202aec12aa", + "0x540acc04aa812ba04cd00acb04aa812b8048400a05550241e09998140aaa", + "0x33196b7080259809550259809990159609550259609430156e09550256e09", + "0x140aaa048141e05430541f35090501eaa078240a0f048140aaa048153c05", + "0x21c12860285012aa04850121502a2012aa0483c121402a1c12aa048481210", + "0x250e09080140aaa048141e054e8266c924883d540f440250e05438255409", + "0x29012aa04a90122f02a9012aa04a94129102a9412aa04a48128802a9812aa", + "0x2180a1404aa81214048540a2104aa81291048c00aa304aa812a40803cf805", + "0x2982814960154609550254609778144209550244209188154c09550254c09", + "0x140aaa04a74123c0281554090283c0a2f4e278200917a713c10550254621", + "0xac1338028ac12aa048c4200f9b8146209550240aa4028c012aa04a1c1210", + "0x255409190256405180255409180250c050a02554090a0242a05190255409", + "0x140aaa04840126002815540907824840502aa812050781464300a0401232", + "0x242a090a81536095502468099c8146809550240a710282812aa04a181210", + "0x14024a54d8282a1004a6c12aa04a6c12b20282812aa0482812860285412aa", + "0x148d80528048645236014a01202850200f04814f85236014a01219148d805", + "0xc4ae52281b00a889e05412059d8240a7b0283c640507ce82810078240a7c", + "0x4fc2a0902cf82a0902cf50e860a8482810078240a8129140d805090c8600a", + "0x401e0f1a1b00a12a20541205a18541205a10541205a08541205a00541205", + "0x518200f048150c6c028401e323601429450a0401e0902a78d805" + ] +} diff --git a/__tests__/account.test.ts b/__tests__/account.test.ts index 3d5807629..c5049c5a5 100644 --- a/__tests__/account.test.ts +++ b/__tests__/account.test.ts @@ -9,12 +9,12 @@ import { TransactionType, cairo, ec, - events, num, hash, stark, type Calldata, type InvokeTransactionReceiptResponse, + Deployer, } from '../src'; import { C1v2ClassHash, contracts, describeIfDevnet, erc20ClassHash } from './config/fixtures'; import { @@ -491,7 +491,9 @@ describe('deploy and test Account', () => { // check pre-calculated address const txReceipt = await provider.waitForTransaction(deployment.transaction_hash); - const udcEvent = events.parseUDCEvent(txReceipt.value as InvokeTransactionReceiptResponse); + const udcEvent = account.deployer.parseDeployerEvent( + txReceipt.value as InvokeTransactionReceiptResponse + ); expect(cleanHex(deployment.contract_address[0])).toBe(cleanHex(udcEvent.contract_address)); }); @@ -508,7 +510,9 @@ describe('deploy and test Account', () => { // check pre-calculated address const txReceipt = await provider.waitForTransaction(deployment.transaction_hash); - const udcEvent = events.parseUDCEvent(txReceipt.value as InvokeTransactionReceiptResponse); + const udcEvent = account.deployer.parseDeployerEvent( + txReceipt.value as InvokeTransactionReceiptResponse + ); expect(cleanHex(deployment.contract_address[0])).toBe(cleanHex(udcEvent.contract_address)); }); @@ -763,6 +767,32 @@ describe('deploy and test Account', () => { // innerInvokeEstFeeSpy.mockClear(); }); }); + describe('Custom Cairo 1 Deployer', () => { + let accountCustomDeployer: Account; + beforeAll(async () => { + const deployerResponse = await account.declareAndDeploy({ + contract: contracts.deployer.sierra, + casm: contracts.deployer.casm, + }); + const customDeployer = new Deployer( + deployerResponse.deploy.contract_address, + 'deploy_contract' + ); + accountCustomDeployer = new Account({ + address: account.address, + provider, + signer: account.signer, + deployer: customDeployer, + }); + }); + test('Deploy contract', async () => { + const deployResponse = await accountCustomDeployer.deployContract({ + classHash: erc20ClassHash, + constructorCalldata: erc20Constructor, + }); + expect(deployResponse).toMatchSchemaRef('DeployContractUDCResponse'); + }); + }); }); describe('unit', () => { diff --git a/__tests__/cairo1v2_typed.test.ts b/__tests__/cairo1v2_typed.test.ts index 3b79367ab..861ce3c8e 100644 --- a/__tests__/cairo1v2_typed.test.ts +++ b/__tests__/cairo1v2_typed.test.ts @@ -12,7 +12,6 @@ import { Calldata, CompiledSierra, Contract, - DeclareDeployUDCResponse, ParsedEvents, ProviderInterface, RawArgsArray, @@ -26,6 +25,7 @@ import { selector, shortString, stark, + type DeclareDeployUDCResponse, } from '../src'; import { hexToDecimalString } from '../src/utils/num'; import { encodeShortString } from '../src/utils/shortString'; diff --git a/__tests__/config/fixtures.ts b/__tests__/config/fixtures.ts index 8f9398784..2bb980d34 100644 --- a/__tests__/config/fixtures.ts +++ b/__tests__/config/fixtures.ts @@ -71,6 +71,7 @@ const compiledContracts = { fixedArray: 'cairo292/fixed_array', TypeTransformation: 'cairo2114/contract', echo: 'cairo2114/echo', + deployer: 'cairo2100/deployer', }; export const contracts = mapContractSets(compiledContracts); diff --git a/__tests__/utils/events.test.ts b/__tests__/utils/events.test.ts index 2a8dc6be0..571e2ce46 100644 --- a/__tests__/utils/events.test.ts +++ b/__tests__/utils/events.test.ts @@ -1,15 +1,18 @@ -import type { - AbiEntry, - AbiEnums, - AbiEvent, - AbiStructs, - CairoEventVariant, - InvokeTransactionReceiptResponse, - RPC, +import { + type AbiEntry, + type AbiEnums, + type AbiEvent, + type AbiStructs, + type CairoEventVariant, + type InvokeTransactionReceiptResponse, + type RPC, + events, + legacyDeployer, } from '../../src'; -import { isAbiEvent, getAbiEvents, parseEvents, parseUDCEvent } from '../../src/utils/events'; import { getFunctionAbi, getInterfaceAbi, getAbiEntry } from '../factories/abi'; +const { isAbiEvent, getAbiEvents, parseEvents } = events; + const getBaseTxReceiptData = (): InvokeTransactionReceiptResponse => ({ type: 'INVOKE', transaction_hash: '0x6eebff0d931f36222268705ca791fd0de8d059eaf01887eecf1ce99a6c27f49', @@ -413,7 +416,7 @@ describe('parseUDCEvent', () => { ], }; - const parsedUDCEvent = parseUDCEvent(txReceipt); + const parsedUDCEvent = legacyDeployer.parseDeployerEvent(txReceipt); const result = { transaction_hash: '0x6eebff0d931f36222268705ca791fd0de8d059eaf01887eecf1ce99a6c27f49', contract_address: '0x1f1209f331cda3e84202f5495446028cd8730159ab24e08a5fd96125257673f', @@ -438,6 +441,8 @@ describe('parseUDCEvent', () => { events: [], }; - expect(() => parseUDCEvent(txReceipt)).toThrow(new Error('UDC emitted event is empty')); + expect(() => legacyDeployer.parseDeployerEvent(txReceipt)).toThrow( + new Error('Deployer emitted event is empty') + ); }); }); diff --git a/src/account/default.ts b/src/account/default.ts index 9aec7dbc3..fb1fe7402 100644 --- a/src/account/default.ts +++ b/src/account/default.ts @@ -4,7 +4,6 @@ import { SNIP9_V1_INTERFACE_ID, SNIP9_V2_INTERFACE_ID, SYSTEM_MESSAGES, - UDC, ZERO, } from '../global/constants'; import { logger } from '../global/logger'; @@ -61,9 +60,8 @@ import type { import { ETransactionType } from '../types/api'; import { CallData } from '../utils/calldata'; import { extractContractHashes, isSierra } from '../utils/contract'; -import { parseUDCEvent } from '../utils/events'; import { calculateContractAddressFromHash } from '../utils/hash'; -import { isHex, toBigInt, toCairoBool, toHex } from '../utils/num'; +import { isHex, toBigInt, toHex } from '../utils/num'; import { buildExecuteFromOutsideCall, getOutsideCall, @@ -79,13 +77,14 @@ import { toTransactionVersion, v3Details, } from '../utils/stark'; -import { buildUDCCall, getExecuteCalldata } from '../utils/transaction'; +import { getExecuteCalldata } from '../utils/transaction/transaction'; import { isString, isUndefined } from '../utils/typed'; import { getMessageHash } from '../utils/typedData'; import { type AccountInterface } from './interface'; import { defaultPaymaster, type PaymasterInterface, PaymasterRpc } from '../paymaster'; import { assertPaymasterTransactionSafety } from '../utils/paymaster'; import assert from '../utils/assert'; +import { defaultDeployer, Deployer } from '../deployer'; export class Account extends Provider implements AccountInterface { public signer: SignerInterface; @@ -98,6 +97,8 @@ export class Account extends Provider implements AccountInterface { public paymaster: PaymasterInterface; + public deployer: Deployer; + public defaultTipType: string; constructor(options: AccountOptions) { @@ -119,6 +120,7 @@ export class Account extends Provider implements AccountInterface { } this.transactionVersion = transactionVersion ?? config.get('transactionVersion'); this.paymaster = paymaster ? new PaymasterRpc(paymaster) : defaultPaymaster; + this.deployer = options.deployer ?? defaultDeployer; this.defaultTipType = defaultTipType ?? config.get('defaultTipType'); logger.debug('Account setup', { @@ -222,7 +224,7 @@ export class Account extends Provider implements AccountInterface { payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[], details: UniversalDetails = {} ): Promise { - const calls = this.buildUDCContractPayload(payload); + const { calls } = this.deployer.buildDeployerCall(payload, this.address); return this.estimateInvokeFee(calls, details); } @@ -400,7 +402,7 @@ export class Account extends Provider implements AccountInterface { payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[], details: UniversalDetails = {} ): Promise { - const { calls, addresses } = buildUDCCall(payload, this.address); + const { calls, addresses } = this.deployer.buildDeployerCall(payload, this.address); const invokeResponse = await this.execute(calls, details); return { @@ -415,7 +417,9 @@ export class Account extends Provider implements AccountInterface { ): Promise { const deployTx = await this.deploy(payload, details); const txReceipt = await this.waitForTransaction(deployTx.transaction_hash); - return parseUDCEvent(txReceipt as unknown as DeployTransactionReceiptResponse); + return this.deployer.parseDeployerEvent( + txReceipt as unknown as DeployTransactionReceiptResponse + ); } public async declareAndDeploy( @@ -784,33 +788,6 @@ export class Account extends Provider implements AccountInterface { }; } - public buildUDCContractPayload( - payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[] - ): Call[] { - const calls = [].concat(payload as []).map((it) => { - const { - classHash, - salt = '0', - unique = true, - constructorCalldata = [], - } = it as UniversalDeployerContractPayload; - const compiledConstructorCallData = CallData.compile(constructorCalldata); - - return { - contractAddress: UDC.ADDRESS, - entrypoint: UDC.ENTRYPOINT, - calldata: [ - classHash, - salt, - toCairoBool(unique), - compiledConstructorCallData.length, - ...compiledConstructorCallData, - ], - }; - }); - return calls; - } - public async accountInvocationsFactory( invocations: Invocations, details: AccountInvocationsFactoryDetails @@ -858,7 +835,7 @@ export class Account extends Provider implements AccountInterface { }; } if (transaction.type === ETransactionType.DEPLOY) { - const calls = this.buildUDCContractPayload(txPayload); + const { calls } = this.deployer.buildDeployerCall(txPayload, this.address); const payload = await this.buildInvocation(calls, signerDetails); return { ...common, diff --git a/src/account/interface.ts b/src/account/interface.ts index b3096b406..6c792a7da 100644 --- a/src/account/interface.ts +++ b/src/account/interface.ts @@ -118,8 +118,8 @@ export abstract class AccountInterface extends ProviderInterface { ): Promise; /** - * Estimate Fee for executing a UDC DEPLOY transaction on starknet - * This is different from the normal DEPLOY transaction as it goes through the Universal Deployer Contract (UDC) + * Estimate Fee for executing a Deployer DEPLOY transaction on starknet + * This is different from the normal DEPLOY transaction as it goes through a Deployer Contract * @param deployContractPayload array or singular * - classHash: computed class hash of compiled contract @@ -286,7 +286,7 @@ export abstract class AccountInterface extends ProviderInterface { ): Promise; /** - * Deploys a declared contract to starknet - using Universal Deployer Contract (UDC) + * Deploys a declared contract to starknet - using a Deployer Contract * support multicall * * @param payload - @@ -306,7 +306,7 @@ export abstract class AccountInterface extends ProviderInterface { ): Promise; /** - * Simplify deploy simulating old DeployContract with same response + UDC specific response + * Simplify deploy simulating old DeployContract with same response + Deployer specific response * Internal wait for L2 transaction, support multicall * * @param payload - @@ -333,7 +333,7 @@ export abstract class AccountInterface extends ProviderInterface { ): Promise; /** - * Declares and Deploy a given compiled contract (json) to starknet using UDC + * Declares and Deploy a given compiled contract (json) to starknet using a Deployer. * Internal wait for L2 transaction, do not support multicall * Method will pass even if contract is already declared (internal using DeclareIfNot) * diff --git a/src/account/types/index.type.ts b/src/account/types/index.type.ts index 3849222c4..da37d103f 100644 --- a/src/account/types/index.type.ts +++ b/src/account/types/index.type.ts @@ -20,7 +20,9 @@ import type { SignerInterface } from '../../signer'; import type { SupportedTransactionVersion } from '../../global/constants'; import type { PaymasterInterface } from '../../paymaster'; import type { ProviderInterface } from '../../provider/interface'; +import type { DeployerInterface } from '../../deployer'; import type { TipEstimate } from '../../utils/modules'; +import type { DeployContractUDCResponse } from '../../deployer/types/index.type'; /** * Configuration options for creating an Account instance @@ -38,6 +40,8 @@ export type AccountOptions = { transactionVersion?: SupportedTransactionVersion; /** Paymaster configuration for sponsored transactions (optional) */ paymaster?: PaymasterOptions | PaymasterInterface; + /** Use of a custom account deployer contract (optional) */ + deployer?: DeployerInterface; /** * Default tip type to use for sending transactions (optional) * @default 'recommendedTip' @@ -86,18 +90,6 @@ export type MultiDeployContractResponse = { transaction_hash: string; }; -export type DeployContractUDCResponse = { - contract_address: string; - transaction_hash: string; - address: string; - deployer: string; - unique: string; - classHash: string; - calldata_len: string; - calldata: Array; - salt: string; -}; - export type DeclareDeployUDCResponse = { declare: { class_hash: BigNumberish; diff --git a/src/contract/types/index.type.ts b/src/contract/types/index.type.ts index 23230d3de..90257b728 100644 --- a/src/contract/types/index.type.ts +++ b/src/contract/types/index.type.ts @@ -93,7 +93,7 @@ export type ExecuteOptions = Pick & { */ signature?: Signature; /** - * UDC salt + * Deployer contract salt */ salt?: string; } & Partial; diff --git a/src/deployer/default.ts b/src/deployer/default.ts new file mode 100644 index 000000000..a500b9ab1 --- /dev/null +++ b/src/deployer/default.ts @@ -0,0 +1,106 @@ +import { UDC } from '../global/constants'; +import { + ValidateType, + type BigNumberish, + type DeployContractUDCResponse, + type InvokeTransactionReceiptResponse, + type UniversalDeployerContractPayload, +} from '../types'; +import { CallData } from '../utils/calldata'; +import { starkCurve } from '../utils/ec'; +import { calculateContractAddressFromHash } from '../utils/hash'; +import { cleanHex, toCairoBool, toHex } from '../utils/num'; +import { randomAddress } from '../utils/stark'; +import { getCompiledCalldata } from '../utils/transaction/getCompiledCalldata'; +import type { DeployerInterface } from './interface'; +import type { DeployerCall } from './types/index.type'; + +export class Deployer implements DeployerInterface { + public readonly address: BigNumberish; + + public readonly entryPoint: string; + + constructor(address?: BigNumberish, entryPoint?: string) { + this.address = address ?? UDC.ADDRESS; + this.entryPoint = entryPoint ?? UDC.ENTRYPOINT; + } + + public buildDeployerCall( + payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[], + address: string + ): DeployerCall { + const params = [].concat(payload as []).map((it) => { + const { + classHash, + salt, + unique = true, // not_from_zero on v.2.0.0 but same function. When false v.1 address != v.2 address + constructorCalldata = [], + abi, + } = it as UniversalDeployerContractPayload; + + const compiledConstructorCallData = getCompiledCalldata(constructorCalldata, () => { + // compile with abi + if (abi) { + const calldataClass = new CallData(abi); + // Convert object based raw js arguments to ...args array + const rawArgs = Object.values(constructorCalldata); + calldataClass.validate(ValidateType.DEPLOY, 'constructor', rawArgs); + return calldataClass.compile('constructor', rawArgs); + } + // compile without abi + return CallData.compile(constructorCalldata); + }); + + const deploySalt = salt ?? randomAddress(); + + return { + call: { + contractAddress: toHex(this.address), + entrypoint: this.entryPoint, + calldata: [ + classHash, + deploySalt, + toCairoBool(unique), + compiledConstructorCallData.length, + ...compiledConstructorCallData, + ], + }, + address: calculateContractAddressFromHash( + unique ? starkCurve.pedersen(address, deploySalt) : deploySalt, + classHash, + compiledConstructorCallData, + unique ? this.address : 0 + ), + }; + }); + + return { + calls: params.map((it) => it.call), + addresses: params.map((it) => it.address), + }; + } + + public parseDeployerEvent( + txReceipt: InvokeTransactionReceiptResponse + ): DeployContractUDCResponse { + if (!txReceipt.events?.length) { + throw new Error('Deployer emitted event is empty'); + } + const event = txReceipt.events.find( + (it: any) => cleanHex(it.from_address) === cleanHex(toHex(this.address)) + ) || { + data: [], + }; + return { + transaction_hash: txReceipt.transaction_hash, + contract_address: event.data[0], + address: event.data[0], + deployer: event.data[1], + unique: event.data[2], + classHash: event.data[3], + calldata_len: event.data[4], + calldata: event.data.slice(5, 5 + parseInt(event.data[4], 16)), + salt: event.data[event.data.length - 1], + }; + } +} diff --git a/src/deployer/index.ts b/src/deployer/index.ts new file mode 100644 index 000000000..c1fb24db8 --- /dev/null +++ b/src/deployer/index.ts @@ -0,0 +1,7 @@ +import { LegacyUDC, UDC } from '../global/constants'; +import { Deployer } from './default'; + +export * from './default'; +export * from './interface'; +export const defaultDeployer = new Deployer(UDC.ADDRESS, UDC.ENTRYPOINT); +export const legacyDeployer = new Deployer(LegacyUDC.ADDRESS, LegacyUDC.ENTRYPOINT); diff --git a/src/deployer/interface.ts b/src/deployer/interface.ts new file mode 100644 index 000000000..007347a0a --- /dev/null +++ b/src/deployer/interface.ts @@ -0,0 +1,38 @@ +import type { + BigNumberish, + DeployContractUDCResponse, + InvokeTransactionReceiptResponse, + UniversalDeployerContractPayload, +} from '../types/index'; +import type { DeployerCall } from './types/index.type'; + +export abstract class DeployerInterface { + /** address of the deployer contract */ + abstract readonly address: BigNumberish; + + /** ascii name of the function that deploy a contract */ + abstract readonly entryPoint: string; + + /** + * Build a Deployer Call with payload and address + * @param {UniversalDeployerContractPayload | UniversalDeployerContractPayload[]} payload the payload data for the deployer Call. Can be a single payload object or an array of payload objects. + * @param {string} address the address to be used in the deployer Call + * @returns {DeployerCall} an object with Calls & addresses + */ + public abstract buildDeployerCall( + payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[], + address: string + ): DeployerCall; + + /** + * Parse Transaction Receipt Event from a Deployer contract transaction and + * create DeployContractResponse compatible response with addition of the Deployer Event data + * @param {InvokeTransactionReceiptResponse} txReceipt Transaction receipt + * @param {DeployerDefinition} deployer Deployer contract definition + * + * @returns {DeployContractUDCResponse} parsed Deployer event data + */ + public abstract parseDeployerEvent( + txReceipt: InvokeTransactionReceiptResponse + ): DeployContractUDCResponse; +} diff --git a/src/deployer/types/index.type.ts b/src/deployer/types/index.type.ts new file mode 100644 index 000000000..ca6b439f8 --- /dev/null +++ b/src/deployer/types/index.type.ts @@ -0,0 +1,23 @@ +import type { Call } from '../../types'; + +/** + * Interface for Deployer contract payload + */ +export type DeployerCall = { + /** an array of Call */ + calls: Call[]; + /** an array of addresses made of hex string */ + addresses: string[]; +}; + +export type DeployContractUDCResponse = { + contract_address: string; + transaction_hash: string; + address: string; + deployer: string; + unique: string; + classHash: string; + calldata_len: string; + calldata: Array; + salt: string; +}; diff --git a/src/global/constants.ts b/src/global/constants.ts index a5e368a8c..f433ea782 100644 --- a/src/global/constants.ts +++ b/src/global/constants.ts @@ -27,11 +27,16 @@ export const RANGE_FELT = range(ZERO, PRIME - 1n); export const RANGE_I128 = range(-(2n ** 127n), 2n ** 127n - 1n); export const RANGE_U128 = range(ZERO, 2n ** 128n - 1n); -export const UDC = { +export const LegacyUDC = { ADDRESS: '0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf', ENTRYPOINT: 'deployContract', } as const; +export const UDC = { + ADDRESS: '0x02ceed65a4bd731034c01113685c831b01c15d7d432f71afb1cf1634b53a2125', + ENTRYPOINT: 'deploy_contract', +} as const; + export const OutsideExecutionCallerAny = '0x414e595f43414c4c4552'; // encodeShortString('ANY_CALLER') export const SNIP9_V1_INTERFACE_ID = '0x68cfd18b92d1907b8ba3cc324900277f5a3622099431ea85dd8089255e4181'; diff --git a/src/index.ts b/src/index.ts index 17d70c462..3f8e1af35 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,8 +1,9 @@ /** - * Main + * Main Classes */ export * from './wallet'; export * from './account'; +export * from './deployer'; export * from './contract'; export * from './paymaster'; export * from './provider'; diff --git a/src/types/index.ts b/src/types/index.ts index 750f45323..343ec651c 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -10,5 +10,6 @@ export * from './signer'; export * from '../utils/transactionReceipt/transactionReceipt.type'; export * from './typedData'; export * from '../paymaster/types/index.type'; +export * from '../deployer/types/index.type'; export * as RPC from './api'; diff --git a/src/utils/events/index.ts b/src/utils/events/index.ts index 47f7699a4..e7b4b03eb 100644 --- a/src/utils/events/index.ts +++ b/src/utils/events/index.ts @@ -1,4 +1,3 @@ -import { UDC } from '../../global/constants'; import { Abi, AbiEnums, @@ -12,16 +11,13 @@ import { RPC, type CairoEventDefinition, type CairoEventVariant, - type InvokeTransactionReceiptResponse, type AbiEntry, - DeployContractUDCResponse, } from '../../types'; import assert from '../assert'; import { isCairo1Abi } from '../calldata/cairo'; import responseParser from '../calldata/responseParser'; import { starkCurve } from '../ec'; import { addHexPrefix, utf8ToArray } from '../encode'; -import { cleanHex } from '../num'; import { isUndefined, isObject } from '../typed'; /** @@ -254,34 +250,3 @@ export function parseEvents( }, [] as ParsedEvents); return ret; } - -/** - * Parse Transaction Receipt Event from UDC invoke transaction and - * create DeployContractResponse compatible response with addition of the UDC Event data - * @param {InvokeTransactionReceiptResponse} txReceipt - * - * @returns {DeployContractUDCResponse} parsed UDC event data - */ -export function parseUDCEvent( - txReceipt: InvokeTransactionReceiptResponse -): DeployContractUDCResponse { - if (!txReceipt.events?.length) { - throw new Error('UDC emitted event is empty'); - } - const event = txReceipt.events.find( - (it: any) => cleanHex(it.from_address) === cleanHex(UDC.ADDRESS) - ) || { - data: [], - }; - return { - transaction_hash: txReceipt.transaction_hash, - contract_address: event.data[0], - address: event.data[0], - deployer: event.data[1], - unique: event.data[2], - classHash: event.data[3], - calldata_len: event.data[4], - calldata: event.data.slice(5, 5 + parseInt(event.data[4], 16)), - salt: event.data[event.data.length - 1], - }; -} diff --git a/src/utils/transaction/getCompiledCalldata.ts b/src/utils/transaction/getCompiledCalldata.ts new file mode 100644 index 000000000..52f699672 --- /dev/null +++ b/src/utils/transaction/getCompiledCalldata.ts @@ -0,0 +1,17 @@ +import type { Calldata, RawArgs } from '../../types/lib'; + +/** + * Extract compiled calldata from args or execute callback + */ +export function getCompiledCalldata(constructorArguments: RawArgs, callback: Function): Calldata { + // Check if Calldata in args or args[0] else compile + if (Array.isArray(constructorArguments) && '__compiled__' in constructorArguments) + return constructorArguments as Calldata; + if ( + Array.isArray(constructorArguments) && + Array.isArray(constructorArguments[0]) && + '__compiled__' in constructorArguments[0] + ) + return constructorArguments[0] as Calldata; + return callback(); +} diff --git a/src/utils/transaction/index.ts b/src/utils/transaction/index.ts new file mode 100644 index 000000000..76ec07d36 --- /dev/null +++ b/src/utils/transaction/index.ts @@ -0,0 +1,2 @@ +export * from './getCompiledCalldata'; +export * from './transaction'; diff --git a/src/utils/transaction.ts b/src/utils/transaction/transaction.ts similarity index 63% rename from src/utils/transaction.ts rename to src/utils/transaction/transaction.ts index c55d057ff..52afacbe0 100644 --- a/src/utils/transaction.ts +++ b/src/utils/transaction/transaction.ts @@ -1,20 +1,8 @@ -import { UDC } from '../global/constants'; -import { ETransactionVersion } from '../provider/types/spec.type'; -import { - BigNumberish, - CairoVersion, - Call, - Calldata, - ParsedStruct, - RawArgs, - UniversalDeployerContractPayload, - ValidateType, -} from '../types'; -import { CallData } from './calldata'; -import { starkCurve } from './ec'; -import { calculateContractAddressFromHash, getSelectorFromName } from './hash'; -import { toBigInt, toCairoBool } from './num'; -import { randomAddress } from './stark'; +import { ETransactionVersion } from '../../provider/types/spec.type'; +import { BigNumberish, CairoVersion, Call, Calldata, ParsedStruct, RawArgs } from '../../types'; +import { CallData } from '../calldata'; +import { getSelectorFromName } from '../hash'; +import { toBigInt } from '../num'; /** * Transforms a list of Calls, each with their own calldata, into @@ -171,104 +159,6 @@ export const getExecuteCalldata = (calls: Call[], cairoVersion: CairoVersion = ' return fromCallsToExecuteCalldata(calls); }; -/** - * Extract compiled calldata from args or execute callback - */ -export function getCompiledCalldata(constructorArguments: RawArgs, callback: Function): Calldata { - // Check if Calldata in args or args[0] else compile - if (Array.isArray(constructorArguments) && '__compiled__' in constructorArguments) - return constructorArguments as Calldata; - if ( - Array.isArray(constructorArguments) && - Array.isArray(constructorArguments[0]) && - '__compiled__' in constructorArguments[0] - ) - return constructorArguments[0] as Calldata; - return callback(); -} - -/** - * Builds a UDCCall object. - * - * @param {UniversalDeployerContractPayload | UniversalDeployerContractPayload[]} payload the payload data for the UDCCall. Can be a single payload object or an array of payload objects. - * @param {string} address the address to be used in the UDCCall - * @returns { calls: Call[], addresses: string[] } the UDCCall object containing an array of calls and an array of addresses. - * @example - * ```typescript - * const payload: UniversalDeployerContractPayload = { - * classHash: "0x1234567890123456789012345678901234567890", - * salt: "0x0987654321098765432109876543210987654321", - * unique:true, - * constructorCalldata: [1, 2, 3] - * }; - * const address = "0xABCDEF1234567890ABCDEF1234567890ABCDEF12"; - * const result = transaction.buildUDCCall(payload, address); - * // result = { - * // calls: [ - * // { - * // contractAddress: "0xABCDEF1234567890ABCDEF1234567890ABCDEF12", - * // entrypoint: "functionName", - * // calldata: [classHash, salt, true, 3, 1, 2, 3] - * // }], - * // addresses: ["0x6fD084B56a7EDc5C06B3eB40f97Ae5A0C707A865"] - * // } - * ``` - */ -export function buildUDCCall( - payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[], - address: string -) { - const params = [].concat(payload as []).map((it) => { - const { - classHash, - salt, - unique = true, - constructorCalldata = [], - abi, - } = it as UniversalDeployerContractPayload; - - const compiledConstructorCallData = getCompiledCalldata(constructorCalldata, () => { - // compile with abi - if (abi) { - const calldataInstance = new CallData(abi); - // Convert object based raw js arguments to ...args array - const rawArgs = Object.values(constructorCalldata); - calldataInstance.validate(ValidateType.DEPLOY, 'constructor', rawArgs); - return calldataInstance.compile('constructor', rawArgs); - } - // compile without abi - return CallData.compile(constructorCalldata); - }); - - const deploySalt = salt ?? randomAddress(); - - return { - call: { - contractAddress: UDC.ADDRESS, - entrypoint: UDC.ENTRYPOINT, - calldata: [ - classHash, - deploySalt, - toCairoBool(unique), - compiledConstructorCallData.length, - ...compiledConstructorCallData, - ], - }, - address: calculateContractAddressFromHash( - unique ? starkCurve.pedersen(address, deploySalt) : deploySalt, - classHash, - compiledConstructorCallData, - unique ? UDC.ADDRESS : 0 - ), - }; - }); - - return { - calls: params.map((it) => it.call), - addresses: params.map((it) => it.address), - }; -} - /** * Return transaction versions based on version type, default version type is 'transaction'. * @param {'fee' | 'transaction'} [versionType] the type of version ("fee" or "transaction") diff --git a/src/wallet/account.ts b/src/wallet/account.ts index 6647d4e8e..f9b8d3e12 100644 --- a/src/wallet/account.ts +++ b/src/wallet/account.ts @@ -14,7 +14,6 @@ import type { } from '../types'; import { extractContractHashes } from '../utils/contract'; import { stringify } from '../utils/json'; -import { buildUDCCall } from '../utils/transaction'; import { addDeclareTransaction, addInvokeTransaction, @@ -141,7 +140,7 @@ export class WalletAccount extends Account implements AccountInterface { override async deploy( payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[] ): Promise { - const { calls, addresses } = buildUDCCall(payload, this.address); + const { calls, addresses } = this.deployer.buildDeployerCall(payload, this.address); const invokeResponse = await this.execute(calls); return { diff --git a/www/docs/guides/contracts/connect_contract.md b/www/docs/guides/contracts/connect_contract.md index d99d452e4..612a505c9 100644 --- a/www/docs/guides/contracts/connect_contract.md +++ b/www/docs/guides/contracts/connect_contract.md @@ -305,7 +305,6 @@ See our [TypeScript Integration Guide](./abi_typescript.md) for details. ## Best Practices 1. **ABI Management** - - Store ABIs locally instead of fetching from network - Use version control for ABI files - **Always update your local ABI when recompiling contracts**: