From ff10c719d8f2f6607aabd0b83cae17eaee35d678 Mon Sep 17 00:00:00 2001 From: rianhughes Date: Tue, 4 Jul 2023 11:35:06 +0300 Subject: [PATCH] Fix RPCv02 tests --- go.mod | 5 + go.sum | 15 + rpcv02/block_test.go | 191 +- rpcv02/call_test.go | 47 +- rpcv02/contract_test.go | 24 +- rpcv02/data_test.go | 279 - rpcv02/mock_test.go | 129 +- rpcv02/provider_test.go | 2 +- ...7cf0dafc8c188f80c3450615944a469428f7f.json | 6020 +++++++++++++++++ rpcv02/transaction.go | 41 +- rpcv02/transaction_test.go | 164 +- rpcv02/types_contract_test.go | 16 +- rpcv02/types_transaction.go | 18 + rpcv02/types_transaction_test.go | 54 +- rpcv02/write_test.go | 14 +- utils/Test.go | 30 + 16 files changed, 6578 insertions(+), 471 deletions(-) delete mode 100644 rpcv02/data_test.go create mode 100644 rpcv02/tests/0x1efa8f84fd4dff9e2902ec88717cf0dafc8c188f80c3450615944a469428f7f.json create mode 100644 utils/Test.go diff --git a/go.mod b/go.mod index d89c9dc5..d0abcbff 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,7 @@ require ( github.com/ethereum/go-ethereum v1.10.26 github.com/joho/godotenv v1.4.0 github.com/nsf/jsondiff v0.0.0-20210926074059-1e845ec5d249 + github.com/test-go/testify v1.1.4 github.com/urfave/cli/v2 v2.10.2 golang.org/x/crypto v0.2.0 ) @@ -16,18 +17,22 @@ require ( github.com/bits-and-blooms/bitset v1.7.0 // indirect github.com/consensys/gnark-crypto v0.11.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect github.com/deckarep/golang-set v1.8.0 // indirect github.com/fxamacker/cbor/v2 v2.4.0 // indirect github.com/go-ole/go-ole v1.2.1 // indirect github.com/go-stack/stack v1.8.0 // indirect github.com/gorilla/websocket v1.4.2 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect + github.com/stretchr/testify v1.8.1 // indirect github.com/tklauser/go-sysconf v0.3.5 // indirect github.com/tklauser/numcpus v0.2.2 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) require ( diff --git a/go.sum b/go.sum index e3b6fcf5..bd0a8883 100644 --- a/go.sum +++ b/go.sum @@ -8,7 +8,9 @@ github.com/consensys/gnark-crypto v0.11.0 h1:QqzHQlwEqlQr5jfWblGDkwlKHpT+4QodYqq github.com/consensys/gnark-crypto v0.11.0/go.mod h1:Iq/P3HHl0ElSjsg2E1gsMwhAyxnxoKK5nVyZKd+/KhU= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4= github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= github.com/ethereum/go-ethereum v1.10.26 h1:i/7d9RBBwiXCEuyduBQzJw/mKmnvzsN14jqBmytw72s= @@ -32,11 +34,20 @@ github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7 github.com/nsf/jsondiff v0.0.0-20210926074059-1e845ec5d249 h1:NHrXEjTNQY7P0Zfx1aMrNhpgxHmow66XQtm0aQLY0AE= github.com/nsf/jsondiff v0.0.0-20210926074059-1e845ec5d249/go.mod h1:mpRZBD8SJ55OIICQ3iWH0Yz3cjzA61JdqMLoWXeB2+8= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/test-go/testify v1.1.4 h1:Tf9lntrKUMHiXQ07qBScBTSA0dhYQlu83hswqelv1iE= +github.com/test-go/testify v1.1.4/go.mod h1:rH7cfJo/47vWGdi4GPj16x3/t1xGOj2YxzmNQzk2ghU= github.com/tklauser/go-sysconf v0.3.5 h1:uu3Xl4nkLzQfXNsWn15rPc/HQCJKObbt1dKJeWp3vU4= github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= github.com/tklauser/numcpus v0.2.2 h1:oyhllyrScuYI6g+h/zUvNXNp1wy7x8qQy3t/piefldA= @@ -54,6 +65,10 @@ golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df h1:5Pf6pFKu98ODmgnpvkJ3kFUOQGGLIzLIkbzUHp47618= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/rpcv02/block_test.go b/rpcv02/block_test.go index 12ff4bd1..52265de9 100644 --- a/rpcv02/block_test.go +++ b/rpcv02/block_test.go @@ -5,7 +5,8 @@ import ( "strings" "testing" - "github.com/NethermindEth/caigo/types" + "github.com/NethermindEth/caigo/utils" + "github.com/NethermindEth/juno/core/felt" "github.com/google/go-cmp/cmp" ) @@ -64,7 +65,7 @@ func TestBlockHashAndNumber(t *testing.T) { if blockHashAndNumber.BlockNumber < 3000 { t.Fatal("Block number should be > 3000, instead: ", blockHashAndNumber.BlockNumber) } - if !strings.HasPrefix(blockHashAndNumber.BlockHash, "0x") { + if !strings.HasPrefix(blockHashAndNumber.BlockHash.String(), "0x") { t.Fatal("current block hash should return a string starting with 0x") } } @@ -80,6 +81,41 @@ func TestBlockWithTxHashes(t *testing.T) { ExpectedBlockWithTxHashes Block } + var blockGoerli310370 = Block{ + BlockHeader: BlockHeader{ + BlockHash: utils.TestHexToFelt(t, "0x6c2fe3db009a2e008c2d65fca14204f3405cb74742fcf685f02473acaf70c72"), + ParentHash: utils.TestHexToFelt(t, "0x1ce6fa8ef59dfa1ad8f7ce7c3a4e6752e2d8ae6274f8257345f680e6ae0b5b5"), + SequencerAddress: utils.TestHexToFelt(t, "0x46a89ae102987331d369645031b49c27738ed096f2789c24449966da4c6de6b"), + BlockNumber: 310370, + NewRoot: utils.TestHexToFelt(t, "0x5cd7a08312635206c0210b8c90e61ceac27cb09629064e12266fd79e4c05a3d"), + Timestamp: 1661450764, + }, + Status: "ACCEPTED_ON_L1", + Transactions: []Transaction{ + TransactionHash{TransactionHash: utils.TestHexToFelt(t, "0x40c82f79dd2bc1953fc9b347a3e7ab40fe218ed5740bf4e120f74e8a3c9ac99")}, + TransactionHash{TransactionHash: utils.TestHexToFelt(t, "0x28981b14353a28bc46758dff412ac544d16f2ffc8dde31867855592ea054ab1")}, + TransactionHash{TransactionHash: utils.TestHexToFelt(t, "0x41176c650076712f1618a141fc1cf9a8c39f0d9548a3458f29cf363310a1e72")}, + TransactionHash{TransactionHash: utils.TestHexToFelt(t, "0x43cd66f3ddbfbf681ab99bb57bf9d94c83d6e9b586bdbde78ab2deb0328ebd5")}, + TransactionHash{TransactionHash: utils.TestHexToFelt(t, "0x7602cfebe4f3cb3ef4c8b8c6d7dda2efaf4a500723020066f5db50acd5095cd")}, + TransactionHash{TransactionHash: utils.TestHexToFelt(t, "0x2612f3f870ee7e7617d4f9efdc41fa8fd571f9720b059b1aa14c1bf15d3a92a")}, + TransactionHash{TransactionHash: utils.TestHexToFelt(t, "0x1a7810a6c68adf0621ed384d915409c936efa0c9d436683ea0cf7ea171719b")}, + TransactionHash{TransactionHash: utils.TestHexToFelt(t, "0x26683aeef3e9d9bcc1f0d45a5f0b67d0aa1919726524b2a8dc59504dacfd1f4")}, + TransactionHash{TransactionHash: utils.TestHexToFelt(t, "0x1d374aa073435cdde1ec1caf972f7c175fd23438bb220848e71720e00fd7474")}, + TransactionHash{TransactionHash: utils.TestHexToFelt(t, "0xfc13eabaa2f38981e68bb010370cad7a7d0b65a59101ec816042adca0d6841")}, + TransactionHash{TransactionHash: utils.TestHexToFelt(t, "0x672d007224128b99bcc145cd3dbd8930a944b6a5fff5c27e3b158a6ff701509")}, + TransactionHash{TransactionHash: utils.TestHexToFelt(t, "0x24795cbca6d2eba941082cea3f686bc86ef27dd46fdf84b32f9ba25bbeddb28")}, + TransactionHash{TransactionHash: utils.TestHexToFelt(t, "0x69281a4dd58c260a06b3266554c0cf1a4f19b79d8488efef2a1f003d67506ed")}, + TransactionHash{TransactionHash: utils.TestHexToFelt(t, "0x62211cc3c94d612b580eb729410e52277f838f962d91af91fb2b0526704c04d")}, + TransactionHash{TransactionHash: utils.TestHexToFelt(t, "0x5e4128b7680db32de4dff7bc57cb11c9f222752b1f875e84b29785b4c284e2a")}, + TransactionHash{TransactionHash: utils.TestHexToFelt(t, "0xdb8ad2b7d008fd2ad7fba4315b193032dee85e17346c80276a2e08c7f09f80")}, + TransactionHash{TransactionHash: utils.TestHexToFelt(t, "0x67b9541ca879abc29fa24a0fa070285d1899fc044159521c827f6b6aa09bbd6")}, + TransactionHash{TransactionHash: utils.TestHexToFelt(t, "0x5d9c0ab1d4ed6e9376c8ab45ee02b25dd0adced12941aafe8ce37369d19d9c2")}, + TransactionHash{TransactionHash: utils.TestHexToFelt(t, "0x4e52da53e23d92d9818908aeb104b007ea24d3cd4a5aa43144d2db1011e314f")}, + TransactionHash{TransactionHash: utils.TestHexToFelt(t, "0x6cc05f5ab469a3675acb5885c274d5143dca75dd9835c582f59e85ab0642d39")}, + TransactionHash{TransactionHash: utils.TestHexToFelt(t, "0x561ed983d1d9c37c964a96f80ccaf3de772e2b73106d6f49dd7c3f7ed8483d9")}, + }, + } + testSet := map[string][]testSetType{ "mock": {}, "testnet": { @@ -88,7 +124,7 @@ func TestBlockWithTxHashes(t *testing.T) { ExpectedError: nil, }, { - BlockID: WithBlockHash(types.StrToFelt("0x6c2fe3db009a2e008c2d65fca14204f3405cb74742fcf685f02473acaf70c72")), + BlockID: WithBlockHash(utils.TestHexToFelt(t, "0x6c2fe3db009a2e008c2d65fca14204f3405cb74742fcf685f02473acaf70c72")), ExpectedError: nil, ExpectedBlockWithTxHashes: blockGoerli310370, }, @@ -122,7 +158,7 @@ func TestBlockWithTxHashes(t *testing.T) { if len(block.Transactions) == 0 { t.Fatal("the number of transaction should not be 0") } - if test.ExpectedBlockWithTxHashes.BlockHash == types.StrToFelt("0x0") { + if test.ExpectedBlockWithTxHashes.BlockHash == &felt.Zero { continue } @@ -143,6 +179,51 @@ func TestBlockWithTxsAndInvokeTXNV0(t *testing.T) { LookupTxnPositionInExpected int want Block } + + var fullBlockGoerli310370 = Block{ + BlockHeader: BlockHeader{ + BlockHash: utils.TestHexToFelt(t, "0x6c2fe3db009a2e008c2d65fca14204f3405cb74742fcf685f02473acaf70c72"), + ParentHash: utils.TestHexToFelt(t, "0x1ce6fa8ef59dfa1ad8f7ce7c3a4e6752e2d8ae6274f8257345f680e6ae0b5b5"), + SequencerAddress: utils.TestHexToFelt(t, "0x46a89ae102987331d369645031b49c27738ed096f2789c24449966da4c6de6b"), + BlockNumber: 310370, + NewRoot: utils.TestHexToFelt(t, "0x5cd7a08312635206c0210b8c90e61ceac27cb09629064e12266fd79e4c05a3d"), + Timestamp: 1661450764, + }, + Status: "ACCEPTED_ON_L1", + Transactions: []Transaction{ + InvokeTxnV0{ + CommonTransaction: CommonTransaction{ + TransactionHash: utils.TestHexToFelt(t, "0x40c82f79dd2bc1953fc9b347a3e7ab40fe218ed5740bf4e120f74e8a3c9ac99"), + BroadcastedTxnCommonProperties: BroadcastedTxnCommonProperties{ + Type: "INVOKE", + MaxFee: utils.TestHexToFelt(t, "0xde0b6b3a7640000"), + Version: TransactionV0, + Signature: []*felt.Felt{ + utils.TestHexToFelt(t, "0x7bc0a22005a54ec6a005c1e89ab0201cbd0819621edd9fe4d5ef177a4ff33dd"), + utils.TestHexToFelt(t, "0x13089e5f38de4ea98e9275be7fadc915946be15c14a8fed7c55202818527bea"), + }, + Nonce: &felt.Zero, + }, + }, + FunctionCall: FunctionCall{ + ContractAddress: utils.TestHexToFelt(t, "0x2e28403d7ee5e337b7d456327433f003aa875c29631906908900058c83d8cb6"), + EntryPointSelector: utils.TestHexToFelt(t, "0x15d40a3d6ca2ac30f4031e42be28da9b056fef9bb7357ac5e85627ee876e5ad"), + Calldata: []*felt.Felt{ + utils.TestHexToFelt(t, "0x1"), + utils.TestHexToFelt(t, "0x33830ce413e4c096eef81b5e6ffa9b9f5d963f57b8cd63c9ae4c839c383c1a6"), + utils.TestHexToFelt(t, "0x2db698626ed7f60212e1ce6e99afb796b6b423d239c3f0ecef23e840685e866"), + utils.TestHexToFelt(t, "0x0"), + utils.TestHexToFelt(t, "0x2"), + utils.TestHexToFelt(t, "0x2"), + utils.TestHexToFelt(t, "0x61c6e7484657e5dc8b21677ffa33e4406c0600bba06d12cf1048fdaa55bdbc3"), + utils.TestHexToFelt(t, "0x6307b990"), + utils.TestHexToFelt(t, "0x2b81"), + }, + }, + }, + }, + } + testSet := map[string][]testSetType{ "mock": {}, "testnet": { @@ -151,7 +232,7 @@ func TestBlockWithTxsAndInvokeTXNV0(t *testing.T) { ExpectedError: nil, }, { - BlockID: WithBlockHash(types.StrToFelt("0x6c2fe3db009a2e008c2d65fca14204f3405cb74742fcf685f02473acaf70c72")), + BlockID: WithBlockHash(utils.TestHexToFelt(t, "0x6c2fe3db009a2e008c2d65fca14204f3405cb74742fcf685f02473acaf70c72")), ExpectedError: nil, want: fullBlockGoerli310370, }, @@ -189,7 +270,7 @@ func TestBlockWithTxsAndInvokeTXNV0(t *testing.T) { if len(blockWithTxs.Transactions) == 0 { t.Fatal("the number of transaction should not be 0") } - if test.want.BlockHash == types.StrToFelt("0x0") { + if test.want.BlockHash == &felt.Zero { continue } if !cmp.Equal(test.want.Transactions[test.LookupTxnPositionInExpected], blockWithTxs.Transactions[test.LookupTxnPositionInOriginal]) { @@ -209,6 +290,63 @@ func TestBlockWithTxsAndDeployOrDeclare(t *testing.T) { LookupTxnPositionInExpected int ExpectedBlockWithTxs Block } + + var fullBlockGoerli310843 = Block{ + BlockHeader: BlockHeader{ + BlockHash: utils.TestHexToFelt(t, "0x424fba26a7760b63895abe0c366c2d254cb47090c6f9e91ba2b3fa0824d4fc9"), + ParentHash: utils.TestHexToFelt(t, "0x30e34dedf00bb35a9076b2b0f50a5a74fd2501f62094b6e687277be6ef3d444"), + SequencerAddress: utils.TestHexToFelt(t, "0x46a89ae102987331d369645031b49c27738ed096f2789c24449966da4c6de6b"), + BlockNumber: 310843, + NewRoot: utils.TestHexToFelt(t, "0x32bd4ff21288c898d4d3b6a7aea4ebdb3f1c7089cd52bde98316b4ecb8a50be"), + Timestamp: 1661486036, + }, + Status: "ACCEPTED_ON_L1", + Transactions: []Transaction{ + DeployTxn{ + TransactionHash: utils.TestHexToFelt(t, "0x35bd2978d2061b3463498f83c09322ed6a82e4b2a188506525e272a7adcdf6a"), + ClassHash: utils.TestHexToFelt(t, "0x1ca349f9721a2bf05012bb475b404313c497ca7d6d5f80c03e98ff31e9867f5"), + DeployTransactionProperties: DeployTransactionProperties{ + ConstructorCalldata: []*felt.Felt{ + utils.TestHexToFelt(t, "0x31ad196615d50956d98be085eb1774624106a6936c7c38696e730d2a6df735a"), + utils.TestHexToFelt(t, "0x736affc32af71f8d361c855b38ffef58ec151bd8361a3b160017b90ada1068e"), + }, + ContractAddressSalt: utils.TestHexToFelt(t, "0x4241e90ee6a33a1e2e70b088f7e4acfb3d6630964c1a85e96fa96acd56dcfcf"), + + Type: "DEPLOY", + Version: TransactionV0, + }, + }, + }, + } + + var fullBlockGoerli300114 = Block{ + BlockHeader: BlockHeader{ + BlockHash: utils.TestHexToFelt(t, "0x184268bfbce24766fa53b65c9c8b30b295e145e8281d543a015b46308e27fdf"), + ParentHash: utils.TestHexToFelt(t, "0x7307cb0d7fa65c111e71cdfb6209bdc90d2454d4c0f34d8bf5a3fe477826c3c"), + SequencerAddress: utils.TestHexToFelt(t, "0x46a89ae102987331d369645031b49c27738ed096f2789c24449966da4c6de6b"), + BlockNumber: 300114, + NewRoot: utils.TestHexToFelt(t, "0x239a44410e78665f41f7a65ef3b5ed244ce411965498a83f80f904e22df1045"), + Timestamp: 1660701246, + }, + Status: "ACCEPTED_ON_L1", + Transactions: []Transaction{ + DeclareTxn{ + CommonTransaction: CommonTransaction{ + TransactionHash: utils.TestHexToFelt(t, "0x46a9f52a96b2d226407929e04cb02507e531f7c78b9196fc8c910351d8c33f3"), + BroadcastedTxnCommonProperties: BroadcastedTxnCommonProperties{ + Type: TransactionType_Declare, + MaxFee: &felt.Zero, + Version: TransactionV0, + Signature: []*felt.Felt{}, + Nonce: &felt.Zero, + }, + }, + ClassHash: utils.TestHexToFelt(t, "0x6feb117d1c3032b0ae7bd3b50cd8ec4a78c621dca0d63ddc17890b78a6c3b49"), + SenderAddress: utils.TestHexToFelt(t, "0x1"), + }, + }, + } + testSet := map[string][]testSetType{ "mock": {}, "testnet": { @@ -217,7 +355,7 @@ func TestBlockWithTxsAndDeployOrDeclare(t *testing.T) { ExpectedError: nil, }, { - BlockID: WithBlockHash(types.StrToFelt("0x424fba26a7760b63895abe0c366c2d254cb47090c6f9e91ba2b3fa0824d4fc9")), + BlockID: WithBlockHash(utils.TestHexToFelt(t, "0x424fba26a7760b63895abe0c366c2d254cb47090c6f9e91ba2b3fa0824d4fc9")), ExpectedError: nil, LookupTxnPositionInOriginal: 14, LookupTxnPositionInExpected: 0, @@ -269,7 +407,7 @@ func TestBlockWithTxsAndDeployOrDeclare(t *testing.T) { if len(blockWithTxs.Transactions) == 0 { t.Fatal("the number of transaction should not be 0") } - if test.ExpectedBlockWithTxs.BlockHash == types.StrToFelt("0x0") { + if test.ExpectedBlockWithTxs.BlockHash == &felt.Zero { continue } if !cmp.Equal(test.ExpectedBlockWithTxs.Transactions[test.LookupTxnPositionInExpected], blockWithTxs.Transactions[test.LookupTxnPositionInOriginal]) { @@ -398,19 +536,26 @@ func TestStateUpdate(t *testing.T) { BlockID BlockID ExpectedStateUpdateOutput StateUpdateOutput } + testSet := map[string][]testSetType{ "mock": { { BlockID: WithBlockNumber(300000), ExpectedStateUpdateOutput: StateUpdateOutput{ - BlockHash: types.StrToFelt("0x4f1cee281edb6cb31b9ba5a8530694b5527cf05c5ac6502decf3acb1d0cec4"), - NewRoot: "0x70677cda9269d47da3ff63bc87cf1c87d0ce167b05da295dc7fc68242b250b", - OldRoot: "0x19aa982a75263d4c4de4cc4c5d75c3dec32e00b95bef7bbb4d17762a0b138af", + BlockHash: utils.TestHexToFelt(t, "0x4f1cee281edb6cb31b9ba5a8530694b5527cf05c5ac6502decf3acb1d0cec4"), + NewRoot: utils.TestHexToFelt(t, "0x70677cda9269d47da3ff63bc87cf1c87d0ce167b05da295dc7fc68242b250b"), + OldRoot: utils.TestHexToFelt(t, "0x19aa982a75263d4c4de4cc4c5d75c3dec32e00b95bef7bbb4d17762a0b138af"), StateDiff: StateDiff{ StorageDiffs: []ContractStorageDiffItem{{ - Address: "0xe5cc6f2b6d34979184b88334eb64173fe4300cab46ecd3229633fcc45c83d4", - Key: "0x1813aac5f5e7799684c6dc33e51f44d3627fd748c800724a184ed5be09b713e", - Value: "0x630b4197", + Address: utils.TestHexToFelt(t, "0xe5cc6f2b6d34979184b88334eb64173fe4300cab46ecd3229633fcc45c83d4"), + StorageEntries: StorageEntries{ + StorageEntry: []StorageEntry{ + StorageEntry{ + Key: utils.TestHexToFelt(t, "0x1813aac5f5e7799684c6dc33e51f44d3627fd748c800724a184ed5be09b713e"), + Value: utils.TestHexToFelt(t, "0x630b4197"), + }, + }, + }, }}, }, }, @@ -420,14 +565,20 @@ func TestStateUpdate(t *testing.T) { { BlockID: WithBlockNumber(300000), ExpectedStateUpdateOutput: StateUpdateOutput{ - BlockHash: types.StrToFelt("0x03b6d94b246815960f38b7dffc53cda192e7d1dcfff61e1bc042fb57e95f8349"), - NewRoot: "0x70677cda9269d47da3ff63bc87cf1c87d0ce167b05da295dc7fc68242b250b", - OldRoot: "0x19aa982a75263d4c4de4cc4c5d75c3dec32e00b95bef7bbb4d17762a0b138af", + BlockHash: utils.TestHexToFelt(t, "0x03b6d94b246815960f38b7dffc53cda192e7d1dcfff61e1bc042fb57e95f8349"), + NewRoot: utils.TestHexToFelt(t, "0x70677cda9269d47da3ff63bc87cf1c87d0ce167b05da295dc7fc68242b250b"), + OldRoot: utils.TestHexToFelt(t, "0x19aa982a75263d4c4de4cc4c5d75c3dec32e00b95bef7bbb4d17762a0b138af"), StateDiff: StateDiff{ StorageDiffs: []ContractStorageDiffItem{{ - Address: "0xe5cc6f2b6d34979184b88334eb64173fe4300cab46ecd3229633fcc45c83d4", - Key: "0x1813aac5f5e7799684c6dc33e51f44d3627fd748c800724a184ed5be09b713e", - Value: "0x630b4197", + Address: utils.TestHexToFelt(t, "0xe5cc6f2b6d34979184b88334eb64173fe4300cab46ecd3229633fcc45c83d4"), + StorageEntries: StorageEntries{ + StorageEntry: []StorageEntry{ + StorageEntry{ + Key: utils.TestHexToFelt(t, "0x1813aac5f5e7799684c6dc33e51f44d3627fd748c800724a184ed5be09b713e"), + Value: utils.TestHexToFelt(t, "0x630b4197"), + }, + }, + }, }}, }, }, diff --git a/rpcv02/call_test.go b/rpcv02/call_test.go index 596aebc6..c3671794 100644 --- a/rpcv02/call_test.go +++ b/rpcv02/call_test.go @@ -7,6 +7,8 @@ import ( "testing" "github.com/NethermindEth/caigo/types" + "github.com/NethermindEth/caigo/utils" + "github.com/NethermindEth/juno/core/felt" ) // TestCall tests Call @@ -22,9 +24,9 @@ func TestCall(t *testing.T) { "devnet": { { FunctionCall: types.FunctionCall{ - ContractAddress: types.StrToFelt("0xbaaa96effb3564b6047e45944e8db9d9b0a056886d131038baabb56a959390"), - EntryPointSelector: "get_count", - Calldata: []string{}, + ContractAddress: utils.TestHexToFelt(t, "0xbaaa96effb3564b6047e45944e8db9d9b0a056886d131038baabb56a959390"), + EntryPointSelector: types.GetSelectorFromNameFelt("get_count"), + Calldata: []*felt.Felt{}, }, BlockID: WithBlockTag("latest"), ExpectedPatternResult: "^0x[0-9a-f]+$", @@ -32,9 +34,9 @@ func TestCall(t *testing.T) { { FunctionCall: types.FunctionCall{ // ContractAddress of devnet ETH - ContractAddress: types.StrToFelt("0x62230ea046a9a5fbc261ac77d03c8d41e5d442db2284587570ab46455fd2488"), - EntryPointSelector: "balanceOf", - Calldata: []string{DevNetAccount032Address}, + ContractAddress: utils.TestHexToFelt(t, "0x62230ea046a9a5fbc261ac77d03c8d41e5d442db2284587570ab46455fd2488"), + EntryPointSelector: types.GetSelectorFromNameFelt("balanceOf"), + Calldata: []*felt.Felt{utils.TestHexToFelt(t, DevNetAccount032Address)}, }, BlockID: WithBlockTag("latest"), ExpectedPatternResult: "^0x[0-9a-f]+$", @@ -43,9 +45,9 @@ func TestCall(t *testing.T) { "mock": { { FunctionCall: types.FunctionCall{ - ContractAddress: types.StrToFelt("0xdeadbeef"), - EntryPointSelector: "decimals", - Calldata: []string{}, + ContractAddress: utils.TestHexToFelt(t, "0xdeadbeef"), + EntryPointSelector: types.GetSelectorFromNameFelt("decimals"), + Calldata: []*felt.Felt{}, }, BlockID: WithBlockTag("latest"), ExpectedPatternResult: "^0x12$", @@ -54,27 +56,27 @@ func TestCall(t *testing.T) { "testnet": { { FunctionCall: types.FunctionCall{ - ContractAddress: types.StrToFelt("0x029260ce936efafa6d0042bc59757a653e3f992b97960c1c4f8ccd63b7a90136"), - EntryPointSelector: "decimals", - Calldata: []string{}, + ContractAddress: utils.TestHexToFelt(t, "0x029260ce936efafa6d0042bc59757a653e3f992b97960c1c4f8ccd63b7a90136"), + EntryPointSelector: types.GetSelectorFromNameFelt("decimals"), + Calldata: []*felt.Felt{}, }, BlockID: WithBlockTag("latest"), ExpectedPatternResult: "^0x12$", }, { FunctionCall: types.FunctionCall{ - ContractAddress: types.StrToFelt(TestNetETHAddress), - EntryPointSelector: "balanceOf", - Calldata: []string{"0x0207aCC15dc241e7d167E67e30E769719A727d3E0fa47f9E187707289885Dfde"}, + ContractAddress: utils.TestHexToFelt(t, TestNetETHAddress), + EntryPointSelector: types.GetSelectorFromNameFelt("balanceOf"), + Calldata: []*felt.Felt{utils.TestHexToFelt(t, "0x0207aCC15dc241e7d167E67e30E769719A727d3E0fa47f9E187707289885Dfde")}, }, BlockID: WithBlockTag("latest"), ExpectedPatternResult: "^0x[0-9a-f]+$", }, { FunctionCall: types.FunctionCall{ - ContractAddress: types.StrToFelt(TestNetAccount032Address), - EntryPointSelector: "get_nonce", - Calldata: []string{}, + ContractAddress: utils.TestHexToFelt(t, TestNetAccount032Address), + EntryPointSelector: types.GetSelectorFromNameFelt("get_nonce"), + Calldata: []*felt.Felt{}, }, BlockID: WithBlockTag("latest"), ExpectedPatternResult: "^0x[0-9a-f]+$", @@ -83,9 +85,9 @@ func TestCall(t *testing.T) { "mainnet": { { FunctionCall: types.FunctionCall{ - ContractAddress: types.StrToFelt("0x06a09ccb1caaecf3d9683efe335a667b2169a409d19c589ba1eb771cd210af75"), - EntryPointSelector: "decimals", - Calldata: []string{}, + ContractAddress: utils.TestHexToFelt(t, "0x06a09ccb1caaecf3d9683efe335a667b2169a409d19c589ba1eb771cd210af75"), + EntryPointSelector: types.GetSelectorFromNameFelt("decimals"), + Calldata: []*felt.Felt{}, }, BlockID: WithBlockTag("latest"), ExpectedPatternResult: "^0x12$", @@ -94,10 +96,9 @@ func TestCall(t *testing.T) { }[testEnv] for _, test := range testSet { - function := test.FunctionCall spy := NewSpy(testConfig.provider.c) testConfig.provider.c = spy - output, err := testConfig.provider.Call(context.Background(), function, test.BlockID) + output, err := testConfig.provider.Call(context.Background(), FunctionCall(test.FunctionCall), test.BlockID) if err != nil { t.Fatal(err) } diff --git a/rpcv02/contract_test.go b/rpcv02/contract_test.go index 81ebb169..391bd3f4 100644 --- a/rpcv02/contract_test.go +++ b/rpcv02/contract_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/NethermindEth/caigo/types" + "github.com/NethermindEth/caigo/utils" "github.com/NethermindEth/juno/core/felt" ) @@ -20,19 +20,19 @@ func TestClassAt(t *testing.T) { testSet := map[string][]testSetType{ "mock": { { - ContractAddress: types.StrToFelt("0xdeadbeef"), + ContractAddress: utils.TestHexToFelt(t, "0xdeadbeef"), ExpectedOperation: "0xdeadbeef", }, }, "testnet": { { - ContractAddress: types.StrToFelt("0x6fbd460228d843b7fbef670ff15607bf72e19fa94de21e29811ada167b4ca39"), + ContractAddress: utils.TestHexToFelt(t, "0x6fbd460228d843b7fbef670ff15607bf72e19fa94de21e29811ada167b4ca39"), ExpectedOperation: "0x480680017fff8000", }, }, "mainnet": { { - ContractAddress: types.StrToFelt("0x028105caf03e1c4eb96b1c18d39d9f03bd53e5d2affd0874792e5bf05f3e529f"), + ContractAddress: utils.TestHexToFelt(t, "0x028105caf03e1c4eb96b1c18d39d9f03bd53e5d2affd0874792e5bf05f3e529f"), ExpectedOperation: "0x20780017fff7ffd", }, }, @@ -70,19 +70,19 @@ func TestClassHashAt(t *testing.T) { testSet := map[string][]testSetType{ "mock": { { - ContractHash: types.StrToFelt("0xdeadbeef"), + ContractHash: utils.TestHexToFelt(t, "0xdeadbeef"), ExpectedClassHash: "0xdeadbeef", }, }, "testnet": { { - ContractHash: types.StrToFelt("0x315e364b162653e5c7b23efd34f8da27ba9c069b68e3042b7d76ce1df890313"), + ContractHash: utils.TestHexToFelt(t, "0x315e364b162653e5c7b23efd34f8da27ba9c069b68e3042b7d76ce1df890313"), ExpectedClassHash: "0x493af3546940eb96471cf95ae3a5aa1286217b07edd1e12d00143010ca904b1", }, }, "mainnet": { { - ContractHash: types.StrToFelt("0x3b4be7def2fc08589348966255e101824928659ebb724855223ff3a8c831efa"), + ContractHash: utils.TestHexToFelt(t, "0x3b4be7def2fc08589348966255e101824928659ebb724855223ff3a8c831efa"), ExpectedClassHash: "0x4c53698c9a42341e4123632e87b752d6ae470ddedeb8b0063eaa2deea387eeb", }, }, @@ -174,7 +174,7 @@ func TestStorageAt(t *testing.T) { testSet := map[string][]testSetType{ "mock": { { - ContractHash: types.StrToFelt("0xdeadbeef"), + ContractHash: utils.TestHexToFelt(t, "0xdeadbeef"), StorageKey: "_signer", Block: WithBlockTag("latest"), ExpectedValue: "0xdeadbeef", @@ -182,7 +182,7 @@ func TestStorageAt(t *testing.T) { }, "testnet": { { - ContractHash: types.StrToFelt("0x6fbd460228d843b7fbef670ff15607bf72e19fa94de21e29811ada167b4ca39"), + ContractHash: utils.TestHexToFelt(t, "0x6fbd460228d843b7fbef670ff15607bf72e19fa94de21e29811ada167b4ca39"), StorageKey: "balance", Block: WithBlockTag("latest"), ExpectedValue: "0x1e240", @@ -190,7 +190,7 @@ func TestStorageAt(t *testing.T) { }, "mainnet": { { - ContractHash: types.StrToFelt("0x8d17e6a3B92a2b5Fa21B8e7B5a3A794B05e06C5FD6C6451C6F2695Ba77101"), + ContractHash: utils.TestHexToFelt(t, "0x8d17e6a3B92a2b5Fa21B8e7B5a3A794B05e06C5FD6C6451C6F2695Ba77101"), StorageKey: "_signer", Block: WithBlockTag("latest"), ExpectedValue: "0x7f72660ca40b8ca85f9c0dd38db773f17da7a52f5fc0521cb8b8d8d44e224b8", @@ -229,12 +229,12 @@ func TestNonce(t *testing.T) { testSet := map[string][]testSetType{ "mock": { { - ContractAddress: types.StrToFelt("0x0207acc15dc241e7d167e67e30e769719a727d3e0fa47f9e187707289885dfde"), + ContractAddress: utils.TestHexToFelt(t, "0x0207acc15dc241e7d167e67e30e769719a727d3e0fa47f9e187707289885dfde"), }, }, "testnet": { { - ContractAddress: types.StrToFelt("0x0207acc15dc241e7d167e67e30e769719a727d3e0fa47f9e187707289885dfde"), + ContractAddress: utils.TestHexToFelt(t, "0x0207acc15dc241e7d167e67e30e769719a727d3e0fa47f9e187707289885dfde"), }, }, "mainnet": {}, diff --git a/rpcv02/data_test.go b/rpcv02/data_test.go deleted file mode 100644 index bf7b3c73..00000000 --- a/rpcv02/data_test.go +++ /dev/null @@ -1,279 +0,0 @@ -package rpcv02 - -import ( - "github.com/NethermindEth/caigo/types" - ctypes "github.com/NethermindEth/caigo/types" -) - -var blockGoerli310370 = Block{ - BlockHeader: BlockHeader{ - BlockHash: ctypes.StrToFelt("0x6c2fe3db009a2e008c2d65fca14204f3405cb74742fcf685f02473acaf70c72"), - ParentHash: ctypes.StrToFelt("0x1ce6fa8ef59dfa1ad8f7ce7c3a4e6752e2d8ae6274f8257345f680e6ae0b5b5"), - SequencerAddress: "0x46a89ae102987331d369645031b49c27738ed096f2789c24449966da4c6de6b", - BlockNumber: 310370, - NewRoot: "0x5cd7a08312635206c0210b8c90e61ceac27cb09629064e12266fd79e4c05a3d", - Timestamp: 1661450764, - }, - Status: "ACCEPTED_ON_L1", - Transactions: []Transaction{ - TransactionHash{TransactionHash: ctypes.StrToFelt("0x40c82f79dd2bc1953fc9b347a3e7ab40fe218ed5740bf4e120f74e8a3c9ac99")}, - TransactionHash{TransactionHash: ctypes.StrToFelt("0x28981b14353a28bc46758dff412ac544d16f2ffc8dde31867855592ea054ab1")}, - TransactionHash{TransactionHash: ctypes.StrToFelt("0x41176c650076712f1618a141fc1cf9a8c39f0d9548a3458f29cf363310a1e72")}, - TransactionHash{TransactionHash: ctypes.StrToFelt("0x43cd66f3ddbfbf681ab99bb57bf9d94c83d6e9b586bdbde78ab2deb0328ebd5")}, - TransactionHash{TransactionHash: ctypes.StrToFelt("0x7602cfebe4f3cb3ef4c8b8c6d7dda2efaf4a500723020066f5db50acd5095cd")}, - TransactionHash{TransactionHash: ctypes.StrToFelt("0x2612f3f870ee7e7617d4f9efdc41fa8fd571f9720b059b1aa14c1bf15d3a92a")}, - TransactionHash{TransactionHash: ctypes.StrToFelt("0x1a7810a6c68adf0621ed384d915409c936efa0c9d436683ea0cf7ea171719b")}, - TransactionHash{TransactionHash: ctypes.StrToFelt("0x26683aeef3e9d9bcc1f0d45a5f0b67d0aa1919726524b2a8dc59504dacfd1f4")}, - TransactionHash{TransactionHash: ctypes.StrToFelt("0x1d374aa073435cdde1ec1caf972f7c175fd23438bb220848e71720e00fd7474")}, - TransactionHash{TransactionHash: ctypes.StrToFelt("0xfc13eabaa2f38981e68bb010370cad7a7d0b65a59101ec816042adca0d6841")}, - TransactionHash{TransactionHash: ctypes.StrToFelt("0x672d007224128b99bcc145cd3dbd8930a944b6a5fff5c27e3b158a6ff701509")}, - TransactionHash{TransactionHash: ctypes.StrToFelt("0x24795cbca6d2eba941082cea3f686bc86ef27dd46fdf84b32f9ba25bbeddb28")}, - TransactionHash{TransactionHash: ctypes.StrToFelt("0x69281a4dd58c260a06b3266554c0cf1a4f19b79d8488efef2a1f003d67506ed")}, - TransactionHash{TransactionHash: ctypes.StrToFelt("0x62211cc3c94d612b580eb729410e52277f838f962d91af91fb2b0526704c04d")}, - TransactionHash{TransactionHash: ctypes.StrToFelt("0x5e4128b7680db32de4dff7bc57cb11c9f222752b1f875e84b29785b4c284e2a")}, - TransactionHash{TransactionHash: ctypes.StrToFelt("0xdb8ad2b7d008fd2ad7fba4315b193032dee85e17346c80276a2e08c7f09f80")}, - TransactionHash{TransactionHash: ctypes.StrToFelt("0x67b9541ca879abc29fa24a0fa070285d1899fc044159521c827f6b6aa09bbd6")}, - TransactionHash{TransactionHash: ctypes.StrToFelt("0x5d9c0ab1d4ed6e9376c8ab45ee02b25dd0adced12941aafe8ce37369d19d9c2")}, - TransactionHash{TransactionHash: ctypes.StrToFelt("0x4e52da53e23d92d9818908aeb104b007ea24d3cd4a5aa43144d2db1011e314f")}, - TransactionHash{TransactionHash: ctypes.StrToFelt("0x6cc05f5ab469a3675acb5885c274d5143dca75dd9835c582f59e85ab0642d39")}, - TransactionHash{TransactionHash: ctypes.StrToFelt("0x561ed983d1d9c37c964a96f80ccaf3de772e2b73106d6f49dd7c3f7ed8483d9")}, - }, -} - -var fullBlockGoerli310370 = Block{ - BlockHeader: BlockHeader{ - BlockHash: ctypes.StrToFelt("0x6c2fe3db009a2e008c2d65fca14204f3405cb74742fcf685f02473acaf70c72"), - ParentHash: ctypes.StrToFelt("0x1ce6fa8ef59dfa1ad8f7ce7c3a4e6752e2d8ae6274f8257345f680e6ae0b5b5"), - SequencerAddress: "0x46a89ae102987331d369645031b49c27738ed096f2789c24449966da4c6de6b", - BlockNumber: 310370, - NewRoot: "0x5cd7a08312635206c0210b8c90e61ceac27cb09629064e12266fd79e4c05a3d", - Timestamp: 1661450764, - }, - Status: "ACCEPTED_ON_L1", - Transactions: []Transaction{ - InvokeTxnV0{ - CommonTransaction: CommonTransaction{ - TransactionHash: ctypes.StrToFelt("0x40c82f79dd2bc1953fc9b347a3e7ab40fe218ed5740bf4e120f74e8a3c9ac99"), - Type: "INVOKE", - MaxFee: "0xde0b6b3a7640000", - Version: "0x0", - Signature: []string{ - "0x7bc0a22005a54ec6a005c1e89ab0201cbd0819621edd9fe4d5ef177a4ff33dd", - "0x13089e5f38de4ea98e9275be7fadc915946be15c14a8fed7c55202818527bea", - }, - Nonce: "0x0", - }, - ContractAddress: ctypes.StrToFelt("0x2e28403d7ee5e337b7d456327433f003aa875c29631906908900058c83d8cb6"), - EntryPointSelector: "0x15d40a3d6ca2ac30f4031e42be28da9b056fef9bb7357ac5e85627ee876e5ad", - Calldata: []string{ - "0x1", - "0x33830ce413e4c096eef81b5e6ffa9b9f5d963f57b8cd63c9ae4c839c383c1a6", - "0x2db698626ed7f60212e1ce6e99afb796b6b423d239c3f0ecef23e840685e866", - "0x0", - "0x2", - "0x2", - "0x61c6e7484657e5dc8b21677ffa33e4406c0600bba06d12cf1048fdaa55bdbc3", - "0x6307b990", - "0x2b81", - }, - }, - }, -} - -var receiptTxn310370_0 = InvokeTransactionReceipt(CommonTransactionReceipt{ - TransactionHash: ctypes.StrToFelt("0x40c82f79dd2bc1953fc9b347a3e7ab40fe218ed5740bf4e120f74e8a3c9ac99"), - ActualFee: "0x1709a2f3a2", - Type: "INVOKE", - Status: types.TransactionAcceptedOnL1, - BlockHash: ctypes.StrToFelt("0x6c2fe3db009a2e008c2d65fca14204f3405cb74742fcf685f02473acaf70c72"), - BlockNumber: 310370, - MessagesSent: []MsgToL1{}, - Events: []Event{ - { - FromAddress: ctypes.StrToFelt("0x37de00fb1416936b3074fc78bcc811d83046009b162c4a822ce84dabedd0ea9"), - Data: []string{ - "0x0", - "0x35b32bb4a1969175fb14b6c09838d1b3200724cc4d2b0891be319764021f5ac", - "0xe9", - "0x0", - }, - Keys: []string{"0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9"}, - }, - { - FromAddress: ctypes.StrToFelt("0x33830ce413e4c096eef81b5e6ffa9b9f5d963f57b8cd63c9ae4c839c383c1a6"), - Data: []string{ - "0x61c6e7484657e5dc8b21677ffa33e4406c0600bba06d12cf1048fdaa55bdbc3", - "0x2e28403d7ee5e337b7d456327433f003aa875c29631906908900058c83d8cb6", - }, - Keys: []string{"0xf806f71b19e4744968b37e3fb288e61309ab33a782ea9d11e18f67a1fbb110"}, - }, - }, -}) - -var fullBlockGoerli310843 = Block{ - BlockHeader: BlockHeader{ - BlockHash: ctypes.StrToFelt("0x424fba26a7760b63895abe0c366c2d254cb47090c6f9e91ba2b3fa0824d4fc9"), - ParentHash: ctypes.StrToFelt("0x30e34dedf00bb35a9076b2b0f50a5a74fd2501f62094b6e687277be6ef3d444"), - SequencerAddress: "0x46a89ae102987331d369645031b49c27738ed096f2789c24449966da4c6de6b", - BlockNumber: 310843, - NewRoot: "0x32bd4ff21288c898d4d3b6a7aea4ebdb3f1c7089cd52bde98316b4ecb8a50be", - Timestamp: 1661486036, - }, - Status: "ACCEPTED_ON_L1", - Transactions: []Transaction{ - DeployTxn{ - ConstructorCalldata: []string{ - "0x31ad196615d50956d98be085eb1774624106a6936c7c38696e730d2a6df735a", - "0x736affc32af71f8d361c855b38ffef58ec151bd8361a3b160017b90ada1068e", - }, - ContractAddressSalt: "0x4241e90ee6a33a1e2e70b088f7e4acfb3d6630964c1a85e96fa96acd56dcfcf", - ClassHash: "0x1ca349f9721a2bf05012bb475b404313c497ca7d6d5f80c03e98ff31e9867f5", - Type: "DEPLOY", - Version: "0x0", - TransactionHash: ctypes.StrToFelt("0x35bd2978d2061b3463498f83c09322ed6a82e4b2a188506525e272a7adcdf6a"), - }, - }, -} - -var receiptTxn310843_14 = DeployTransactionReceipt{ - CommonTransactionReceipt: CommonTransactionReceipt{ - TransactionHash: types.StrToFelt("0x035bd2978d2061b3463498f83c09322ed6a82e4b2a188506525e272a7adcdf6a"), - ActualFee: "0x0", - Status: "ACCEPTED_ON_L1", - BlockHash: types.StrToFelt("0x0424fba26a7760b63895abe0c366c2d254cb47090c6f9e91ba2b3fa0824d4fc9"), - BlockNumber: 310843, - Type: "DEPLOY", - MessagesSent: []MsgToL1{}, - Events: []Event{}, - }, - ContractAddress: "0x21c40b1377353924e185c9536469787dbe0cdb77b6877fa3a9946b795c71ec7", -} - -var fullBlockGoerli300114 = Block{ - BlockHeader: BlockHeader{ - BlockHash: ctypes.StrToFelt("0x184268bfbce24766fa53b65c9c8b30b295e145e8281d543a015b46308e27fdf"), - ParentHash: ctypes.StrToFelt("0x7307cb0d7fa65c111e71cdfb6209bdc90d2454d4c0f34d8bf5a3fe477826c3c"), - SequencerAddress: "0x46a89ae102987331d369645031b49c27738ed096f2789c24449966da4c6de6b", - BlockNumber: 300114, - NewRoot: "0x239a44410e78665f41f7a65ef3b5ed244ce411965498a83f80f904e22df1045", - Timestamp: 1660701246, - }, - Status: "ACCEPTED_ON_L1", - Transactions: []Transaction{ - DeclareTxn{ - CommonTransaction: CommonTransaction{ - TransactionHash: ctypes.StrToFelt("0x46a9f52a96b2d226407929e04cb02507e531f7c78b9196fc8c910351d8c33f3"), - Type: "DECLARE", - MaxFee: "0x0", - Version: "0x0", - Signature: []string{}, - Nonce: "0x0", - }, - ClassHash: "0x6feb117d1c3032b0ae7bd3b50cd8ec4a78c621dca0d63ddc17890b78a6c3b49", - SenderAddress: "0x1", - }, - }, -} - -var receiptTxn300114_3 = DeclareTransactionReceipt( - CommonTransactionReceipt{ - TransactionHash: ctypes.StrToFelt("0x46a9f52a96b2d226407929e04cb02507e531f7c78b9196fc8c910351d8c33f3"), - ActualFee: "0x0", - Status: types.TransactionAcceptedOnL1, - BlockHash: ctypes.StrToFelt("0x184268bfbce24766fa53b65c9c8b30b295e145e8281d543a015b46308e27fdf"), - BlockNumber: 300114, - Type: "DECLARE", - MessagesSent: []MsgToL1{}, - Events: []Event{}, - }) - -var InvokeTxnV00x705547f8f2f8f = InvokeTxnV0{ - CommonTransaction: CommonTransaction{ - TransactionHash: ctypes.StrToFelt("0x705547f8f2f8fdfb10ed533d909f76482bb293c5a32648d476774516a0bebd0"), - Type: TransactionType_Invoke, - MaxFee: "0x53685de02fa5", - Version: "0x0", - Nonce: "0x0", - Signature: []string{ - "0x4a7849de7b91e52cd0cdaf4f40aa67f54a58e25a15c60e034d2be819c1ecda4", - "0x227fcad2a0007348e64384649365e06d41287b1887999b406389ee73c1d8c4c", - }, - }, - ContractAddress: ctypes.StrToFelt("0x315e364b162653e5c7b23efd34f8da27ba9c069b68e3042b7d76ce1df890313"), - EntryPointSelector: "0x15d40a3d6ca2ac30f4031e42be28da9b056fef9bb7357ac5e85627ee876e5ad", - Calldata: []string{ - "0x1", - "0x13befe6eda920ce4af05a50a67bd808d67eee6ba47bb0892bef2d630eaf1bba", - "0x3451875d57805682e40d0ad8e604fc4cc5f949d14ca8228d4a2eaeee7f48688", - "0x0", - "0x19", - "0x19", - "0x6", - "0x6274632f757364", - "0x46c9e02299ca9c00000", - "0x62aba221", - "0x657175696c69627269756d2d636578", - "0x6574682f757364", - "0x3c7c6b5765ad980000", - "0x62aba221", - "0x657175696c69627269756d2d636578", - "0x736f6c2f757364", - "0x1b6009e149e038000", - "0x62aba221", - "0x657175696c69627269756d2d636578", - "0x617661782f757364", - "0xe167e2d85ad98000", - "0x62aba221", - "0x657175696c69627269756d2d636578", - "0x646f67652f757364", - "0xc94bf844f94000", - "0x62aba222", - "0x657175696c69627269756d2d636578", - "0x736869622f757364", - "0x764e9c31400", - "0x62aba222", - "0x657175696c69627269756d2d636578", - "0x4c83", - }, -} - -var InvokeTxnV0_300000_0 = InvokeTxnV0{ - CommonTransaction: CommonTransaction{ - TransactionHash: ctypes.StrToFelt("0x680b0616e65633dfaf06d5a5ee5f1d1d4b641396009f00a67c0d18dc0f9638"), - Type: TransactionType_Invoke, - MaxFee: "0x17e817dc96bf", - Version: "0x0", - Signature: []string{ - "0x28fd7fdff06bb65438e10bb9af23d7daf354ec7c75173056c0bb5a55690bf42", - "0x6eb86c1d6b8efcfd9cefe2d068e9f34874a71e0583abdb38513f92addfb36ca", - }, - Nonce: "0x0", - }, - ContractAddress: ctypes.StrToFelt("0x661638e27a00f65819559a0612874d1e3865b2372c539a85b5f0fb47c8ec683"), - EntryPointSelector: "0x15d40a3d6ca2ac30f4031e42be28da9b056fef9bb7357ac5e85627ee876e5ad", - Calldata: []string{ - "0x1", - "0x12fadd18ec1a23a160cc46981400160fbf4a7a5eed156c4669e39807265bcd4", - "0x1a3af362287b0d09060bb79b7eeb6da636a9cd720a9b805c081181c8bcc58f", - "0x0", - "0x10", - "0x10", - "0x3", - "0x6274632f757364", - "0x50de402c68b9dc00000", - "0x62fc247c", - "0x636f696e62617365", - "0x656d7069726963", - "0x6574682f757364", - "0x65a2e8c490e4e00000", - "0x62fc247c", - "0x636f696e62617365", - "0x656d7069726963", - "0x6461692f757364", - "0xde000cd866f8000", - "0x62fc247c", - "0x636f696e62617365", - "0x656d7069726963", - "0x62fc2512", - }, -} diff --git a/rpcv02/mock_test.go b/rpcv02/mock_test.go index f04d7c4f..a8324b46 100644 --- a/rpcv02/mock_test.go +++ b/rpcv02/mock_test.go @@ -8,6 +8,7 @@ import ( "strings" "github.com/NethermindEth/caigo/types" + "github.com/NethermindEth/caigo/utils" "github.com/NethermindEth/juno/core/felt" ) @@ -106,12 +107,19 @@ func mock_starknet_syncing(result interface{}, method string, args ...interface{ return errWrongArgs } + blockDataFeltArr, err := utils.HexArrToFelt([]string{ + "0x4b238e99c40d448b85dfc69e4414c2dbeb4d21d5c670b1662b5ad2ad2fcb061", + "0x9cee6f457637180c36532bb0bfc5a091bb410b70f0489bcbbb0f1eca6650be", + }) + if err != nil { + return err + } value := SyncStatus{ - StartingBlockHash: "0x4b238e99c40d448b85dfc69e4414c2dbeb4d21d5c670b1662b5ad2ad2fcb061", + StartingBlockHash: blockDataFeltArr[0], StartingBlockNum: "0x4c602", - CurrentBlockHash: "0x9cee6f457637180c36532bb0bfc5a091bb410b70f0489bcbbb0f1eca6650be", + CurrentBlockHash: blockDataFeltArr[1], CurrentBlockNum: "0x4c727", - HighestBlockHash: "0x9cee6f457637180c36532bb0bfc5a091bb410b70f0489bcbbb0f1eca6650be", + HighestBlockHash: blockDataFeltArr[1], HighestBlockNum: "0x4c727", } *r = value @@ -130,8 +138,25 @@ func mock_starknet_getTransactionByBlockIdAndIndex(result interface{}, method st if !ok { return errWrongArgs } - outputContent, _ := json.Marshal(InvokeTxnV0_300000_0) - json.Unmarshal(outputContent, r) + + var InvokeTxnV1example = `{ + "transaction_hash": "0x705547f8f2f8fdfb10ed533d909f76482bb293c5a32648d476774516a0bebd0", + "type": "INVOKE", + "nonce": "0x0", + "max_fee": "0x53685de02fa5", + "version": "0x1", + "signature": [ + "0x4a7849de7b91e52cd0cdaf4f40aa67f54a58e25a15c60e034d2be819c1ecda4", + "0x227fcad2a0007348e64384649365e06d41287b1887999b406389ee73c1d8c4c" + ], + "sender_address": "0x315e364b162653e5c7b23efd34f8da27ba9c069b68e3042b7d76ce1df890313", + "calldata": [ + "0x1", + "0x13befe6eda920ce4af05a50a67bd808d67eee6ba47bb0892bef2d630eaf1bba" + ] + }` + + json.Unmarshal([]byte(InvokeTxnV1example), r) return nil } @@ -161,8 +186,25 @@ func mock_starknet_getTransactionByHash(result interface{}, method string, args if !ok { return errWrongArgs } - outputContent, _ := json.Marshal(InvokeTxnV00x705547f8f2f8f) - json.Unmarshal(outputContent, r) + + var InvokeTxnV1example = `{ + "transaction_hash": "0x705547f8f2f8fdfb10ed533d909f76482bb293c5a32648d476774516a0bebd0", + "type": "INVOKE", + "nonce": "0x0", + "max_fee": "0x53685de02fa5", + "version": "0x1", + "signature": [ + "0x4a7849de7b91e52cd0cdaf4f40aa67f54a58e25a15c60e034d2be819c1ecda4", + "0x227fcad2a0007348e64384649365e06d41287b1887999b406389ee73c1d8c4c" + ], + "sender_address": "0x315e364b162653e5c7b23efd34f8da27ba9c069b68e3042b7d76ce1df890313", + "calldata": [ + "0x1", + "0x13befe6eda920ce4af05a50a67bd808d67eee6ba47bb0892bef2d630eaf1bba" + ] + }` + + json.Unmarshal([]byte(InvokeTxnV1example), r) return nil } @@ -176,11 +218,19 @@ func mock_starknet_getTransactionReceipt(result interface{}, method string, args return errWrongArgs } + arg0Felt, err := utils.HexToFelt(args[0].(string)) + if err != nil { + return err + } + fromAddressFelt, err := utils.HexToFelt("0xdeadbeef") + if err != nil { + return err + } transaction := InvokeTransactionReceipt(CommonTransactionReceipt{ - TransactionHash: types.StrToFelt(args[0].(string)), - Status: types.TransactionState("ACCEPTED_ON_L1"), + TransactionHash: arg0Felt, + Status: TransactionAcceptedOnL1, Events: []Event{{ - FromAddress: types.StrToFelt("0xdeadbeef"), + FromAddress: fromAddressFelt, }}, }) outputContent, _ := json.Marshal(transaction) @@ -197,7 +247,7 @@ func mock_starknet_getClassAt(result interface{}, method string, args ...interfa if len(args) != 2 { return errWrongArgs } - var class = types.ContractClass{ + var class = ContractClass{ Program: "H4sIAAAAAAAE/+Vde3PbOJL/Kj5VXW1mVqsC36Sr9g8n0c6mzonnbM", } outputContent, _ := json.Marshal(class) @@ -239,7 +289,7 @@ func mock_starknet_getClass(result interface{}, method string, args ...interface fmt.Printf("%T\n", args[1]) return errWrongArgs } - var class = types.ContractClass{ + var class = ContractClass{ Program: "H4sIAAAAAAAE/+Vde3PbOJL/Kj5VXW1mVqsC36Sr9g8n0c6mzonnbM", } outputContent, _ := json.Marshal(class) @@ -259,14 +309,18 @@ func mock_starknet_getEvents(result interface{}, method string, args ...interfac if !ok { return errWrongArgs } + deadbeefFelt, err := utils.HexToFelt("0xdeadbeef") + if err != nil { + return err + } events := &EventsOutput{ Events: []EmittedEvent{ - {BlockHash: types.StrToFelt("0xdeadbeef"), + {BlockHash: deadbeefFelt, Event: Event{ FromAddress: query.Address, }, BlockNumber: 1, - TransactionHash: types.StrToFelt("0xdeadbeef"), + TransactionHash: deadbeefFelt, }, }, } @@ -299,7 +353,7 @@ func mock_starknet_addDeclareTransaction(result interface{}, method string, args fmt.Printf("args: %d\n", len(args)) return errWrongArgs } - _, ok = args[0].(types.ContractClass) + _, ok = args[0].(ContractClass) if !ok { fmt.Printf("args[2] should be ContractClass, got %T\n", args[0]) return errWrongArgs @@ -309,9 +363,13 @@ func mock_starknet_addDeclareTransaction(result interface{}, method string, args fmt.Printf("args[1] should be string, got %T\n", args[1]) return errWrongArgs } + deadbeefFelt, err := utils.HexToFelt("0xdeadbeef") + if err != nil { + return err + } output := AddDeclareTransactionOutput{ - TransactionHash: "0xdeadbeef", - ClassHash: "0xdeadbeef", + TransactionHash: deadbeefFelt, + ClassHash: deadbeefFelt, } outputContent, _ := json.Marshal(output) json.Unmarshal(outputContent, r) @@ -377,9 +435,12 @@ func mock_starknet_addInvokeTransaction(result interface{}, method string, args fmt.Printf("args[3] should be []string, got %T\n", args[3]) return errWrongArgs } - + deadbeefFelt, err := utils.HexToFelt("0xdeadbeef") + if err != nil { + return err + } output := types.AddInvokeTransactionOutput{ - TransactionHash: "0xdeadbeef", + TransactionHash: deadbeefFelt, } outputContent, _ := json.Marshal(output) json.Unmarshal(outputContent, r) @@ -430,15 +491,33 @@ func mock_starknet_getStateUpdate(result interface{}, method string, args ...int return errWrongArgs } + stateFeltArr, err := utils.HexArrToFelt([]string{ + "0x4f1cee281edb6cb31b9ba5a8530694b5527cf05c5ac6502decf3acb1d0cec4", + "0x70677cda9269d47da3ff63bc87cf1c87d0ce167b05da295dc7fc68242b250b", + "0x19aa982a75263d4c4de4cc4c5d75c3dec32e00b95bef7bbb4d17762a0b138af", + "0xe5cc6f2b6d34979184b88334eb64173fe4300cab46ecd3229633fcc45c83d4", + "0x1813aac5f5e7799684c6dc33e51f44d3627fd748c800724a184ed5be09b713e", + "0x1813aac5f5e7799684c6dc33e51f44d3627fd748c800724a184ed5be09b713e", + "0x630b4197"}) + if err != nil { + return err + } + output := StateUpdateOutput{ - BlockHash: types.StrToFelt("0x4f1cee281edb6cb31b9ba5a8530694b5527cf05c5ac6502decf3acb1d0cec4"), - NewRoot: "0x70677cda9269d47da3ff63bc87cf1c87d0ce167b05da295dc7fc68242b250b", - OldRoot: "0x19aa982a75263d4c4de4cc4c5d75c3dec32e00b95bef7bbb4d17762a0b138af", + BlockHash: stateFeltArr[0], + NewRoot: stateFeltArr[1], + OldRoot: stateFeltArr[2], StateDiff: StateDiff{ StorageDiffs: []ContractStorageDiffItem{{ - Address: "0xe5cc6f2b6d34979184b88334eb64173fe4300cab46ecd3229633fcc45c83d4", - Key: "0x1813aac5f5e7799684c6dc33e51f44d3627fd748c800724a184ed5be09b713e", - Value: "0x630b4197", + Address: stateFeltArr[3], + StorageEntries: StorageEntries{ + StorageEntry: []StorageEntry{ + StorageEntry{ + Key: stateFeltArr[4], + Value: stateFeltArr[5], + }, + }, + }, }}, }, } diff --git a/rpcv02/provider_test.go b/rpcv02/provider_test.go index 234b9095..1077a2b8 100644 --- a/rpcv02/provider_test.go +++ b/rpcv02/provider_test.go @@ -160,7 +160,7 @@ func TestSyncing(t *testing.T) { if !ok || i.Cmp(big.NewInt(0)) <= 0 { t.Fatal("CurrentBlockNum should be positive number, instead: ", sync.CurrentBlockNum) } - if !strings.HasPrefix(sync.CurrentBlockHash, "0x") { + if !strings.HasPrefix(sync.CurrentBlockHash.String(), "0x") { t.Fatal("current block hash should return a string starting with 0x") } } diff --git a/rpcv02/tests/0x1efa8f84fd4dff9e2902ec88717cf0dafc8c188f80c3450615944a469428f7f.json b/rpcv02/tests/0x1efa8f84fd4dff9e2902ec88717cf0dafc8c188f80c3450615944a469428f7f.json new file mode 100644 index 00000000..c14dde88 --- /dev/null +++ b/rpcv02/tests/0x1efa8f84fd4dff9e2902ec88717cf0dafc8c188f80c3450615944a469428f7f.json @@ -0,0 +1,6020 @@ +{ + "program": { + "compiler_version": "0.10.1", + "prime": "0x800000000000011000000000000000000000000000000000000000000000001", + "hints": { + "0": [ + { + "code": "memory[ap] = segments.add()", + "accessible_scopes": [ + "starkware.cairo.common.alloc", + "starkware.cairo.common.alloc.alloc" + ], + "flow_tracking_data": { + "reference_ids": {}, + "ap_tracking": { + "offset": 0, + "group": 0 + } + } + } + ], + "3": [ + { + "code": "from starkware.cairo.common.math_utils import assert_integer\nassert_integer(ids.value)\nassert ids.value % PRIME != 0, f'assert_not_zero failed: {ids.value} = 0.'", + "accessible_scopes": [ + "starkware.cairo.common.math", + "starkware.cairo.common.math.assert_not_zero" + ], + "flow_tracking_data": { + "reference_ids": { + "starkware.cairo.common.math.assert_not_zero.value": 0 + }, + "ap_tracking": { + "offset": 0, + "group": 1 + } + } + } + ], + "15": [ + { + "code": "syscall_handler.library_call(segments=segments, syscall_ptr=ids.syscall_ptr)", + "accessible_scopes": [ + "starkware.starknet.common.syscalls", + "starkware.starknet.common.syscalls.library_call" + ], + "flow_tracking_data": { + "reference_ids": { + "starkware.starknet.common.syscalls.library_call.__temp0": 7, + "starkware.starknet.common.syscalls.library_call.calldata": 4, + "starkware.starknet.common.syscalls.library_call.calldata_size": 3, + "starkware.starknet.common.syscalls.library_call.class_hash": 1, + "starkware.starknet.common.syscalls.library_call.function_selector": 2, + "starkware.starknet.common.syscalls.library_call.syscall": 6, + "starkware.starknet.common.syscalls.library_call.syscall_ptr": 5 + }, + "ap_tracking": { + "offset": 1, + "group": 2 + } + } + } + ], + "27": [ + { + "code": "syscall_handler.library_call_l1_handler(segments=segments, syscall_ptr=ids.syscall_ptr)", + "accessible_scopes": [ + "starkware.starknet.common.syscalls", + "starkware.starknet.common.syscalls.library_call_l1_handler" + ], + "flow_tracking_data": { + "reference_ids": { + "starkware.starknet.common.syscalls.library_call_l1_handler.__temp1": 16, + "starkware.starknet.common.syscalls.library_call_l1_handler.calldata": 13, + "starkware.starknet.common.syscalls.library_call_l1_handler.calldata_size": 12, + "starkware.starknet.common.syscalls.library_call_l1_handler.class_hash": 10, + "starkware.starknet.common.syscalls.library_call_l1_handler.function_selector": 11, + "starkware.starknet.common.syscalls.library_call_l1_handler.syscall": 15, + "starkware.starknet.common.syscalls.library_call_l1_handler.syscall_ptr": 14 + }, + "ap_tracking": { + "offset": 1, + "group": 3 + } + } + } + ], + "36": [ + { + "code": "syscall_handler.storage_read(segments=segments, syscall_ptr=ids.syscall_ptr)", + "accessible_scopes": [ + "starkware.starknet.common.syscalls", + "starkware.starknet.common.syscalls.storage_read" + ], + "flow_tracking_data": { + "reference_ids": { + "starkware.starknet.common.syscalls.storage_read.__temp2": 22, + "starkware.starknet.common.syscalls.storage_read.address": 19, + "starkware.starknet.common.syscalls.storage_read.syscall": 21, + "starkware.starknet.common.syscalls.storage_read.syscall_ptr": 20 + }, + "ap_tracking": { + "offset": 1, + "group": 4 + } + } + } + ], + "45": [ + { + "code": "syscall_handler.storage_write(segments=segments, syscall_ptr=ids.syscall_ptr)", + "accessible_scopes": [ + "starkware.starknet.common.syscalls", + "starkware.starknet.common.syscalls.storage_write" + ], + "flow_tracking_data": { + "reference_ids": { + "starkware.starknet.common.syscalls.storage_write.__temp3": 28, + "starkware.starknet.common.syscalls.storage_write.address": 25, + "starkware.starknet.common.syscalls.storage_write.syscall_ptr": 27, + "starkware.starknet.common.syscalls.storage_write.value": 26 + }, + "ap_tracking": { + "offset": 1, + "group": 5 + } + } + } + ], + "55": [ + { + "code": "syscall_handler.emit_event(segments=segments, syscall_ptr=ids.syscall_ptr)", + "accessible_scopes": [ + "starkware.starknet.common.syscalls", + "starkware.starknet.common.syscalls.emit_event" + ], + "flow_tracking_data": { + "reference_ids": { + "starkware.starknet.common.syscalls.emit_event.__temp4": 35, + "starkware.starknet.common.syscalls.emit_event.data": 33, + "starkware.starknet.common.syscalls.emit_event.data_len": 32, + "starkware.starknet.common.syscalls.emit_event.keys": 31, + "starkware.starknet.common.syscalls.emit_event.keys_len": 30, + "starkware.starknet.common.syscalls.emit_event.syscall_ptr": 34 + }, + "ap_tracking": { + "offset": 1, + "group": 6 + } + } + } + ], + "181": [ + { + "code": "memory[ap] = segments.add()", + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.constructor" + ], + "flow_tracking_data": { + "reference_ids": { + "__wrappers__.constructor.__calldata_actual_size": 118, + "__wrappers__.constructor.__calldata_arg_calldata": 114, + "__wrappers__.constructor.__calldata_arg_calldata_len": 109, + "__wrappers__.constructor.__calldata_arg_implementation_hash": 105, + "__wrappers__.constructor.__calldata_arg_selector": 107, + "__wrappers__.constructor.__calldata_ptr": 117, + "__wrappers__.constructor.__temp10": 116, + "__wrappers__.constructor.__temp11": 119, + "__wrappers__.constructor.__temp7": 111, + "__wrappers__.constructor.__temp8": 112, + "__wrappers__.constructor.__temp9": 115, + "__wrappers__.constructor.pedersen_ptr": 121, + "__wrappers__.constructor.range_check_ptr": 122, + "__wrappers__.constructor.ret_value": 123, + "__wrappers__.constructor.syscall_ptr": 120 + }, + "ap_tracking": { + "offset": 0, + "group": 16 + } + } + } + ], + "241": [ + { + "code": "memory[ap] = segments.add()", + "accessible_scopes": [ + "__main__", + "__main__", + "__wrappers__", + "__wrappers__.__l1_default__" + ], + "flow_tracking_data": { + "reference_ids": { + "__wrappers__.__l1_default__.pedersen_ptr": 163, + "__wrappers__.__l1_default__.range_check_ptr": 164, + "__wrappers__.__l1_default__.ret_value": 165, + "__wrappers__.__l1_default__.syscall_ptr": 162 + }, + "ap_tracking": { + "offset": 50, + "group": 20 + } + } + } + ] + }, + "main_scope": "__main__", + "identifiers": { + "__main__.HashBuiltin": { + "destination": "starkware.cairo.common.cairo_builtins.HashBuiltin", + "type": "alias" + }, + "__main__.Proxy": { + "destination": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy", + "type": "alias" + }, + "__main__.__default__": { + "pc": 190, + "decorators": [ + "external", + "raw_input", + "raw_output" + ], + "type": "function" + }, + "__main__.__default__.Args": { + "size": 3, + "full_name": "__main__.__default__.Args", + "members": { + "selector": { + "offset": 0, + "cairo_type": "felt" + }, + "calldata_size": { + "offset": 1, + "cairo_type": "felt" + }, + "calldata": { + "offset": 2, + "cairo_type": "felt*" + } + }, + "type": "struct" + }, + "__main__.__default__.ImplicitArgs": { + "size": 3, + "full_name": "__main__.__default__.ImplicitArgs", + "members": { + "syscall_ptr": { + "offset": 0, + "cairo_type": "felt*" + }, + "pedersen_ptr": { + "offset": 1, + "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*" + }, + "range_check_ptr": { + "offset": 2, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "__main__.__default__.Return": { + "cairo_type": "(retdata_size: felt, retdata: felt*)", + "type": "type_definition" + }, + "__main__.__default__.SIZEOF_LOCALS": { + "value": 0, + "type": "const" + }, + "__main__.__default__.calldata": { + "cairo_type": "felt*", + "full_name": "__main__.__default__.calldata", + "references": [ + { + "value": "[cast(fp + (-3), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 17 + }, + "pc": 190 + } + ], + "type": "reference" + }, + "__main__.__default__.calldata_size": { + "cairo_type": "felt", + "full_name": "__main__.__default__.calldata_size", + "references": [ + { + "value": "[cast(fp + (-4), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 17 + }, + "pc": 190 + } + ], + "type": "reference" + }, + "__main__.__default__.class_hash": { + "cairo_type": "felt", + "full_name": "__main__.__default__.class_hash", + "references": [ + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 28, + "group": 17 + }, + "pc": 195 + } + ], + "type": "reference" + }, + "__main__.__default__.pedersen_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", + "full_name": "__main__.__default__.pedersen_ptr", + "references": [ + { + "value": "[cast(fp + (-7), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 0, + "group": 17 + }, + "pc": 190 + }, + { + "value": "[cast(ap + (-3), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 28, + "group": 17 + }, + "pc": 195 + } + ], + "type": "reference" + }, + "__main__.__default__.range_check_ptr": { + "cairo_type": "felt", + "full_name": "__main__.__default__.range_check_ptr", + "references": [ + { + "value": "[cast(fp + (-6), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 17 + }, + "pc": 190 + }, + { + "value": "[cast(ap + (-2), felt*)]", + "ap_tracking_data": { + "offset": 28, + "group": 17 + }, + "pc": 195 + } + ], + "type": "reference" + }, + "__main__.__default__.retdata": { + "cairo_type": "felt*", + "full_name": "__main__.__default__.retdata", + "references": [ + { + "value": "[cast(ap + (-1), felt**)]", + "ap_tracking_data": { + "offset": 39, + "group": 17 + }, + "pc": 202 + } + ], + "type": "reference" + }, + "__main__.__default__.retdata_size": { + "cairo_type": "felt", + "full_name": "__main__.__default__.retdata_size", + "references": [ + { + "value": "[cast(ap + (-2), felt*)]", + "ap_tracking_data": { + "offset": 39, + "group": 17 + }, + "pc": 202 + } + ], + "type": "reference" + }, + "__main__.__default__.selector": { + "cairo_type": "felt", + "full_name": "__main__.__default__.selector", + "references": [ + { + "value": "[cast(fp + (-5), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 17 + }, + "pc": 190 + } + ], + "type": "reference" + }, + "__main__.__default__.syscall_ptr": { + "cairo_type": "felt*", + "full_name": "__main__.__default__.syscall_ptr", + "references": [ + { + "value": "[cast(fp + (-8), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 17 + }, + "pc": 190 + }, + { + "value": "[cast(ap + (-4), felt**)]", + "ap_tracking_data": { + "offset": 28, + "group": 17 + }, + "pc": 195 + }, + { + "value": "[cast(ap + (-3), felt**)]", + "ap_tracking_data": { + "offset": 39, + "group": 17 + }, + "pc": 202 + } + ], + "type": "reference" + }, + "__main__.__l1_default__": { + "pc": 217, + "decorators": [ + "l1_handler", + "raw_input" + ], + "type": "function" + }, + "__main__.__l1_default__.Args": { + "size": 3, + "full_name": "__main__.__l1_default__.Args", + "members": { + "selector": { + "offset": 0, + "cairo_type": "felt" + }, + "calldata_size": { + "offset": 1, + "cairo_type": "felt" + }, + "calldata": { + "offset": 2, + "cairo_type": "felt*" + } + }, + "type": "struct" + }, + "__main__.__l1_default__.ImplicitArgs": { + "size": 3, + "full_name": "__main__.__l1_default__.ImplicitArgs", + "members": { + "syscall_ptr": { + "offset": 0, + "cairo_type": "felt*" + }, + "pedersen_ptr": { + "offset": 1, + "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*" + }, + "range_check_ptr": { + "offset": 2, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "__main__.__l1_default__.Return": { + "cairo_type": "()", + "type": "type_definition" + }, + "__main__.__l1_default__.SIZEOF_LOCALS": { + "value": 0, + "type": "const" + }, + "__main__.__l1_default__.calldata": { + "cairo_type": "felt*", + "full_name": "__main__.__l1_default__.calldata", + "references": [ + { + "value": "[cast(fp + (-3), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 19 + }, + "pc": 217 + } + ], + "type": "reference" + }, + "__main__.__l1_default__.calldata_size": { + "cairo_type": "felt", + "full_name": "__main__.__l1_default__.calldata_size", + "references": [ + { + "value": "[cast(fp + (-4), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 19 + }, + "pc": 217 + } + ], + "type": "reference" + }, + "__main__.__l1_default__.class_hash": { + "cairo_type": "felt", + "full_name": "__main__.__l1_default__.class_hash", + "references": [ + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 28, + "group": 19 + }, + "pc": 222 + } + ], + "type": "reference" + }, + "__main__.__l1_default__.pedersen_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", + "full_name": "__main__.__l1_default__.pedersen_ptr", + "references": [ + { + "value": "[cast(fp + (-7), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 0, + "group": 19 + }, + "pc": 217 + }, + { + "value": "[cast(ap + (-3), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 28, + "group": 19 + }, + "pc": 222 + } + ], + "type": "reference" + }, + "__main__.__l1_default__.range_check_ptr": { + "cairo_type": "felt", + "full_name": "__main__.__l1_default__.range_check_ptr", + "references": [ + { + "value": "[cast(fp + (-6), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 19 + }, + "pc": 217 + }, + { + "value": "[cast(ap + (-2), felt*)]", + "ap_tracking_data": { + "offset": 28, + "group": 19 + }, + "pc": 222 + } + ], + "type": "reference" + }, + "__main__.__l1_default__.selector": { + "cairo_type": "felt", + "full_name": "__main__.__l1_default__.selector", + "references": [ + { + "value": "[cast(fp + (-5), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 19 + }, + "pc": 217 + } + ], + "type": "reference" + }, + "__main__.__l1_default__.syscall_ptr": { + "cairo_type": "felt*", + "full_name": "__main__.__l1_default__.syscall_ptr", + "references": [ + { + "value": "[cast(fp + (-8), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 19 + }, + "pc": 217 + }, + { + "value": "[cast(ap + (-4), felt**)]", + "ap_tracking_data": { + "offset": 28, + "group": 19 + }, + "pc": 222 + }, + { + "value": "[cast(ap + (-3), felt**)]", + "ap_tracking_data": { + "offset": 39, + "group": 19 + }, + "pc": 229 + } + ], + "type": "reference" + }, + "__main__.constructor": { + "pc": 136, + "decorators": [ + "constructor" + ], + "type": "function" + }, + "__main__.constructor.Args": { + "size": 4, + "full_name": "__main__.constructor.Args", + "members": { + "implementation_hash": { + "offset": 0, + "cairo_type": "felt" + }, + "selector": { + "offset": 1, + "cairo_type": "felt" + }, + "calldata_len": { + "offset": 2, + "cairo_type": "felt" + }, + "calldata": { + "offset": 3, + "cairo_type": "felt*" + } + }, + "type": "struct" + }, + "__main__.constructor.ImplicitArgs": { + "size": 3, + "full_name": "__main__.constructor.ImplicitArgs", + "members": { + "syscall_ptr": { + "offset": 0, + "cairo_type": "felt*" + }, + "pedersen_ptr": { + "offset": 1, + "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*" + }, + "range_check_ptr": { + "offset": 2, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "__main__.constructor.Return": { + "cairo_type": "()", + "type": "type_definition" + }, + "__main__.constructor.SIZEOF_LOCALS": { + "value": 2, + "type": "const" + }, + "__main__.constructor.calldata": { + "cairo_type": "felt*", + "full_name": "__main__.constructor.calldata", + "references": [ + { + "value": "[cast(fp + (-3), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 13 + }, + "pc": 136 + } + ], + "type": "reference" + }, + "__main__.constructor.calldata_len": { + "cairo_type": "felt", + "full_name": "__main__.constructor.calldata_len", + "references": [ + { + "value": "[cast(fp + (-4), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 13 + }, + "pc": 136 + } + ], + "type": "reference" + }, + "__main__.constructor.implementation_hash": { + "cairo_type": "felt", + "full_name": "__main__.constructor.implementation_hash", + "references": [ + { + "value": "[cast(fp + (-6), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 13 + }, + "pc": 136 + } + ], + "type": "reference" + }, + "__main__.constructor.pedersen_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", + "full_name": "__main__.constructor.pedersen_ptr", + "references": [ + { + "value": "[cast(fp + (-8), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 0, + "group": 13 + }, + "pc": 136 + }, + { + "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 59, + "group": 13 + }, + "pc": 144 + }, + { + "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 61, + "group": 13 + }, + "pc": 144 + }, + { + "value": "[cast(fp, starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 61, + "group": 13 + }, + "pc": 145 + } + ], + "type": "reference" + }, + "__main__.constructor.range_check_ptr": { + "cairo_type": "felt", + "full_name": "__main__.constructor.range_check_ptr", + "references": [ + { + "value": "[cast(fp + (-7), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 13 + }, + "pc": 136 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 59, + "group": 13 + }, + "pc": 144 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 61, + "group": 13 + }, + "pc": 144 + }, + { + "value": "[cast(fp + 1, felt*)]", + "ap_tracking_data": { + "offset": 61, + "group": 13 + }, + "pc": 146 + } + ], + "type": "reference" + }, + "__main__.constructor.selector": { + "cairo_type": "felt", + "full_name": "__main__.constructor.selector", + "references": [ + { + "value": "[cast(fp + (-5), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 13 + }, + "pc": 136 + } + ], + "type": "reference" + }, + "__main__.constructor.syscall_ptr": { + "cairo_type": "felt*", + "full_name": "__main__.constructor.syscall_ptr", + "references": [ + { + "value": "[cast(fp + (-9), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 13 + }, + "pc": 136 + }, + { + "value": "[cast(ap + (-3), felt**)]", + "ap_tracking_data": { + "offset": 59, + "group": 13 + }, + "pc": 144 + }, + { + "value": "[cast(ap + (-3), felt**)]", + "ap_tracking_data": { + "offset": 70, + "group": 13 + }, + "pc": 155 + }, + { + "value": "[cast(ap + (-3), felt**)]", + "ap_tracking_data": { + "offset": 61, + "group": 13 + }, + "pc": 144 + }, + { + "value": "[cast(ap + (-3), felt**)]", + "ap_tracking_data": { + "offset": 72, + "group": 13 + }, + "pc": 157 + } + ], + "type": "reference" + }, + "__main__.library_call": { + "destination": "starkware.starknet.common.syscalls.library_call", + "type": "alias" + }, + "__main__.library_call_l1_handler": { + "destination": "starkware.starknet.common.syscalls.library_call_l1_handler", + "type": "alias" + }, + "__wrappers__.__default__": { + "pc": 208, + "decorators": [ + "external", + "raw_input", + "raw_output" + ], + "type": "function" + }, + "__wrappers__.__default__.Args": { + "size": 0, + "full_name": "__wrappers__.__default__.Args", + "members": {}, + "type": "struct" + }, + "__wrappers__.__default__.ImplicitArgs": { + "size": 0, + "full_name": "__wrappers__.__default__.ImplicitArgs", + "members": {}, + "type": "struct" + }, + "__wrappers__.__default__.Return": { + "cairo_type": "(syscall_ptr: felt*, pedersen_ptr: starkware.cairo.common.cairo_builtins.HashBuiltin*, range_check_ptr: felt, size: felt, retdata: felt*)", + "type": "type_definition" + }, + "__wrappers__.__default__.SIZEOF_LOCALS": { + "value": 0, + "type": "const" + }, + "__wrappers__.__default__.__wrapped_func": { + "destination": "__main__.__default__", + "type": "alias" + }, + "__wrappers__.__default__.pedersen_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", + "full_name": "__wrappers__.__default__.pedersen_ptr", + "references": [ + { + "value": "[cast([fp + (-5)] + 1, starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 0, + "group": 18 + }, + "pc": 208 + }, + { + "value": "[cast(ap + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 52, + "group": 18 + }, + "pc": 216 + } + ], + "type": "reference" + }, + "__wrappers__.__default__.range_check_ptr": { + "cairo_type": "felt", + "full_name": "__wrappers__.__default__.range_check_ptr", + "references": [ + { + "value": "[cast([fp + (-5)] + 2, felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 18 + }, + "pc": 208 + }, + { + "value": "[cast(ap + (-3), felt*)]", + "ap_tracking_data": { + "offset": 52, + "group": 18 + }, + "pc": 216 + } + ], + "type": "reference" + }, + "__wrappers__.__default__.ret_value": { + "cairo_type": "(retdata_size: felt, retdata: felt*)", + "full_name": "__wrappers__.__default__.ret_value", + "references": [ + { + "value": "[cast(ap + (-2), (retdata_size: felt, retdata: felt*)*)]", + "ap_tracking_data": { + "offset": 52, + "group": 18 + }, + "pc": 216 + } + ], + "type": "reference" + }, + "__wrappers__.__default__.retdata": { + "cairo_type": "felt*", + "full_name": "__wrappers__.__default__.retdata", + "references": [ + { + "value": "[cast(ap + (-1), felt**)]", + "ap_tracking_data": { + "offset": 52, + "group": 18 + }, + "pc": 216 + } + ], + "type": "reference" + }, + "__wrappers__.__default__.retdata_size": { + "cairo_type": "felt", + "full_name": "__wrappers__.__default__.retdata_size", + "references": [ + { + "value": "[cast(ap + (-2), felt*)]", + "ap_tracking_data": { + "offset": 52, + "group": 18 + }, + "pc": 216 + } + ], + "type": "reference" + }, + "__wrappers__.__default__.syscall_ptr": { + "cairo_type": "felt*", + "full_name": "__wrappers__.__default__.syscall_ptr", + "references": [ + { + "value": "[cast([fp + (-5)], felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 18 + }, + "pc": 208 + }, + { + "value": "[cast(ap + (-5), felt**)]", + "ap_tracking_data": { + "offset": 52, + "group": 18 + }, + "pc": 216 + } + ], + "type": "reference" + }, + "__wrappers__.__default___encode_return.memcpy": { + "destination": "starkware.cairo.common.memcpy.memcpy", + "type": "alias" + }, + "__wrappers__.__l1_default__": { + "pc": 233, + "decorators": [ + "l1_handler", + "raw_input" + ], + "type": "function" + }, + "__wrappers__.__l1_default__.Args": { + "size": 0, + "full_name": "__wrappers__.__l1_default__.Args", + "members": {}, + "type": "struct" + }, + "__wrappers__.__l1_default__.ImplicitArgs": { + "size": 0, + "full_name": "__wrappers__.__l1_default__.ImplicitArgs", + "members": {}, + "type": "struct" + }, + "__wrappers__.__l1_default__.Return": { + "cairo_type": "(syscall_ptr: felt*, pedersen_ptr: starkware.cairo.common.cairo_builtins.HashBuiltin*, range_check_ptr: felt, size: felt, retdata: felt*)", + "type": "type_definition" + }, + "__wrappers__.__l1_default__.SIZEOF_LOCALS": { + "value": 0, + "type": "const" + }, + "__wrappers__.__l1_default__.__wrapped_func": { + "destination": "__main__.__l1_default__", + "type": "alias" + }, + "__wrappers__.__l1_default__.pedersen_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", + "full_name": "__wrappers__.__l1_default__.pedersen_ptr", + "references": [ + { + "value": "[cast([fp + (-5)] + 1, starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 0, + "group": 20 + }, + "pc": 233 + }, + { + "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 50, + "group": 20 + }, + "pc": 241 + } + ], + "type": "reference" + }, + "__wrappers__.__l1_default__.range_check_ptr": { + "cairo_type": "felt", + "full_name": "__wrappers__.__l1_default__.range_check_ptr", + "references": [ + { + "value": "[cast([fp + (-5)] + 2, felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 20 + }, + "pc": 233 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 50, + "group": 20 + }, + "pc": 241 + } + ], + "type": "reference" + }, + "__wrappers__.__l1_default__.ret_value": { + "cairo_type": "()", + "full_name": "__wrappers__.__l1_default__.ret_value", + "references": [ + { + "value": "[cast(ap + 0, ()*)]", + "ap_tracking_data": { + "offset": 50, + "group": 20 + }, + "pc": 241 + } + ], + "type": "reference" + }, + "__wrappers__.__l1_default__.retdata": { + "cairo_type": "felt*", + "full_name": "__wrappers__.__l1_default__.retdata", + "references": [ + { + "value": "[cast(ap + (-1), felt**)]", + "ap_tracking_data": { + "offset": 51, + "group": 20 + }, + "pc": 243 + } + ], + "type": "reference" + }, + "__wrappers__.__l1_default__.retdata_size": { + "cairo_type": "felt", + "full_name": "__wrappers__.__l1_default__.retdata_size", + "references": [ + { + "value": "cast(0, felt)", + "ap_tracking_data": { + "offset": 51, + "group": 20 + }, + "pc": 243 + } + ], + "type": "reference" + }, + "__wrappers__.__l1_default__.syscall_ptr": { + "cairo_type": "felt*", + "full_name": "__wrappers__.__l1_default__.syscall_ptr", + "references": [ + { + "value": "[cast([fp + (-5)], felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 20 + }, + "pc": 233 + }, + { + "value": "[cast(ap + (-3), felt**)]", + "ap_tracking_data": { + "offset": 50, + "group": 20 + }, + "pc": 241 + } + ], + "type": "reference" + }, + "__wrappers__.__l1_default___encode_return.memcpy": { + "destination": "starkware.cairo.common.memcpy.memcpy", + "type": "alias" + }, + "__wrappers__.constructor": { + "pc": 161, + "decorators": [ + "constructor" + ], + "type": "function" + }, + "__wrappers__.constructor.Args": { + "size": 0, + "full_name": "__wrappers__.constructor.Args", + "members": {}, + "type": "struct" + }, + "__wrappers__.constructor.ImplicitArgs": { + "size": 0, + "full_name": "__wrappers__.constructor.ImplicitArgs", + "members": {}, + "type": "struct" + }, + "__wrappers__.constructor.Return": { + "cairo_type": "(syscall_ptr: felt*, pedersen_ptr: starkware.cairo.common.cairo_builtins.HashBuiltin*, range_check_ptr: felt, size: felt, retdata: felt*)", + "type": "type_definition" + }, + "__wrappers__.constructor.SIZEOF_LOCALS": { + "value": 0, + "type": "const" + }, + "__wrappers__.constructor.__calldata_actual_size": { + "cairo_type": "felt", + "full_name": "__wrappers__.constructor.__calldata_actual_size", + "references": [ + { + "value": "cast([ap + (-1)] - [fp + (-3)], felt)", + "ap_tracking_data": { + "offset": 5, + "group": 15 + }, + "pc": 168 + } + ], + "type": "reference" + }, + "__wrappers__.constructor.__calldata_arg_calldata": { + "cairo_type": "felt*", + "full_name": "__wrappers__.constructor.__calldata_arg_calldata", + "references": [ + { + "value": "cast([fp + (-3)] + 3, felt*)", + "ap_tracking_data": { + "offset": 2, + "group": 15 + }, + "pc": 164 + } + ], + "type": "reference" + }, + "__wrappers__.constructor.__calldata_arg_calldata_len": { + "cairo_type": "felt", + "full_name": "__wrappers__.constructor.__calldata_arg_calldata_len", + "references": [ + { + "value": "[cast([fp + (-3)] + 2, felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 15 + }, + "pc": 161 + } + ], + "type": "reference" + }, + "__wrappers__.constructor.__calldata_arg_implementation_hash": { + "cairo_type": "felt", + "full_name": "__wrappers__.constructor.__calldata_arg_implementation_hash", + "references": [ + { + "value": "[cast([fp + (-3)], felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 15 + }, + "pc": 161 + } + ], + "type": "reference" + }, + "__wrappers__.constructor.__calldata_arg_selector": { + "cairo_type": "felt", + "full_name": "__wrappers__.constructor.__calldata_arg_selector", + "references": [ + { + "value": "[cast([fp + (-3)] + 1, felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 15 + }, + "pc": 161 + } + ], + "type": "reference" + }, + "__wrappers__.constructor.__calldata_ptr": { + "cairo_type": "felt*", + "full_name": "__wrappers__.constructor.__calldata_ptr", + "references": [ + { + "value": "[cast(fp + (-3), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 15 + }, + "pc": 161 + }, + { + "value": "cast([fp + (-3)] + 1, felt*)", + "ap_tracking_data": { + "offset": 0, + "group": 15 + }, + "pc": 161 + }, + { + "value": "cast([fp + (-3)] + 2, felt*)", + "ap_tracking_data": { + "offset": 0, + "group": 15 + }, + "pc": 161 + }, + { + "value": "cast([fp + (-3)] + 3, felt*)", + "ap_tracking_data": { + "offset": 0, + "group": 15 + }, + "pc": 161 + }, + { + "value": "[cast(ap + (-1), felt**)]", + "ap_tracking_data": { + "offset": 5, + "group": 15 + }, + "pc": 168 + } + ], + "type": "reference" + }, + "__wrappers__.constructor.__temp10": { + "cairo_type": "felt", + "full_name": "__wrappers__.constructor.__temp10", + "references": [ + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 4, + "group": 15 + }, + "pc": 167 + } + ], + "type": "reference" + }, + "__wrappers__.constructor.__temp11": { + "cairo_type": "felt", + "full_name": "__wrappers__.constructor.__temp11", + "references": [ + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 6, + "group": 15 + }, + "pc": 170 + } + ], + "type": "reference" + }, + "__wrappers__.constructor.__temp7": { + "cairo_type": "felt", + "full_name": "__wrappers__.constructor.__temp7", + "references": [ + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 1, + "group": 15 + }, + "pc": 162 + } + ], + "type": "reference" + }, + "__wrappers__.constructor.__temp8": { + "cairo_type": "felt", + "full_name": "__wrappers__.constructor.__temp8", + "references": [ + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 2, + "group": 15 + }, + "pc": 163 + } + ], + "type": "reference" + }, + "__wrappers__.constructor.__temp9": { + "cairo_type": "felt", + "full_name": "__wrappers__.constructor.__temp9", + "references": [ + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 3, + "group": 15 + }, + "pc": 166 + } + ], + "type": "reference" + }, + "__wrappers__.constructor.__wrapped_func": { + "destination": "__main__.constructor", + "type": "alias" + }, + "__wrappers__.constructor.pedersen_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", + "full_name": "__wrappers__.constructor.pedersen_ptr", + "references": [ + { + "value": "[cast([fp + (-5)] + 1, starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 0, + "group": 15 + }, + "pc": 161 + }, + { + "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 0, + "group": 16 + }, + "pc": 181 + } + ], + "type": "reference" + }, + "__wrappers__.constructor.range_check_ptr": { + "cairo_type": "felt", + "full_name": "__wrappers__.constructor.range_check_ptr", + "references": [ + { + "value": "[cast([fp + (-5)] + 2, felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 15 + }, + "pc": 161 + }, + { + "value": "cast([[fp + (-5)] + 2] + 1, felt)", + "ap_tracking_data": { + "offset": 2, + "group": 15 + }, + "pc": 164 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 16 + }, + "pc": 181 + } + ], + "type": "reference" + }, + "__wrappers__.constructor.ret_value": { + "cairo_type": "()", + "full_name": "__wrappers__.constructor.ret_value", + "references": [ + { + "value": "[cast(ap + 0, ()*)]", + "ap_tracking_data": { + "offset": 0, + "group": 16 + }, + "pc": 181 + } + ], + "type": "reference" + }, + "__wrappers__.constructor.retdata": { + "cairo_type": "felt*", + "full_name": "__wrappers__.constructor.retdata", + "references": [ + { + "value": "[cast(ap + (-1), felt**)]", + "ap_tracking_data": { + "offset": 1, + "group": 16 + }, + "pc": 183 + } + ], + "type": "reference" + }, + "__wrappers__.constructor.retdata_size": { + "cairo_type": "felt", + "full_name": "__wrappers__.constructor.retdata_size", + "references": [ + { + "value": "cast(0, felt)", + "ap_tracking_data": { + "offset": 1, + "group": 16 + }, + "pc": 183 + } + ], + "type": "reference" + }, + "__wrappers__.constructor.syscall_ptr": { + "cairo_type": "felt*", + "full_name": "__wrappers__.constructor.syscall_ptr", + "references": [ + { + "value": "[cast([fp + (-5)], felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 15 + }, + "pc": 161 + }, + { + "value": "[cast(ap + (-3), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 16 + }, + "pc": 181 + } + ], + "type": "reference" + }, + "__wrappers__.constructor_encode_return.memcpy": { + "destination": "starkware.cairo.common.memcpy.memcpy", + "type": "alias" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.AdminChanged": { + "type": "namespace" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.AdminChanged.Args": { + "size": 0, + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.AdminChanged.Args", + "members": {}, + "type": "struct" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.AdminChanged.ImplicitArgs": { + "size": 0, + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.AdminChanged.ImplicitArgs", + "members": {}, + "type": "struct" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.AdminChanged.Return": { + "cairo_type": "()", + "type": "type_definition" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.AdminChanged.SELECTOR": { + "value": 509549417648223859179470485411643110789099628436608877343164389163677637013, + "type": "const" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.AdminChanged.SIZEOF_LOCALS": { + "value": 0, + "type": "const" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.AdminChanged.alloc": { + "destination": "starkware.cairo.common.alloc.alloc", + "type": "alias" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.AdminChanged.emit_event": { + "destination": "starkware.starknet.common.syscalls.emit_event", + "type": "alias" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.AdminChanged.memcpy": { + "destination": "starkware.cairo.common.memcpy.memcpy", + "type": "alias" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.FALSE": { + "destination": "starkware.cairo.common.bool.FALSE", + "type": "alias" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.HashBuiltin": { + "destination": "starkware.cairo.common.cairo_builtins.HashBuiltin", + "type": "alias" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy": { + "type": "namespace" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy.Args": { + "size": 0, + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy.Args", + "members": {}, + "type": "struct" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy.ImplicitArgs": { + "size": 0, + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy.ImplicitArgs", + "members": {}, + "type": "struct" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy.Return": { + "cairo_type": "()", + "type": "type_definition" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy.SIZEOF_LOCALS": { + "value": 0, + "type": "const" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy._set_implementation_hash": { + "pc": 118, + "decorators": [], + "type": "function" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy._set_implementation_hash.Args": { + "size": 1, + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy._set_implementation_hash.Args", + "members": { + "new_implementation": { + "offset": 0, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy._set_implementation_hash.ImplicitArgs": { + "size": 3, + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy._set_implementation_hash.ImplicitArgs", + "members": { + "syscall_ptr": { + "offset": 0, + "cairo_type": "felt*" + }, + "pedersen_ptr": { + "offset": 1, + "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*" + }, + "range_check_ptr": { + "offset": 2, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy._set_implementation_hash.Return": { + "cairo_type": "()", + "type": "type_definition" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy._set_implementation_hash.SIZEOF_LOCALS": { + "value": 0, + "type": "const" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy._set_implementation_hash.new_implementation": { + "cairo_type": "felt", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy._set_implementation_hash.new_implementation", + "references": [ + { + "value": "[cast(fp + (-3), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 12 + }, + "pc": 118 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy._set_implementation_hash.pedersen_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy._set_implementation_hash.pedersen_ptr", + "references": [ + { + "value": "[cast(fp + (-5), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 0, + "group": 12 + }, + "pc": 118 + }, + { + "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 25, + "group": 12 + }, + "pc": 127 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy._set_implementation_hash.range_check_ptr": { + "cairo_type": "felt", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy._set_implementation_hash.range_check_ptr", + "references": [ + { + "value": "[cast(fp + (-4), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 12 + }, + "pc": 118 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 25, + "group": 12 + }, + "pc": 127 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 50, + "group": 12 + }, + "pc": 132 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy._set_implementation_hash.syscall_ptr": { + "cairo_type": "felt*", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy._set_implementation_hash.syscall_ptr", + "references": [ + { + "value": "[cast(fp + (-6), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 12 + }, + "pc": 118 + }, + { + "value": "[cast(ap + (-3), felt**)]", + "ap_tracking_data": { + "offset": 25, + "group": 12 + }, + "pc": 127 + }, + { + "value": "[cast(ap + (-2), felt**)]", + "ap_tracking_data": { + "offset": 50, + "group": 12 + }, + "pc": 132 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy.get_implementation_hash": { + "pc": 112, + "decorators": [], + "type": "function" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy.get_implementation_hash.Args": { + "size": 0, + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy.get_implementation_hash.Args", + "members": {}, + "type": "struct" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy.get_implementation_hash.ImplicitArgs": { + "size": 3, + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy.get_implementation_hash.ImplicitArgs", + "members": { + "syscall_ptr": { + "offset": 0, + "cairo_type": "felt*" + }, + "pedersen_ptr": { + "offset": 1, + "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*" + }, + "range_check_ptr": { + "offset": 2, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy.get_implementation_hash.Return": { + "cairo_type": "(implementation: felt)", + "type": "type_definition" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy.get_implementation_hash.SIZEOF_LOCALS": { + "value": 0, + "type": "const" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy.get_implementation_hash.pedersen_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy.get_implementation_hash.pedersen_ptr", + "references": [ + { + "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 0, + "group": 11 + }, + "pc": 112 + }, + { + "value": "[cast(ap + (-3), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 23, + "group": 11 + }, + "pc": 117 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy.get_implementation_hash.range_check_ptr": { + "cairo_type": "felt", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy.get_implementation_hash.range_check_ptr", + "references": [ + { + "value": "[cast(fp + (-3), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 11 + }, + "pc": 112 + }, + { + "value": "[cast(ap + (-2), felt*)]", + "ap_tracking_data": { + "offset": 23, + "group": 11 + }, + "pc": 117 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy.get_implementation_hash.syscall_ptr": { + "cairo_type": "felt*", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy.get_implementation_hash.syscall_ptr", + "references": [ + { + "value": "[cast(fp + (-5), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 11 + }, + "pc": 112 + }, + { + "value": "[cast(ap + (-4), felt**)]", + "ap_tracking_data": { + "offset": 23, + "group": 11 + }, + "pc": 117 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_admin": { + "type": "namespace" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_admin.Args": { + "size": 0, + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_admin.Args", + "members": {}, + "type": "struct" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_admin.HashBuiltin": { + "destination": "starkware.cairo.common.cairo_builtins.HashBuiltin", + "type": "alias" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_admin.ImplicitArgs": { + "size": 0, + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_admin.ImplicitArgs", + "members": {}, + "type": "struct" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_admin.Return": { + "cairo_type": "()", + "type": "type_definition" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_admin.SIZEOF_LOCALS": { + "value": 0, + "type": "const" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_admin.hash2": { + "destination": "starkware.cairo.common.hash.hash2", + "type": "alias" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_admin.normalize_address": { + "destination": "starkware.starknet.common.storage.normalize_address", + "type": "alias" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_admin.storage_read": { + "destination": "starkware.starknet.common.syscalls.storage_read", + "type": "alias" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_admin.storage_write": { + "destination": "starkware.starknet.common.syscalls.storage_write", + "type": "alias" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash": { + "type": "namespace" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.Args": { + "size": 0, + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.Args", + "members": {}, + "type": "struct" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.HashBuiltin": { + "destination": "starkware.cairo.common.cairo_builtins.HashBuiltin", + "type": "alias" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.ImplicitArgs": { + "size": 0, + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.ImplicitArgs", + "members": {}, + "type": "struct" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.Return": { + "cairo_type": "()", + "type": "type_definition" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.SIZEOF_LOCALS": { + "value": 0, + "type": "const" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.addr": { + "pc": 82, + "decorators": [], + "type": "function" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.addr.Args": { + "size": 0, + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.addr.Args", + "members": {}, + "type": "struct" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.addr.ImplicitArgs": { + "size": 2, + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.addr.ImplicitArgs", + "members": { + "pedersen_ptr": { + "offset": 0, + "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*" + }, + "range_check_ptr": { + "offset": 1, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.addr.Return": { + "cairo_type": "(res: felt)", + "type": "type_definition" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.addr.SIZEOF_LOCALS": { + "value": 0, + "type": "const" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.addr.pedersen_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.addr.pedersen_ptr", + "references": [ + { + "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 0, + "group": 8 + }, + "pc": 82 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.addr.range_check_ptr": { + "cairo_type": "felt", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.addr.range_check_ptr", + "references": [ + { + "value": "[cast(fp + (-3), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 8 + }, + "pc": 82 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.addr.res": { + "cairo_type": "felt", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.addr.res", + "references": [ + { + "value": "cast(1783935019461685855687084032167085762428877981963606680389089912112530844880, felt)", + "ap_tracking_data": { + "offset": 0, + "group": 8 + }, + "pc": 82 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.hash2": { + "destination": "starkware.cairo.common.hash.hash2", + "type": "alias" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.normalize_address": { + "destination": "starkware.starknet.common.storage.normalize_address", + "type": "alias" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.read": { + "pc": 87, + "decorators": [], + "type": "function" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.read.Args": { + "size": 0, + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.read.Args", + "members": {}, + "type": "struct" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.read.ImplicitArgs": { + "size": 3, + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.read.ImplicitArgs", + "members": { + "syscall_ptr": { + "offset": 0, + "cairo_type": "felt*" + }, + "pedersen_ptr": { + "offset": 1, + "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*" + }, + "range_check_ptr": { + "offset": 2, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.read.Return": { + "cairo_type": "(implementation: felt)", + "type": "type_definition" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.read.SIZEOF_LOCALS": { + "value": 0, + "type": "const" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.read.__storage_var_temp0": { + "cairo_type": "felt", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.read.__storage_var_temp0", + "references": [ + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 14, + "group": 9 + }, + "pc": 95 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 18, + "group": 9 + }, + "pc": 99 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.read.pedersen_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.read.pedersen_ptr", + "references": [ + { + "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 0, + "group": 9 + }, + "pc": 87 + }, + { + "value": "[cast(ap + (-3), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 7, + "group": 9 + }, + "pc": 91 + }, + { + "value": "[cast(ap + (-1), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 16, + "group": 9 + }, + "pc": 97 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.read.range_check_ptr": { + "cairo_type": "felt", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.read.range_check_ptr", + "references": [ + { + "value": "[cast(fp + (-3), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 9 + }, + "pc": 87 + }, + { + "value": "[cast(ap + (-2), felt*)]", + "ap_tracking_data": { + "offset": 7, + "group": 9 + }, + "pc": 91 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 17, + "group": 9 + }, + "pc": 98 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.read.storage_addr": { + "cairo_type": "felt", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.read.storage_addr", + "references": [ + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 7, + "group": 9 + }, + "pc": 91 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.read.syscall_ptr": { + "cairo_type": "felt*", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.read.syscall_ptr", + "references": [ + { + "value": "[cast(fp + (-5), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 9 + }, + "pc": 87 + }, + { + "value": "[cast(ap + (-2), felt**)]", + "ap_tracking_data": { + "offset": 14, + "group": 9 + }, + "pc": 95 + }, + { + "value": "[cast(ap + (-1), felt**)]", + "ap_tracking_data": { + "offset": 15, + "group": 9 + }, + "pc": 96 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.storage_read": { + "destination": "starkware.starknet.common.syscalls.storage_read", + "type": "alias" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.storage_write": { + "destination": "starkware.starknet.common.syscalls.storage_write", + "type": "alias" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.write": { + "pc": 100, + "decorators": [], + "type": "function" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.write.Args": { + "size": 1, + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.write.Args", + "members": { + "value": { + "offset": 0, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.write.ImplicitArgs": { + "size": 3, + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.write.ImplicitArgs", + "members": { + "syscall_ptr": { + "offset": 0, + "cairo_type": "felt*" + }, + "pedersen_ptr": { + "offset": 1, + "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*" + }, + "range_check_ptr": { + "offset": 2, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.write.Return": { + "cairo_type": "()", + "type": "type_definition" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.write.SIZEOF_LOCALS": { + "value": 0, + "type": "const" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.write.pedersen_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.write.pedersen_ptr", + "references": [ + { + "value": "[cast(fp + (-5), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 0, + "group": 10 + }, + "pc": 100 + }, + { + "value": "[cast(ap + (-3), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 7, + "group": 10 + }, + "pc": 104 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.write.range_check_ptr": { + "cairo_type": "felt", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.write.range_check_ptr", + "references": [ + { + "value": "[cast(fp + (-4), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 10 + }, + "pc": 100 + }, + { + "value": "[cast(ap + (-2), felt*)]", + "ap_tracking_data": { + "offset": 7, + "group": 10 + }, + "pc": 104 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.write.storage_addr": { + "cairo_type": "felt", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.write.storage_addr", + "references": [ + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 7, + "group": 10 + }, + "pc": 104 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.write.syscall_ptr": { + "cairo_type": "felt*", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.write.syscall_ptr", + "references": [ + { + "value": "[cast(fp + (-6), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 10 + }, + "pc": 100 + }, + { + "value": "[cast(ap + (-1), felt**)]", + "ap_tracking_data": { + "offset": 14, + "group": 10 + }, + "pc": 109 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.write.value": { + "cairo_type": "felt", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_implementation_hash.write.value", + "references": [ + { + "value": "[cast(fp + (-3), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 10 + }, + "pc": 100 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_initialized": { + "type": "namespace" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_initialized.Args": { + "size": 0, + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_initialized.Args", + "members": {}, + "type": "struct" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_initialized.HashBuiltin": { + "destination": "starkware.cairo.common.cairo_builtins.HashBuiltin", + "type": "alias" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_initialized.ImplicitArgs": { + "size": 0, + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_initialized.ImplicitArgs", + "members": {}, + "type": "struct" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_initialized.Return": { + "cairo_type": "()", + "type": "type_definition" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_initialized.SIZEOF_LOCALS": { + "value": 0, + "type": "const" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_initialized.hash2": { + "destination": "starkware.cairo.common.hash.hash2", + "type": "alias" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_initialized.normalize_address": { + "destination": "starkware.starknet.common.storage.normalize_address", + "type": "alias" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_initialized.storage_read": { + "destination": "starkware.starknet.common.syscalls.storage_read", + "type": "alias" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy_initialized.storage_write": { + "destination": "starkware.starknet.common.syscalls.storage_write", + "type": "alias" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.TRUE": { + "destination": "starkware.cairo.common.bool.TRUE", + "type": "alias" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded": { + "type": "namespace" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.Args": { + "size": 0, + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.Args", + "members": {}, + "type": "struct" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.ImplicitArgs": { + "size": 0, + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.ImplicitArgs", + "members": {}, + "type": "struct" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.Return": { + "cairo_type": "()", + "type": "type_definition" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.SELECTOR": { + "value": 1291924484015741933195105472014600539495279993452337828418116470835452386035, + "type": "const" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.SIZEOF_LOCALS": { + "value": 0, + "type": "const" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.alloc": { + "destination": "starkware.cairo.common.alloc.alloc", + "type": "alias" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.emit": { + "pc": 58, + "decorators": [], + "type": "function" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.emit.Args": { + "size": 1, + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.emit.Args", + "members": { + "implementation": { + "offset": 0, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.emit.ImplicitArgs": { + "size": 2, + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.emit.ImplicitArgs", + "members": { + "syscall_ptr": { + "offset": 0, + "cairo_type": "felt*" + }, + "range_check_ptr": { + "offset": 1, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.emit.Return": { + "cairo_type": "()", + "type": "type_definition" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.emit.SIZEOF_LOCALS": { + "value": 2, + "type": "const" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.emit.__calldata_ptr": { + "cairo_type": "felt*", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.emit.__calldata_ptr", + "references": [ + { + "value": "[cast(fp + 1, felt**)]", + "ap_tracking_data": { + "offset": 9, + "group": 7 + }, + "pc": 69 + }, + { + "value": "cast([fp + 1] + 1, felt*)", + "ap_tracking_data": { + "offset": 9, + "group": 7 + }, + "pc": 70 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.emit.__data_ptr": { + "cairo_type": "felt*", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.emit.__data_ptr", + "references": [ + { + "value": "[cast(ap + (-1), felt**)]", + "ap_tracking_data": { + "offset": 9, + "group": 7 + }, + "pc": 68 + }, + { + "value": "[cast(fp + 1, felt**)]", + "ap_tracking_data": { + "offset": 9, + "group": 7 + }, + "pc": 69 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.emit.__keys_ptr": { + "cairo_type": "felt*", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.emit.__keys_ptr", + "references": [ + { + "value": "[cast(ap + (-1), felt**)]", + "ap_tracking_data": { + "offset": 5, + "group": 7 + }, + "pc": 62 + }, + { + "value": "[cast(fp, felt**)]", + "ap_tracking_data": { + "offset": 5, + "group": 7 + }, + "pc": 63 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.emit.__temp5": { + "cairo_type": "felt", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.emit.__temp5", + "references": [ + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 6, + "group": 7 + }, + "pc": 65 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.emit.__temp6": { + "cairo_type": "felt", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.emit.__temp6", + "references": [ + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 10, + "group": 7 + }, + "pc": 72 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.emit.implementation": { + "cairo_type": "felt", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.emit.implementation", + "references": [ + { + "value": "[cast(fp + (-3), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 7 + }, + "pc": 58 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.emit.range_check_ptr": { + "cairo_type": "felt", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.emit.range_check_ptr", + "references": [ + { + "value": "[cast(fp + (-4), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 7 + }, + "pc": 58 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.emit.syscall_ptr": { + "cairo_type": "felt*", + "full_name": "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.emit.syscall_ptr", + "references": [ + { + "value": "[cast(fp + (-5), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 7 + }, + "pc": 58 + }, + { + "value": "[cast(ap + (-1), felt**)]", + "ap_tracking_data": { + "offset": 19, + "group": 7 + }, + "pc": 80 + } + ], + "type": "reference" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.emit_event": { + "destination": "starkware.starknet.common.syscalls.emit_event", + "type": "alias" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.Upgraded.memcpy": { + "destination": "starkware.cairo.common.memcpy.memcpy", + "type": "alias" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.assert_not_zero": { + "destination": "starkware.cairo.common.math.assert_not_zero", + "type": "alias" + }, + "cairo_contracts.src.openzeppelin.upgrades.library.get_caller_address": { + "destination": "starkware.starknet.common.syscalls.get_caller_address", + "type": "alias" + }, + "starkware.cairo.common.alloc.alloc": { + "pc": 0, + "decorators": [], + "type": "function" + }, + "starkware.cairo.common.alloc.alloc.Args": { + "size": 0, + "full_name": "starkware.cairo.common.alloc.alloc.Args", + "members": {}, + "type": "struct" + }, + "starkware.cairo.common.alloc.alloc.ImplicitArgs": { + "size": 0, + "full_name": "starkware.cairo.common.alloc.alloc.ImplicitArgs", + "members": {}, + "type": "struct" + }, + "starkware.cairo.common.alloc.alloc.Return": { + "cairo_type": "(ptr: felt*)", + "type": "type_definition" + }, + "starkware.cairo.common.alloc.alloc.SIZEOF_LOCALS": { + "value": 0, + "type": "const" + }, + "starkware.cairo.common.bool.FALSE": { + "value": 0, + "type": "const" + }, + "starkware.cairo.common.bool.TRUE": { + "value": 1, + "type": "const" + }, + "starkware.cairo.common.cairo_builtins.BitwiseBuiltin": { + "size": 5, + "full_name": "starkware.cairo.common.cairo_builtins.BitwiseBuiltin", + "members": { + "x": { + "offset": 0, + "cairo_type": "felt" + }, + "y": { + "offset": 1, + "cairo_type": "felt" + }, + "x_and_y": { + "offset": 2, + "cairo_type": "felt" + }, + "x_xor_y": { + "offset": 3, + "cairo_type": "felt" + }, + "x_or_y": { + "offset": 4, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.EcOpBuiltin": { + "size": 7, + "full_name": "starkware.cairo.common.cairo_builtins.EcOpBuiltin", + "members": { + "p": { + "offset": 0, + "cairo_type": "starkware.cairo.common.ec_point.EcPoint" + }, + "q": { + "offset": 2, + "cairo_type": "starkware.cairo.common.ec_point.EcPoint" + }, + "m": { + "offset": 4, + "cairo_type": "felt" + }, + "r": { + "offset": 5, + "cairo_type": "starkware.cairo.common.ec_point.EcPoint" + } + }, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.EcPoint": { + "destination": "starkware.cairo.common.ec_point.EcPoint", + "type": "alias" + }, + "starkware.cairo.common.cairo_builtins.HashBuiltin": { + "size": 3, + "full_name": "starkware.cairo.common.cairo_builtins.HashBuiltin", + "members": { + "x": { + "offset": 0, + "cairo_type": "felt" + }, + "y": { + "offset": 1, + "cairo_type": "felt" + }, + "result": { + "offset": 2, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.KeccakBuiltin": { + "size": 16, + "full_name": "starkware.cairo.common.cairo_builtins.KeccakBuiltin", + "members": { + "input": { + "offset": 0, + "cairo_type": "starkware.cairo.common.keccak_state.KeccakBuiltinState" + }, + "output": { + "offset": 8, + "cairo_type": "starkware.cairo.common.keccak_state.KeccakBuiltinState" + } + }, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.KeccakBuiltinState": { + "destination": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "type": "alias" + }, + "starkware.cairo.common.cairo_builtins.SignatureBuiltin": { + "size": 2, + "full_name": "starkware.cairo.common.cairo_builtins.SignatureBuiltin", + "members": { + "pub_key": { + "offset": 0, + "cairo_type": "felt" + }, + "message": { + "offset": 1, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "starkware.cairo.common.dict_access.DictAccess": { + "size": 3, + "full_name": "starkware.cairo.common.dict_access.DictAccess", + "members": { + "key": { + "offset": 0, + "cairo_type": "felt" + }, + "prev_value": { + "offset": 1, + "cairo_type": "felt" + }, + "new_value": { + "offset": 2, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "starkware.cairo.common.ec_point.EcPoint": { + "size": 2, + "full_name": "starkware.cairo.common.ec_point.EcPoint", + "members": { + "x": { + "offset": 0, + "cairo_type": "felt" + }, + "y": { + "offset": 1, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "starkware.cairo.common.hash.HashBuiltin": { + "destination": "starkware.cairo.common.cairo_builtins.HashBuiltin", + "type": "alias" + }, + "starkware.cairo.common.keccak_state.KeccakBuiltinState": { + "size": 8, + "full_name": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "members": { + "s0": { + "offset": 0, + "cairo_type": "felt" + }, + "s1": { + "offset": 1, + "cairo_type": "felt" + }, + "s2": { + "offset": 2, + "cairo_type": "felt" + }, + "s3": { + "offset": 3, + "cairo_type": "felt" + }, + "s4": { + "offset": 4, + "cairo_type": "felt" + }, + "s5": { + "offset": 5, + "cairo_type": "felt" + }, + "s6": { + "offset": 6, + "cairo_type": "felt" + }, + "s7": { + "offset": 7, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "starkware.cairo.common.math.FALSE": { + "destination": "starkware.cairo.common.bool.FALSE", + "type": "alias" + }, + "starkware.cairo.common.math.TRUE": { + "destination": "starkware.cairo.common.bool.TRUE", + "type": "alias" + }, + "starkware.cairo.common.math.assert_not_zero": { + "pc": 3, + "decorators": [], + "type": "function" + }, + "starkware.cairo.common.math.assert_not_zero.Args": { + "size": 1, + "full_name": "starkware.cairo.common.math.assert_not_zero.Args", + "members": { + "value": { + "offset": 0, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "starkware.cairo.common.math.assert_not_zero.ImplicitArgs": { + "size": 0, + "full_name": "starkware.cairo.common.math.assert_not_zero.ImplicitArgs", + "members": {}, + "type": "struct" + }, + "starkware.cairo.common.math.assert_not_zero.Return": { + "cairo_type": "()", + "type": "type_definition" + }, + "starkware.cairo.common.math.assert_not_zero.SIZEOF_LOCALS": { + "value": 0, + "type": "const" + }, + "starkware.cairo.common.math.assert_not_zero.value": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.math.assert_not_zero.value", + "references": [ + { + "value": "[cast(fp + (-3), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 1 + }, + "pc": 3 + } + ], + "type": "reference" + }, + "starkware.starknet.common.storage.ADDR_BOUND": { + "value": -106710729501573572985208420194530329073740042555888586719489, + "type": "const" + }, + "starkware.starknet.common.storage.MAX_STORAGE_ITEM_SIZE": { + "value": 256, + "type": "const" + }, + "starkware.starknet.common.storage.assert_250_bit": { + "destination": "starkware.cairo.common.math.assert_250_bit", + "type": "alias" + }, + "starkware.starknet.common.syscalls.CALL_CONTRACT_SELECTOR": { + "value": 20853273475220472486191784820, + "type": "const" + }, + "starkware.starknet.common.syscalls.CallContract": { + "size": 7, + "full_name": "starkware.starknet.common.syscalls.CallContract", + "members": { + "request": { + "offset": 0, + "cairo_type": "starkware.starknet.common.syscalls.CallContractRequest" + }, + "response": { + "offset": 5, + "cairo_type": "starkware.starknet.common.syscalls.CallContractResponse" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.CallContractRequest": { + "size": 5, + "full_name": "starkware.starknet.common.syscalls.CallContractRequest", + "members": { + "selector": { + "offset": 0, + "cairo_type": "felt" + }, + "contract_address": { + "offset": 1, + "cairo_type": "felt" + }, + "function_selector": { + "offset": 2, + "cairo_type": "felt" + }, + "calldata_size": { + "offset": 3, + "cairo_type": "felt" + }, + "calldata": { + "offset": 4, + "cairo_type": "felt*" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.CallContractResponse": { + "size": 2, + "full_name": "starkware.starknet.common.syscalls.CallContractResponse", + "members": { + "retdata_size": { + "offset": 0, + "cairo_type": "felt" + }, + "retdata": { + "offset": 1, + "cairo_type": "felt*" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.DELEGATE_CALL_SELECTOR": { + "value": 21167594061783206823196716140, + "type": "const" + }, + "starkware.starknet.common.syscalls.DELEGATE_L1_HANDLER_SELECTOR": { + "value": 23274015802972845247556842986379118667122, + "type": "const" + }, + "starkware.starknet.common.syscalls.DEPLOY_SELECTOR": { + "value": 75202468540281, + "type": "const" + }, + "starkware.starknet.common.syscalls.Deploy": { + "size": 9, + "full_name": "starkware.starknet.common.syscalls.Deploy", + "members": { + "request": { + "offset": 0, + "cairo_type": "starkware.starknet.common.syscalls.DeployRequest" + }, + "response": { + "offset": 6, + "cairo_type": "starkware.starknet.common.syscalls.DeployResponse" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.DeployRequest": { + "size": 6, + "full_name": "starkware.starknet.common.syscalls.DeployRequest", + "members": { + "selector": { + "offset": 0, + "cairo_type": "felt" + }, + "class_hash": { + "offset": 1, + "cairo_type": "felt" + }, + "contract_address_salt": { + "offset": 2, + "cairo_type": "felt" + }, + "constructor_calldata_size": { + "offset": 3, + "cairo_type": "felt" + }, + "constructor_calldata": { + "offset": 4, + "cairo_type": "felt*" + }, + "deploy_from_zero": { + "offset": 5, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.DeployResponse": { + "size": 3, + "full_name": "starkware.starknet.common.syscalls.DeployResponse", + "members": { + "contract_address": { + "offset": 0, + "cairo_type": "felt" + }, + "constructor_retdata_size": { + "offset": 1, + "cairo_type": "felt" + }, + "constructor_retdata": { + "offset": 2, + "cairo_type": "felt*" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.DictAccess": { + "destination": "starkware.cairo.common.dict_access.DictAccess", + "type": "alias" + }, + "starkware.starknet.common.syscalls.EMIT_EVENT_SELECTOR": { + "value": 1280709301550335749748, + "type": "const" + }, + "starkware.starknet.common.syscalls.EmitEvent": { + "size": 5, + "full_name": "starkware.starknet.common.syscalls.EmitEvent", + "members": { + "selector": { + "offset": 0, + "cairo_type": "felt" + }, + "keys_len": { + "offset": 1, + "cairo_type": "felt" + }, + "keys": { + "offset": 2, + "cairo_type": "felt*" + }, + "data_len": { + "offset": 3, + "cairo_type": "felt" + }, + "data": { + "offset": 4, + "cairo_type": "felt*" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GET_BLOCK_NUMBER_SELECTOR": { + "value": 1448089106835523001438702345020786, + "type": "const" + }, + "starkware.starknet.common.syscalls.GET_BLOCK_TIMESTAMP_SELECTOR": { + "value": 24294903732626645868215235778792757751152, + "type": "const" + }, + "starkware.starknet.common.syscalls.GET_CALLER_ADDRESS_SELECTOR": { + "value": 94901967781393078444254803017658102643, + "type": "const" + }, + "starkware.starknet.common.syscalls.GET_CONTRACT_ADDRESS_SELECTOR": { + "value": 6219495360805491471215297013070624192820083, + "type": "const" + }, + "starkware.starknet.common.syscalls.GET_SEQUENCER_ADDRESS_SELECTOR": { + "value": 1592190833581991703053805829594610833820054387, + "type": "const" + }, + "starkware.starknet.common.syscalls.GET_TX_INFO_SELECTOR": { + "value": 1317029390204112103023, + "type": "const" + }, + "starkware.starknet.common.syscalls.GET_TX_SIGNATURE_SELECTOR": { + "value": 1448089128652340074717162277007973, + "type": "const" + }, + "starkware.starknet.common.syscalls.GetBlockNumber": { + "size": 2, + "full_name": "starkware.starknet.common.syscalls.GetBlockNumber", + "members": { + "request": { + "offset": 0, + "cairo_type": "starkware.starknet.common.syscalls.GetBlockNumberRequest" + }, + "response": { + "offset": 1, + "cairo_type": "starkware.starknet.common.syscalls.GetBlockNumberResponse" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetBlockNumberRequest": { + "size": 1, + "full_name": "starkware.starknet.common.syscalls.GetBlockNumberRequest", + "members": { + "selector": { + "offset": 0, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetBlockNumberResponse": { + "size": 1, + "full_name": "starkware.starknet.common.syscalls.GetBlockNumberResponse", + "members": { + "block_number": { + "offset": 0, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetBlockTimestamp": { + "size": 2, + "full_name": "starkware.starknet.common.syscalls.GetBlockTimestamp", + "members": { + "request": { + "offset": 0, + "cairo_type": "starkware.starknet.common.syscalls.GetBlockTimestampRequest" + }, + "response": { + "offset": 1, + "cairo_type": "starkware.starknet.common.syscalls.GetBlockTimestampResponse" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetBlockTimestampRequest": { + "size": 1, + "full_name": "starkware.starknet.common.syscalls.GetBlockTimestampRequest", + "members": { + "selector": { + "offset": 0, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetBlockTimestampResponse": { + "size": 1, + "full_name": "starkware.starknet.common.syscalls.GetBlockTimestampResponse", + "members": { + "block_timestamp": { + "offset": 0, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetCallerAddress": { + "size": 2, + "full_name": "starkware.starknet.common.syscalls.GetCallerAddress", + "members": { + "request": { + "offset": 0, + "cairo_type": "starkware.starknet.common.syscalls.GetCallerAddressRequest" + }, + "response": { + "offset": 1, + "cairo_type": "starkware.starknet.common.syscalls.GetCallerAddressResponse" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetCallerAddressRequest": { + "size": 1, + "full_name": "starkware.starknet.common.syscalls.GetCallerAddressRequest", + "members": { + "selector": { + "offset": 0, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetCallerAddressResponse": { + "size": 1, + "full_name": "starkware.starknet.common.syscalls.GetCallerAddressResponse", + "members": { + "caller_address": { + "offset": 0, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetContractAddress": { + "size": 2, + "full_name": "starkware.starknet.common.syscalls.GetContractAddress", + "members": { + "request": { + "offset": 0, + "cairo_type": "starkware.starknet.common.syscalls.GetContractAddressRequest" + }, + "response": { + "offset": 1, + "cairo_type": "starkware.starknet.common.syscalls.GetContractAddressResponse" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetContractAddressRequest": { + "size": 1, + "full_name": "starkware.starknet.common.syscalls.GetContractAddressRequest", + "members": { + "selector": { + "offset": 0, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetContractAddressResponse": { + "size": 1, + "full_name": "starkware.starknet.common.syscalls.GetContractAddressResponse", + "members": { + "contract_address": { + "offset": 0, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetSequencerAddress": { + "size": 2, + "full_name": "starkware.starknet.common.syscalls.GetSequencerAddress", + "members": { + "request": { + "offset": 0, + "cairo_type": "starkware.starknet.common.syscalls.GetSequencerAddressRequest" + }, + "response": { + "offset": 1, + "cairo_type": "starkware.starknet.common.syscalls.GetSequencerAddressResponse" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetSequencerAddressRequest": { + "size": 1, + "full_name": "starkware.starknet.common.syscalls.GetSequencerAddressRequest", + "members": { + "selector": { + "offset": 0, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetSequencerAddressResponse": { + "size": 1, + "full_name": "starkware.starknet.common.syscalls.GetSequencerAddressResponse", + "members": { + "sequencer_address": { + "offset": 0, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetTxInfo": { + "size": 2, + "full_name": "starkware.starknet.common.syscalls.GetTxInfo", + "members": { + "request": { + "offset": 0, + "cairo_type": "starkware.starknet.common.syscalls.GetTxInfoRequest" + }, + "response": { + "offset": 1, + "cairo_type": "starkware.starknet.common.syscalls.GetTxInfoResponse" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetTxInfoRequest": { + "size": 1, + "full_name": "starkware.starknet.common.syscalls.GetTxInfoRequest", + "members": { + "selector": { + "offset": 0, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetTxInfoResponse": { + "size": 1, + "full_name": "starkware.starknet.common.syscalls.GetTxInfoResponse", + "members": { + "tx_info": { + "offset": 0, + "cairo_type": "starkware.starknet.common.syscalls.TxInfo*" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetTxSignature": { + "size": 3, + "full_name": "starkware.starknet.common.syscalls.GetTxSignature", + "members": { + "request": { + "offset": 0, + "cairo_type": "starkware.starknet.common.syscalls.GetTxSignatureRequest" + }, + "response": { + "offset": 1, + "cairo_type": "starkware.starknet.common.syscalls.GetTxSignatureResponse" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetTxSignatureRequest": { + "size": 1, + "full_name": "starkware.starknet.common.syscalls.GetTxSignatureRequest", + "members": { + "selector": { + "offset": 0, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.GetTxSignatureResponse": { + "size": 2, + "full_name": "starkware.starknet.common.syscalls.GetTxSignatureResponse", + "members": { + "signature_len": { + "offset": 0, + "cairo_type": "felt" + }, + "signature": { + "offset": 1, + "cairo_type": "felt*" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.LIBRARY_CALL_L1_HANDLER_SELECTOR": { + "value": 436233452754198157705746250789557519228244616562, + "type": "const" + }, + "starkware.starknet.common.syscalls.LIBRARY_CALL_SELECTOR": { + "value": 92376026794327011772951660, + "type": "const" + }, + "starkware.starknet.common.syscalls.LibraryCall": { + "size": 7, + "full_name": "starkware.starknet.common.syscalls.LibraryCall", + "members": { + "request": { + "offset": 0, + "cairo_type": "starkware.starknet.common.syscalls.LibraryCallRequest" + }, + "response": { + "offset": 5, + "cairo_type": "starkware.starknet.common.syscalls.CallContractResponse" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.LibraryCallRequest": { + "size": 5, + "full_name": "starkware.starknet.common.syscalls.LibraryCallRequest", + "members": { + "selector": { + "offset": 0, + "cairo_type": "felt" + }, + "class_hash": { + "offset": 1, + "cairo_type": "felt" + }, + "function_selector": { + "offset": 2, + "cairo_type": "felt" + }, + "calldata_size": { + "offset": 3, + "cairo_type": "felt" + }, + "calldata": { + "offset": 4, + "cairo_type": "felt*" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.SEND_MESSAGE_TO_L1_SELECTOR": { + "value": 433017908768303439907196859243777073, + "type": "const" + }, + "starkware.starknet.common.syscalls.STORAGE_READ_SELECTOR": { + "value": 100890693370601760042082660, + "type": "const" + }, + "starkware.starknet.common.syscalls.STORAGE_WRITE_SELECTOR": { + "value": 25828017502874050592466629733, + "type": "const" + }, + "starkware.starknet.common.syscalls.SendMessageToL1SysCall": { + "size": 4, + "full_name": "starkware.starknet.common.syscalls.SendMessageToL1SysCall", + "members": { + "selector": { + "offset": 0, + "cairo_type": "felt" + }, + "to_address": { + "offset": 1, + "cairo_type": "felt" + }, + "payload_size": { + "offset": 2, + "cairo_type": "felt" + }, + "payload_ptr": { + "offset": 3, + "cairo_type": "felt*" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.StorageRead": { + "size": 3, + "full_name": "starkware.starknet.common.syscalls.StorageRead", + "members": { + "request": { + "offset": 0, + "cairo_type": "starkware.starknet.common.syscalls.StorageReadRequest" + }, + "response": { + "offset": 2, + "cairo_type": "starkware.starknet.common.syscalls.StorageReadResponse" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.StorageReadRequest": { + "size": 2, + "full_name": "starkware.starknet.common.syscalls.StorageReadRequest", + "members": { + "selector": { + "offset": 0, + "cairo_type": "felt" + }, + "address": { + "offset": 1, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.StorageReadResponse": { + "size": 1, + "full_name": "starkware.starknet.common.syscalls.StorageReadResponse", + "members": { + "value": { + "offset": 0, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.StorageWrite": { + "size": 3, + "full_name": "starkware.starknet.common.syscalls.StorageWrite", + "members": { + "selector": { + "offset": 0, + "cairo_type": "felt" + }, + "address": { + "offset": 1, + "cairo_type": "felt" + }, + "value": { + "offset": 2, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.TxInfo": { + "size": 8, + "full_name": "starkware.starknet.common.syscalls.TxInfo", + "members": { + "version": { + "offset": 0, + "cairo_type": "felt" + }, + "account_contract_address": { + "offset": 1, + "cairo_type": "felt" + }, + "max_fee": { + "offset": 2, + "cairo_type": "felt" + }, + "signature_len": { + "offset": 3, + "cairo_type": "felt" + }, + "signature": { + "offset": 4, + "cairo_type": "felt*" + }, + "transaction_hash": { + "offset": 5, + "cairo_type": "felt" + }, + "chain_id": { + "offset": 6, + "cairo_type": "felt" + }, + "nonce": { + "offset": 7, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.emit_event": { + "pc": 48, + "decorators": [], + "type": "function" + }, + "starkware.starknet.common.syscalls.emit_event.Args": { + "size": 4, + "full_name": "starkware.starknet.common.syscalls.emit_event.Args", + "members": { + "keys_len": { + "offset": 0, + "cairo_type": "felt" + }, + "keys": { + "offset": 1, + "cairo_type": "felt*" + }, + "data_len": { + "offset": 2, + "cairo_type": "felt" + }, + "data": { + "offset": 3, + "cairo_type": "felt*" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.emit_event.ImplicitArgs": { + "size": 1, + "full_name": "starkware.starknet.common.syscalls.emit_event.ImplicitArgs", + "members": { + "syscall_ptr": { + "offset": 0, + "cairo_type": "felt*" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.emit_event.Return": { + "cairo_type": "()", + "type": "type_definition" + }, + "starkware.starknet.common.syscalls.emit_event.SIZEOF_LOCALS": { + "value": 0, + "type": "const" + }, + "starkware.starknet.common.syscalls.emit_event.__temp4": { + "cairo_type": "felt", + "full_name": "starkware.starknet.common.syscalls.emit_event.__temp4", + "references": [ + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 1, + "group": 6 + }, + "pc": 50 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.emit_event.data": { + "cairo_type": "felt*", + "full_name": "starkware.starknet.common.syscalls.emit_event.data", + "references": [ + { + "value": "[cast(fp + (-3), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 6 + }, + "pc": 48 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.emit_event.data_len": { + "cairo_type": "felt", + "full_name": "starkware.starknet.common.syscalls.emit_event.data_len", + "references": [ + { + "value": "[cast(fp + (-4), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 6 + }, + "pc": 48 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.emit_event.keys": { + "cairo_type": "felt*", + "full_name": "starkware.starknet.common.syscalls.emit_event.keys", + "references": [ + { + "value": "[cast(fp + (-5), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 6 + }, + "pc": 48 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.emit_event.keys_len": { + "cairo_type": "felt", + "full_name": "starkware.starknet.common.syscalls.emit_event.keys_len", + "references": [ + { + "value": "[cast(fp + (-6), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 6 + }, + "pc": 48 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.emit_event.syscall_ptr": { + "cairo_type": "felt*", + "full_name": "starkware.starknet.common.syscalls.emit_event.syscall_ptr", + "references": [ + { + "value": "[cast(fp + (-7), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 6 + }, + "pc": 48 + }, + { + "value": "cast([fp + (-7)] + 5, felt*)", + "ap_tracking_data": { + "offset": 1, + "group": 6 + }, + "pc": 55 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.library_call": { + "pc": 8, + "decorators": [], + "type": "function" + }, + "starkware.starknet.common.syscalls.library_call.Args": { + "size": 4, + "full_name": "starkware.starknet.common.syscalls.library_call.Args", + "members": { + "class_hash": { + "offset": 0, + "cairo_type": "felt" + }, + "function_selector": { + "offset": 1, + "cairo_type": "felt" + }, + "calldata_size": { + "offset": 2, + "cairo_type": "felt" + }, + "calldata": { + "offset": 3, + "cairo_type": "felt*" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.library_call.ImplicitArgs": { + "size": 1, + "full_name": "starkware.starknet.common.syscalls.library_call.ImplicitArgs", + "members": { + "syscall_ptr": { + "offset": 0, + "cairo_type": "felt*" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.library_call.Return": { + "cairo_type": "(retdata_size: felt, retdata: felt*)", + "type": "type_definition" + }, + "starkware.starknet.common.syscalls.library_call.SIZEOF_LOCALS": { + "value": 0, + "type": "const" + }, + "starkware.starknet.common.syscalls.library_call.__temp0": { + "cairo_type": "felt", + "full_name": "starkware.starknet.common.syscalls.library_call.__temp0", + "references": [ + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 1, + "group": 2 + }, + "pc": 10 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.library_call.calldata": { + "cairo_type": "felt*", + "full_name": "starkware.starknet.common.syscalls.library_call.calldata", + "references": [ + { + "value": "[cast(fp + (-3), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 2 + }, + "pc": 8 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.library_call.calldata_size": { + "cairo_type": "felt", + "full_name": "starkware.starknet.common.syscalls.library_call.calldata_size", + "references": [ + { + "value": "[cast(fp + (-4), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 2 + }, + "pc": 8 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.library_call.class_hash": { + "cairo_type": "felt", + "full_name": "starkware.starknet.common.syscalls.library_call.class_hash", + "references": [ + { + "value": "[cast(fp + (-6), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 2 + }, + "pc": 8 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.library_call.function_selector": { + "cairo_type": "felt", + "full_name": "starkware.starknet.common.syscalls.library_call.function_selector", + "references": [ + { + "value": "[cast(fp + (-5), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 2 + }, + "pc": 8 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.library_call.response": { + "cairo_type": "starkware.starknet.common.syscalls.CallContractResponse", + "full_name": "starkware.starknet.common.syscalls.library_call.response", + "references": [ + { + "value": "[cast([fp + (-7)] + 5, starkware.starknet.common.syscalls.CallContractResponse*)]", + "ap_tracking_data": { + "offset": 1, + "group": 2 + }, + "pc": 15 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.library_call.syscall": { + "cairo_type": "starkware.starknet.common.syscalls.LibraryCall", + "full_name": "starkware.starknet.common.syscalls.library_call.syscall", + "references": [ + { + "value": "[cast([fp + (-7)], starkware.starknet.common.syscalls.LibraryCall*)]", + "ap_tracking_data": { + "offset": 0, + "group": 2 + }, + "pc": 8 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.library_call.syscall_ptr": { + "cairo_type": "felt*", + "full_name": "starkware.starknet.common.syscalls.library_call.syscall_ptr", + "references": [ + { + "value": "[cast(fp + (-7), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 2 + }, + "pc": 8 + }, + { + "value": "cast([fp + (-7)] + 7, felt*)", + "ap_tracking_data": { + "offset": 1, + "group": 2 + }, + "pc": 15 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.library_call_l1_handler": { + "pc": 20, + "decorators": [], + "type": "function" + }, + "starkware.starknet.common.syscalls.library_call_l1_handler.Args": { + "size": 4, + "full_name": "starkware.starknet.common.syscalls.library_call_l1_handler.Args", + "members": { + "class_hash": { + "offset": 0, + "cairo_type": "felt" + }, + "function_selector": { + "offset": 1, + "cairo_type": "felt" + }, + "calldata_size": { + "offset": 2, + "cairo_type": "felt" + }, + "calldata": { + "offset": 3, + "cairo_type": "felt*" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.library_call_l1_handler.ImplicitArgs": { + "size": 1, + "full_name": "starkware.starknet.common.syscalls.library_call_l1_handler.ImplicitArgs", + "members": { + "syscall_ptr": { + "offset": 0, + "cairo_type": "felt*" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.library_call_l1_handler.Return": { + "cairo_type": "(retdata_size: felt, retdata: felt*)", + "type": "type_definition" + }, + "starkware.starknet.common.syscalls.library_call_l1_handler.SIZEOF_LOCALS": { + "value": 0, + "type": "const" + }, + "starkware.starknet.common.syscalls.library_call_l1_handler.__temp1": { + "cairo_type": "felt", + "full_name": "starkware.starknet.common.syscalls.library_call_l1_handler.__temp1", + "references": [ + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 1, + "group": 3 + }, + "pc": 22 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.library_call_l1_handler.calldata": { + "cairo_type": "felt*", + "full_name": "starkware.starknet.common.syscalls.library_call_l1_handler.calldata", + "references": [ + { + "value": "[cast(fp + (-3), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 3 + }, + "pc": 20 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.library_call_l1_handler.calldata_size": { + "cairo_type": "felt", + "full_name": "starkware.starknet.common.syscalls.library_call_l1_handler.calldata_size", + "references": [ + { + "value": "[cast(fp + (-4), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 3 + }, + "pc": 20 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.library_call_l1_handler.class_hash": { + "cairo_type": "felt", + "full_name": "starkware.starknet.common.syscalls.library_call_l1_handler.class_hash", + "references": [ + { + "value": "[cast(fp + (-6), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 3 + }, + "pc": 20 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.library_call_l1_handler.function_selector": { + "cairo_type": "felt", + "full_name": "starkware.starknet.common.syscalls.library_call_l1_handler.function_selector", + "references": [ + { + "value": "[cast(fp + (-5), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 3 + }, + "pc": 20 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.library_call_l1_handler.response": { + "cairo_type": "starkware.starknet.common.syscalls.CallContractResponse", + "full_name": "starkware.starknet.common.syscalls.library_call_l1_handler.response", + "references": [ + { + "value": "[cast([fp + (-7)] + 5, starkware.starknet.common.syscalls.CallContractResponse*)]", + "ap_tracking_data": { + "offset": 1, + "group": 3 + }, + "pc": 27 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.library_call_l1_handler.syscall": { + "cairo_type": "starkware.starknet.common.syscalls.LibraryCall", + "full_name": "starkware.starknet.common.syscalls.library_call_l1_handler.syscall", + "references": [ + { + "value": "[cast([fp + (-7)], starkware.starknet.common.syscalls.LibraryCall*)]", + "ap_tracking_data": { + "offset": 0, + "group": 3 + }, + "pc": 20 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.library_call_l1_handler.syscall_ptr": { + "cairo_type": "felt*", + "full_name": "starkware.starknet.common.syscalls.library_call_l1_handler.syscall_ptr", + "references": [ + { + "value": "[cast(fp + (-7), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 3 + }, + "pc": 20 + }, + { + "value": "cast([fp + (-7)] + 7, felt*)", + "ap_tracking_data": { + "offset": 1, + "group": 3 + }, + "pc": 27 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.storage_read": { + "pc": 32, + "decorators": [], + "type": "function" + }, + "starkware.starknet.common.syscalls.storage_read.Args": { + "size": 1, + "full_name": "starkware.starknet.common.syscalls.storage_read.Args", + "members": { + "address": { + "offset": 0, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.storage_read.ImplicitArgs": { + "size": 1, + "full_name": "starkware.starknet.common.syscalls.storage_read.ImplicitArgs", + "members": { + "syscall_ptr": { + "offset": 0, + "cairo_type": "felt*" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.storage_read.Return": { + "cairo_type": "(value: felt)", + "type": "type_definition" + }, + "starkware.starknet.common.syscalls.storage_read.SIZEOF_LOCALS": { + "value": 0, + "type": "const" + }, + "starkware.starknet.common.syscalls.storage_read.__temp2": { + "cairo_type": "felt", + "full_name": "starkware.starknet.common.syscalls.storage_read.__temp2", + "references": [ + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 1, + "group": 4 + }, + "pc": 34 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.storage_read.address": { + "cairo_type": "felt", + "full_name": "starkware.starknet.common.syscalls.storage_read.address", + "references": [ + { + "value": "[cast(fp + (-3), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 4 + }, + "pc": 32 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.storage_read.response": { + "cairo_type": "starkware.starknet.common.syscalls.StorageReadResponse", + "full_name": "starkware.starknet.common.syscalls.storage_read.response", + "references": [ + { + "value": "[cast([fp + (-4)] + 2, starkware.starknet.common.syscalls.StorageReadResponse*)]", + "ap_tracking_data": { + "offset": 1, + "group": 4 + }, + "pc": 36 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.storage_read.syscall": { + "cairo_type": "starkware.starknet.common.syscalls.StorageRead", + "full_name": "starkware.starknet.common.syscalls.storage_read.syscall", + "references": [ + { + "value": "[cast([fp + (-4)], starkware.starknet.common.syscalls.StorageRead*)]", + "ap_tracking_data": { + "offset": 0, + "group": 4 + }, + "pc": 32 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.storage_read.syscall_ptr": { + "cairo_type": "felt*", + "full_name": "starkware.starknet.common.syscalls.storage_read.syscall_ptr", + "references": [ + { + "value": "[cast(fp + (-4), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 4 + }, + "pc": 32 + }, + { + "value": "cast([fp + (-4)] + 3, felt*)", + "ap_tracking_data": { + "offset": 1, + "group": 4 + }, + "pc": 36 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.storage_write": { + "pc": 40, + "decorators": [], + "type": "function" + }, + "starkware.starknet.common.syscalls.storage_write.Args": { + "size": 2, + "full_name": "starkware.starknet.common.syscalls.storage_write.Args", + "members": { + "address": { + "offset": 0, + "cairo_type": "felt" + }, + "value": { + "offset": 1, + "cairo_type": "felt" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.storage_write.ImplicitArgs": { + "size": 1, + "full_name": "starkware.starknet.common.syscalls.storage_write.ImplicitArgs", + "members": { + "syscall_ptr": { + "offset": 0, + "cairo_type": "felt*" + } + }, + "type": "struct" + }, + "starkware.starknet.common.syscalls.storage_write.Return": { + "cairo_type": "()", + "type": "type_definition" + }, + "starkware.starknet.common.syscalls.storage_write.SIZEOF_LOCALS": { + "value": 0, + "type": "const" + }, + "starkware.starknet.common.syscalls.storage_write.__temp3": { + "cairo_type": "felt", + "full_name": "starkware.starknet.common.syscalls.storage_write.__temp3", + "references": [ + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 1, + "group": 5 + }, + "pc": 42 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.storage_write.address": { + "cairo_type": "felt", + "full_name": "starkware.starknet.common.syscalls.storage_write.address", + "references": [ + { + "value": "[cast(fp + (-4), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 5 + }, + "pc": 40 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.storage_write.syscall_ptr": { + "cairo_type": "felt*", + "full_name": "starkware.starknet.common.syscalls.storage_write.syscall_ptr", + "references": [ + { + "value": "[cast(fp + (-5), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 5 + }, + "pc": 40 + }, + { + "value": "cast([fp + (-5)] + 3, felt*)", + "ap_tracking_data": { + "offset": 1, + "group": 5 + }, + "pc": 45 + } + ], + "type": "reference" + }, + "starkware.starknet.common.syscalls.storage_write.value": { + "cairo_type": "felt", + "full_name": "starkware.starknet.common.syscalls.storage_write.value", + "references": [ + { + "value": "[cast(fp + (-3), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 5 + }, + "pc": 40 + } + ], + "type": "reference" + } + }, + "attributes": [ + { + "start_pc": 118, + "flow_tracking_data": { + "reference_ids": { + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy._set_implementation_hash.new_implementation": 78, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy._set_implementation_hash.pedersen_ptr": 80, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy._set_implementation_hash.range_check_ptr": 81, + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy._set_implementation_hash.syscall_ptr": 79 + }, + "ap_tracking": { + "offset": 0, + "group": 12 + } + }, + "value": "Proxy: implementation hash cannot be zero", + "accessible_scopes": [ + "cairo_contracts.src.openzeppelin.upgrades.library", + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy", + "cairo_contracts.src.openzeppelin.upgrades.library.Proxy._set_implementation_hash" + ], + "name": "error_message", + "end_pc": 121 + } + ], + "reference_manager": { + "references": [ + { + "value": "[cast(fp + (-3), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 1 + }, + "pc": 3 + }, + { + "value": "[cast(fp + (-6), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 2 + }, + "pc": 8 + }, + { + "value": "[cast(fp + (-5), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 2 + }, + "pc": 8 + }, + { + "value": "[cast(fp + (-4), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 2 + }, + "pc": 8 + }, + { + "value": "[cast(fp + (-3), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 2 + }, + "pc": 8 + }, + { + "value": "[cast(fp + (-7), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 2 + }, + "pc": 8 + }, + { + "value": "[cast([fp + (-7)], starkware.starknet.common.syscalls.LibraryCall*)]", + "ap_tracking_data": { + "offset": 0, + "group": 2 + }, + "pc": 8 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 1, + "group": 2 + }, + "pc": 10 + }, + { + "value": "[cast([fp + (-7)] + 5, starkware.starknet.common.syscalls.CallContractResponse*)]", + "ap_tracking_data": { + "offset": 1, + "group": 2 + }, + "pc": 15 + }, + { + "value": "cast([fp + (-7)] + 7, felt*)", + "ap_tracking_data": { + "offset": 1, + "group": 2 + }, + "pc": 15 + }, + { + "value": "[cast(fp + (-6), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 3 + }, + "pc": 20 + }, + { + "value": "[cast(fp + (-5), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 3 + }, + "pc": 20 + }, + { + "value": "[cast(fp + (-4), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 3 + }, + "pc": 20 + }, + { + "value": "[cast(fp + (-3), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 3 + }, + "pc": 20 + }, + { + "value": "[cast(fp + (-7), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 3 + }, + "pc": 20 + }, + { + "value": "[cast([fp + (-7)], starkware.starknet.common.syscalls.LibraryCall*)]", + "ap_tracking_data": { + "offset": 0, + "group": 3 + }, + "pc": 20 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 1, + "group": 3 + }, + "pc": 22 + }, + { + "value": "[cast([fp + (-7)] + 5, starkware.starknet.common.syscalls.CallContractResponse*)]", + "ap_tracking_data": { + "offset": 1, + "group": 3 + }, + "pc": 27 + }, + { + "value": "cast([fp + (-7)] + 7, felt*)", + "ap_tracking_data": { + "offset": 1, + "group": 3 + }, + "pc": 27 + }, + { + "value": "[cast(fp + (-3), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 4 + }, + "pc": 32 + }, + { + "value": "[cast(fp + (-4), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 4 + }, + "pc": 32 + }, + { + "value": "[cast([fp + (-4)], starkware.starknet.common.syscalls.StorageRead*)]", + "ap_tracking_data": { + "offset": 0, + "group": 4 + }, + "pc": 32 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 1, + "group": 4 + }, + "pc": 34 + }, + { + "value": "[cast([fp + (-4)] + 2, starkware.starknet.common.syscalls.StorageReadResponse*)]", + "ap_tracking_data": { + "offset": 1, + "group": 4 + }, + "pc": 36 + }, + { + "value": "cast([fp + (-4)] + 3, felt*)", + "ap_tracking_data": { + "offset": 1, + "group": 4 + }, + "pc": 36 + }, + { + "value": "[cast(fp + (-4), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 5 + }, + "pc": 40 + }, + { + "value": "[cast(fp + (-3), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 5 + }, + "pc": 40 + }, + { + "value": "[cast(fp + (-5), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 5 + }, + "pc": 40 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 1, + "group": 5 + }, + "pc": 42 + }, + { + "value": "cast([fp + (-5)] + 3, felt*)", + "ap_tracking_data": { + "offset": 1, + "group": 5 + }, + "pc": 45 + }, + { + "value": "[cast(fp + (-6), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 6 + }, + "pc": 48 + }, + { + "value": "[cast(fp + (-5), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 6 + }, + "pc": 48 + }, + { + "value": "[cast(fp + (-4), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 6 + }, + "pc": 48 + }, + { + "value": "[cast(fp + (-3), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 6 + }, + "pc": 48 + }, + { + "value": "[cast(fp + (-7), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 6 + }, + "pc": 48 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 1, + "group": 6 + }, + "pc": 50 + }, + { + "value": "cast([fp + (-7)] + 5, felt*)", + "ap_tracking_data": { + "offset": 1, + "group": 6 + }, + "pc": 55 + }, + { + "value": "[cast(fp + (-3), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 7 + }, + "pc": 58 + }, + { + "value": "[cast(fp + (-5), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 7 + }, + "pc": 58 + }, + { + "value": "[cast(fp + (-4), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 7 + }, + "pc": 58 + }, + { + "value": "[cast(ap + (-1), felt**)]", + "ap_tracking_data": { + "offset": 5, + "group": 7 + }, + "pc": 62 + }, + { + "value": "[cast(fp, felt**)]", + "ap_tracking_data": { + "offset": 5, + "group": 7 + }, + "pc": 63 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 6, + "group": 7 + }, + "pc": 65 + }, + { + "value": "[cast(ap + (-1), felt**)]", + "ap_tracking_data": { + "offset": 9, + "group": 7 + }, + "pc": 68 + }, + { + "value": "[cast(fp + 1, felt**)]", + "ap_tracking_data": { + "offset": 9, + "group": 7 + }, + "pc": 69 + }, + { + "value": "[cast(fp + 1, felt**)]", + "ap_tracking_data": { + "offset": 9, + "group": 7 + }, + "pc": 69 + }, + { + "value": "cast([fp + 1] + 1, felt*)", + "ap_tracking_data": { + "offset": 9, + "group": 7 + }, + "pc": 70 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 10, + "group": 7 + }, + "pc": 72 + }, + { + "value": "[cast(ap + (-1), felt**)]", + "ap_tracking_data": { + "offset": 19, + "group": 7 + }, + "pc": 80 + }, + { + "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 0, + "group": 8 + }, + "pc": 82 + }, + { + "value": "[cast(fp + (-3), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 8 + }, + "pc": 82 + }, + { + "value": "cast(1783935019461685855687084032167085762428877981963606680389089912112530844880, felt)", + "ap_tracking_data": { + "offset": 0, + "group": 8 + }, + "pc": 82 + }, + { + "value": "[cast(fp + (-5), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 9 + }, + "pc": 87 + }, + { + "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 0, + "group": 9 + }, + "pc": 87 + }, + { + "value": "[cast(fp + (-3), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 9 + }, + "pc": 87 + }, + { + "value": "[cast(ap + (-3), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 7, + "group": 9 + }, + "pc": 91 + }, + { + "value": "[cast(ap + (-2), felt*)]", + "ap_tracking_data": { + "offset": 7, + "group": 9 + }, + "pc": 91 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 7, + "group": 9 + }, + "pc": 91 + }, + { + "value": "[cast(ap + (-2), felt**)]", + "ap_tracking_data": { + "offset": 14, + "group": 9 + }, + "pc": 95 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 14, + "group": 9 + }, + "pc": 95 + }, + { + "value": "[cast(ap + (-1), felt**)]", + "ap_tracking_data": { + "offset": 15, + "group": 9 + }, + "pc": 96 + }, + { + "value": "[cast(ap + (-1), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 16, + "group": 9 + }, + "pc": 97 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 17, + "group": 9 + }, + "pc": 98 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 18, + "group": 9 + }, + "pc": 99 + }, + { + "value": "[cast(fp + (-3), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 10 + }, + "pc": 100 + }, + { + "value": "[cast(fp + (-6), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 10 + }, + "pc": 100 + }, + { + "value": "[cast(fp + (-5), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 0, + "group": 10 + }, + "pc": 100 + }, + { + "value": "[cast(fp + (-4), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 10 + }, + "pc": 100 + }, + { + "value": "[cast(ap + (-3), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 7, + "group": 10 + }, + "pc": 104 + }, + { + "value": "[cast(ap + (-2), felt*)]", + "ap_tracking_data": { + "offset": 7, + "group": 10 + }, + "pc": 104 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 7, + "group": 10 + }, + "pc": 104 + }, + { + "value": "[cast(ap + (-1), felt**)]", + "ap_tracking_data": { + "offset": 14, + "group": 10 + }, + "pc": 109 + }, + { + "value": "[cast(fp + (-5), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 11 + }, + "pc": 112 + }, + { + "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 0, + "group": 11 + }, + "pc": 112 + }, + { + "value": "[cast(fp + (-3), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 11 + }, + "pc": 112 + }, + { + "value": "[cast(ap + (-4), felt**)]", + "ap_tracking_data": { + "offset": 23, + "group": 11 + }, + "pc": 117 + }, + { + "value": "[cast(ap + (-3), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 23, + "group": 11 + }, + "pc": 117 + }, + { + "value": "[cast(ap + (-2), felt*)]", + "ap_tracking_data": { + "offset": 23, + "group": 11 + }, + "pc": 117 + }, + { + "value": "[cast(fp + (-3), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 12 + }, + "pc": 118 + }, + { + "value": "[cast(fp + (-6), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 12 + }, + "pc": 118 + }, + { + "value": "[cast(fp + (-5), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 0, + "group": 12 + }, + "pc": 118 + }, + { + "value": "[cast(fp + (-4), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 12 + }, + "pc": 118 + }, + { + "value": "[cast(ap + (-3), felt**)]", + "ap_tracking_data": { + "offset": 25, + "group": 12 + }, + "pc": 127 + }, + { + "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 25, + "group": 12 + }, + "pc": 127 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 25, + "group": 12 + }, + "pc": 127 + }, + { + "value": "[cast(ap + (-2), felt**)]", + "ap_tracking_data": { + "offset": 50, + "group": 12 + }, + "pc": 132 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 50, + "group": 12 + }, + "pc": 132 + }, + { + "value": "[cast(fp + (-6), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 13 + }, + "pc": 136 + }, + { + "value": "[cast(fp + (-5), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 13 + }, + "pc": 136 + }, + { + "value": "[cast(fp + (-4), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 13 + }, + "pc": 136 + }, + { + "value": "[cast(fp + (-3), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 13 + }, + "pc": 136 + }, + { + "value": "[cast(fp + (-9), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 13 + }, + "pc": 136 + }, + { + "value": "[cast(fp + (-8), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 0, + "group": 13 + }, + "pc": 136 + }, + { + "value": "[cast(fp + (-7), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 13 + }, + "pc": 136 + }, + { + "value": "[cast(ap + (-3), felt**)]", + "ap_tracking_data": { + "offset": 61, + "group": 13 + }, + "pc": 144 + }, + { + "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 61, + "group": 13 + }, + "pc": 144 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 61, + "group": 13 + }, + "pc": 144 + }, + { + "value": "[cast(fp, starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 61, + "group": 13 + }, + "pc": 145 + }, + { + "value": "[cast(fp + 1, felt*)]", + "ap_tracking_data": { + "offset": 61, + "group": 13 + }, + "pc": 146 + }, + { + "value": "[cast(ap + (-3), felt**)]", + "ap_tracking_data": { + "offset": 72, + "group": 13 + }, + "pc": 157 + }, + { + "value": "[cast(ap - 0 + (-3), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 14 + }, + "pc": 157 + }, + { + "value": "[cast([fp + (-5)], felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 15 + }, + "pc": 161 + }, + { + "value": "[cast([fp + (-5)] + 1, starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 0, + "group": 15 + }, + "pc": 161 + }, + { + "value": "[cast([fp + (-5)] + 2, felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 15 + }, + "pc": 161 + }, + { + "value": "[cast(fp + (-3), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 15 + }, + "pc": 161 + }, + { + "value": "[cast([fp + (-3)], felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 15 + }, + "pc": 161 + }, + { + "value": "cast([fp + (-3)] + 1, felt*)", + "ap_tracking_data": { + "offset": 0, + "group": 15 + }, + "pc": 161 + }, + { + "value": "[cast([fp + (-3)] + 1, felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 15 + }, + "pc": 161 + }, + { + "value": "cast([fp + (-3)] + 2, felt*)", + "ap_tracking_data": { + "offset": 0, + "group": 15 + }, + "pc": 161 + }, + { + "value": "[cast([fp + (-3)] + 2, felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 15 + }, + "pc": 161 + }, + { + "value": "cast([fp + (-3)] + 3, felt*)", + "ap_tracking_data": { + "offset": 0, + "group": 15 + }, + "pc": 161 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 1, + "group": 15 + }, + "pc": 162 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 2, + "group": 15 + }, + "pc": 163 + }, + { + "value": "cast([[fp + (-5)] + 2] + 1, felt)", + "ap_tracking_data": { + "offset": 2, + "group": 15 + }, + "pc": 164 + }, + { + "value": "cast([fp + (-3)] + 3, felt*)", + "ap_tracking_data": { + "offset": 2, + "group": 15 + }, + "pc": 164 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 3, + "group": 15 + }, + "pc": 166 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 4, + "group": 15 + }, + "pc": 167 + }, + { + "value": "[cast(ap + (-1), felt**)]", + "ap_tracking_data": { + "offset": 5, + "group": 15 + }, + "pc": 168 + }, + { + "value": "cast([ap + (-1)] - [fp + (-3)], felt)", + "ap_tracking_data": { + "offset": 5, + "group": 15 + }, + "pc": 168 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 6, + "group": 15 + }, + "pc": 170 + }, + { + "value": "[cast(ap + (-3), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 16 + }, + "pc": 181 + }, + { + "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 0, + "group": 16 + }, + "pc": 181 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 16 + }, + "pc": 181 + }, + { + "value": "[cast(ap + 0, ()*)]", + "ap_tracking_data": { + "offset": 0, + "group": 16 + }, + "pc": 181 + }, + { + "value": "[cast(ap + (-1), felt**)]", + "ap_tracking_data": { + "offset": 1, + "group": 16 + }, + "pc": 183 + }, + { + "value": "cast(0, felt)", + "ap_tracking_data": { + "offset": 1, + "group": 16 + }, + "pc": 183 + }, + { + "value": "[cast(fp + (-5), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 17 + }, + "pc": 190 + }, + { + "value": "[cast(fp + (-4), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 17 + }, + "pc": 190 + }, + { + "value": "[cast(fp + (-3), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 17 + }, + "pc": 190 + }, + { + "value": "[cast(fp + (-8), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 17 + }, + "pc": 190 + }, + { + "value": "[cast(fp + (-7), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 0, + "group": 17 + }, + "pc": 190 + }, + { + "value": "[cast(fp + (-6), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 17 + }, + "pc": 190 + }, + { + "value": "[cast(ap + (-4), felt**)]", + "ap_tracking_data": { + "offset": 28, + "group": 17 + }, + "pc": 195 + }, + { + "value": "[cast(ap + (-3), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 28, + "group": 17 + }, + "pc": 195 + }, + { + "value": "[cast(ap + (-2), felt*)]", + "ap_tracking_data": { + "offset": 28, + "group": 17 + }, + "pc": 195 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 28, + "group": 17 + }, + "pc": 195 + }, + { + "value": "[cast(ap + (-3), felt**)]", + "ap_tracking_data": { + "offset": 39, + "group": 17 + }, + "pc": 202 + }, + { + "value": "[cast(ap + (-2), felt*)]", + "ap_tracking_data": { + "offset": 39, + "group": 17 + }, + "pc": 202 + }, + { + "value": "[cast(ap + (-1), felt**)]", + "ap_tracking_data": { + "offset": 39, + "group": 17 + }, + "pc": 202 + }, + { + "value": "[cast([fp + (-5)], felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 18 + }, + "pc": 208 + }, + { + "value": "[cast([fp + (-5)] + 1, starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 0, + "group": 18 + }, + "pc": 208 + }, + { + "value": "[cast([fp + (-5)] + 2, felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 18 + }, + "pc": 208 + }, + { + "value": "[cast(ap + (-5), felt**)]", + "ap_tracking_data": { + "offset": 52, + "group": 18 + }, + "pc": 216 + }, + { + "value": "[cast(ap + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 52, + "group": 18 + }, + "pc": 216 + }, + { + "value": "[cast(ap + (-3), felt*)]", + "ap_tracking_data": { + "offset": 52, + "group": 18 + }, + "pc": 216 + }, + { + "value": "[cast(ap + (-2), (retdata_size: felt, retdata: felt*)*)]", + "ap_tracking_data": { + "offset": 52, + "group": 18 + }, + "pc": 216 + }, + { + "value": "[cast(ap + (-2), felt*)]", + "ap_tracking_data": { + "offset": 52, + "group": 18 + }, + "pc": 216 + }, + { + "value": "[cast(ap + (-1), felt**)]", + "ap_tracking_data": { + "offset": 52, + "group": 18 + }, + "pc": 216 + }, + { + "value": "[cast(fp + (-5), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 19 + }, + "pc": 217 + }, + { + "value": "[cast(fp + (-4), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 19 + }, + "pc": 217 + }, + { + "value": "[cast(fp + (-3), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 19 + }, + "pc": 217 + }, + { + "value": "[cast(fp + (-8), felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 19 + }, + "pc": 217 + }, + { + "value": "[cast(fp + (-7), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 0, + "group": 19 + }, + "pc": 217 + }, + { + "value": "[cast(fp + (-6), felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 19 + }, + "pc": 217 + }, + { + "value": "[cast(ap + (-4), felt**)]", + "ap_tracking_data": { + "offset": 28, + "group": 19 + }, + "pc": 222 + }, + { + "value": "[cast(ap + (-3), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 28, + "group": 19 + }, + "pc": 222 + }, + { + "value": "[cast(ap + (-2), felt*)]", + "ap_tracking_data": { + "offset": 28, + "group": 19 + }, + "pc": 222 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 28, + "group": 19 + }, + "pc": 222 + }, + { + "value": "[cast(ap + (-3), felt**)]", + "ap_tracking_data": { + "offset": 39, + "group": 19 + }, + "pc": 229 + }, + { + "value": "[cast([fp + (-5)], felt**)]", + "ap_tracking_data": { + "offset": 0, + "group": 20 + }, + "pc": 233 + }, + { + "value": "[cast([fp + (-5)] + 1, starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 0, + "group": 20 + }, + "pc": 233 + }, + { + "value": "[cast([fp + (-5)] + 2, felt*)]", + "ap_tracking_data": { + "offset": 0, + "group": 20 + }, + "pc": 233 + }, + { + "value": "[cast(ap + (-3), felt**)]", + "ap_tracking_data": { + "offset": 50, + "group": 20 + }, + "pc": 241 + }, + { + "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]", + "ap_tracking_data": { + "offset": 50, + "group": 20 + }, + "pc": 241 + }, + { + "value": "[cast(ap + (-1), felt*)]", + "ap_tracking_data": { + "offset": 50, + "group": 20 + }, + "pc": 241 + }, + { + "value": "[cast(ap + 0, ()*)]", + "ap_tracking_data": { + "offset": 50, + "group": 20 + }, + "pc": 241 + }, + { + "value": "[cast(ap + (-1), felt**)]", + "ap_tracking_data": { + "offset": 51, + "group": 20 + }, + "pc": 243 + }, + { + "value": "cast(0, felt)", + "ap_tracking_data": { + "offset": 51, + "group": 20 + }, + "pc": 243 + } + ] + }, + "builtins": [ + "pedersen", + "range_check" + ], + "debug_info": null, + "data": [ + "0x40780017fff7fff", + "0x1", + "0x208b7fff7fff7ffe", + "0x20780017fff7ffd", + "0x4", + "0x400780017fff7ffd", + "0x1", + "0x208b7fff7fff7ffe", + "0x480680017fff8000", + "0x4c69627261727943616c6c", + "0x400280007ff97fff", + "0x400380017ff97ffa", + "0x400380027ff97ffb", + "0x400380037ff97ffc", + "0x400380047ff97ffd", + "0x482680017ff98000", + "0x7", + "0x480280057ff98000", + "0x480280067ff98000", + "0x208b7fff7fff7ffe", + "0x480680017fff8000", + "0x4c69627261727943616c6c4c3148616e646c6572", + "0x400280007ff97fff", + "0x400380017ff97ffa", + "0x400380027ff97ffb", + "0x400380037ff97ffc", + "0x400380047ff97ffd", + "0x482680017ff98000", + "0x7", + "0x480280057ff98000", + "0x480280067ff98000", + "0x208b7fff7fff7ffe", + "0x480680017fff8000", + "0x53746f7261676552656164", + "0x400280007ffc7fff", + "0x400380017ffc7ffd", + "0x482680017ffc8000", + "0x3", + "0x480280027ffc8000", + "0x208b7fff7fff7ffe", + "0x480680017fff8000", + "0x53746f726167655772697465", + "0x400280007ffb7fff", + "0x400380017ffb7ffc", + "0x400380027ffb7ffd", + "0x482680017ffb8000", + "0x3", + "0x208b7fff7fff7ffe", + "0x480680017fff8000", + "0x456d69744576656e74", + "0x400280007ff97fff", + "0x400380017ff97ffa", + "0x400380027ff97ffb", + "0x400380037ff97ffc", + "0x400380047ff97ffd", + "0x482680017ff98000", + "0x5", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x2", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffc5", + "0x40137fff7fff8000", + "0x480680017fff8000", + "0x2db340e6c609371026731f47050d3976552c89b4fbb012941663841c59d1af3", + "0x4002800080007fff", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffbf", + "0x40137fff7fff8001", + "0x4003800080017ffd", + "0x4826800180018000", + "0x1", + "0x480a7ffb7fff8000", + "0x480680017fff8000", + "0x1", + "0x480a80007fff8000", + "0x4828800180007ffc", + "0x480a80017fff8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffe3", + "0x480a7ffc7fff8000", + "0x208b7fff7fff7ffe", + "0x480a7ffc7fff8000", + "0x480a7ffd7fff8000", + "0x480680017fff8000", + "0x3f1abe37754ee6ca6d8dfa1036089f78a07ebe8f3b1e336cdbf3274d25becd0", + "0x208b7fff7fff7ffe", + "0x480a7ffc7fff8000", + "0x480a7ffd7fff8000", + "0x1104800180018000", + "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffffa", + "0x480a7ffb7fff8000", + "0x48127ffe7fff8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffc4", + "0x48127ffe7fff8000", + "0x48127ff57fff8000", + "0x48127ff57fff8000", + "0x48127ffc7fff8000", + "0x208b7fff7fff7ffe", + "0x480a7ffb7fff8000", + "0x480a7ffc7fff8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffed", + "0x480a7ffa7fff8000", + "0x48127ffe7fff8000", + "0x480a7ffd7fff8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffbe", + "0x48127ff67fff8000", + "0x48127ff67fff8000", + "0x208b7fff7fff7ffe", + "0x480a7ffb7fff8000", + "0x480a7ffc7fff8000", + "0x480a7ffd7fff8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffe5", + "0x208b7fff7fff7ffe", + "0x480a7ffd7fff8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff8d", + "0x480a7ffa7fff8000", + "0x480a7ffb7fff8000", + "0x480a7ffc7fff8000", + "0x480a7ffd7fff8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffe8", + "0x48127ffd7fff8000", + "0x48127ffe7fff8000", + "0x480a7ffd7fff8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffb9", + "0x48127ffe7fff8000", + "0x48127fe47fff8000", + "0x48127ffd7fff8000", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x2", + "0x480a7ff77fff8000", + "0x480a7ff87fff8000", + "0x480a7ff97fff8000", + "0x480a7ffa7fff8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffe9", + "0x40137ffe7fff8000", + "0x40137fff7fff8001", + "0x20780017fff7ffb", + "0x4", + "0x10780017fff7fff", + "0x9", + "0x48127ffd7fff8000", + "0x480a7ffa7fff8000", + "0x480a7ffb7fff8000", + "0x480a7ffc7fff8000", + "0x480a7ffd7fff8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff6e", + "0x48127ffd7fff8000", + "0x480a80007fff8000", + "0x480a80017fff8000", + "0x208b7fff7fff7ffe", + "0x480280027ffb8000", + "0x480280027ffd8000", + "0x400080007ffe7fff", + "0x482680017ffd8000", + "0x3", + "0x480280027ffd8000", + "0x48307fff7ffe8000", + "0x402a7ffd7ffc7fff", + "0x480280027ffb8000", + "0x480280007ffb8000", + "0x480280017ffb8000", + "0x482480017ffd8000", + "0x1", + "0x480280007ffd8000", + "0x480280017ffd8000", + "0x480280027ffd8000", + "0x482680017ffd8000", + "0x3", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffd6", + "0x40780017fff7fff", + "0x1", + "0x48127ffc7fff8000", + "0x48127ffc7fff8000", + "0x48127ffc7fff8000", + "0x480680017fff8000", + "0x0", + "0x48127ffb7fff8000", + "0x208b7fff7fff7ffe", + "0x480a7ff87fff8000", + "0x480a7ff97fff8000", + "0x480a7ffa7fff8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffb0", + "0x48127ffc7fff8000", + "0x48127ffe7fff8000", + "0x480a7ffb7fff8000", + "0x480a7ffc7fff8000", + "0x480a7ffd7fff8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff41", + "0x48127ffd7fff8000", + "0x48127ff17fff8000", + "0x48127ff17fff8000", + "0x48127ffb7fff8000", + "0x48127ffb7fff8000", + "0x208b7fff7fff7ffe", + "0x480280007ffb8000", + "0x480280017ffb8000", + "0x480280027ffb8000", + "0x480a7ffa7fff8000", + "0x480a7ffc7fff8000", + "0x480a7ffd7fff8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffe9", + "0x208b7fff7fff7ffe", + "0x480a7ff87fff8000", + "0x480a7ff97fff8000", + "0x480a7ffa7fff8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff95", + "0x48127ffc7fff8000", + "0x48127ffe7fff8000", + "0x480a7ffb7fff8000", + "0x480a7ffc7fff8000", + "0x480a7ffd7fff8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff32", + "0x48127ffd7fff8000", + "0x48127ff17fff8000", + "0x48127ff17fff8000", + "0x208b7fff7fff7ffe", + "0x480280007ffb8000", + "0x480280017ffb8000", + "0x480280027ffb8000", + "0x480a7ffa7fff8000", + "0x480a7ffc7fff8000", + "0x480a7ffd7fff8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffeb", + "0x40780017fff7fff", + "0x1", + "0x48127ffc7fff8000", + "0x48127ffc7fff8000", + "0x48127ffc7fff8000", + "0x480680017fff8000", + "0x0", + "0x48127ffb7fff8000", + "0x208b7fff7fff7ffe" + ] + }, + "abi": [ + { + "data": [ + { + "name": "implementation", + "type": "felt" + } + ], + "keys": [], + "name": "Upgraded", + "type": "event" + }, + { + "data": [ + { + "name": "previousAdmin", + "type": "felt" + }, + { + "name": "newAdmin", + "type": "felt" + } + ], + "keys": [], + "name": "AdminChanged", + "type": "event" + }, + { + "inputs": [ + { + "name": "implementation_hash", + "type": "felt" + }, + { + "name": "selector", + "type": "felt" + }, + { + "name": "calldata_len", + "type": "felt" + }, + { + "name": "calldata", + "type": "felt*" + } + ], + "name": "constructor", + "outputs": [], + "type": "constructor" + }, + { + "inputs": [ + { + "name": "selector", + "type": "felt" + }, + { + "name": "calldata_size", + "type": "felt" + }, + { + "name": "calldata", + "type": "felt*" + } + ], + "name": "__default__", + "outputs": [ + { + "name": "retdata_size", + "type": "felt" + }, + { + "name": "retdata", + "type": "felt*" + } + ], + "type": "function" + }, + { + "inputs": [ + { + "name": "selector", + "type": "felt" + }, + { + "name": "calldata_size", + "type": "felt" + }, + { + "name": "calldata", + "type": "felt*" + } + ], + "name": "__l1_default__", + "outputs": [], + "type": "l1_handler" + } + ], + "entry_points_by_type": { + "CONSTRUCTOR": [ + { + "offset": "0xa1", + "selector": "0x28ffe4ff0f226a9107253e17a904099aa4f63a02a5621de0576e5aa71bc5194" + } + ], + "EXTERNAL": [ + { + "offset": "0xd0", + "selector": "0x0" + } + ], + "L1_HANDLER": [ + { + "offset": "0xe9", + "selector": "0x0" + } + ] + } + } \ No newline at end of file diff --git a/rpcv02/transaction.go b/rpcv02/transaction.go index 09204a15..a23507de 100644 --- a/rpcv02/transaction.go +++ b/rpcv02/transaction.go @@ -2,32 +2,65 @@ package rpcv02 import ( "context" + "encoding/json" "fmt" "time" "github.com/NethermindEth/juno/core/felt" ) +func adaptTransaction(t TXN) (Transaction, error) { + txMarshalled, err := json.Marshal(t) + if err != nil { + return nil, err + } + switch t.Type { + case TransactionType_Invoke: + var tx InvokeTxnV1 + json.Unmarshal(txMarshalled, &tx) + return tx, nil + case TransactionType_Declare: + var tx DeclareTxn + json.Unmarshal(txMarshalled, &tx) + return tx, nil + case TransactionType_DeployAccount: + var tx DeployAccountTxn + json.Unmarshal(txMarshalled, &tx) + return tx, nil + case TransactionType_L1Handler: + var tx L1HandlerTxn + json.Unmarshal(txMarshalled, &tx) + return tx, nil + case TransactionType_Deploy: + var tx DeployTxn + json.Unmarshal(txMarshalled, &tx) + return tx, nil + default: + panic("not a transaction") + } +} + // TransactionByHash gets the details and status of a submitted transaction. func (provider *Provider) TransactionByHash(ctx context.Context, hash *felt.Felt) (Transaction, error) { - var tx UnknownTransaction + // todo: update to return a custom Transaction type, then use adapt function + var tx TXN if err := do(ctx, provider.c, "starknet_getTransactionByHash", &tx, hash); err != nil { // TODO: Bind Pathfinder/Devnet Error to // TXN_HASH_NOT_FOUND return nil, err } - return tx.Transaction, nil + return adaptTransaction(tx) } // TransactionByBlockIdAndIndex Get the details of the transaction given by the identified block and index in that block. If no transaction is found, null is returned. func (provider *Provider) TransactionByBlockIdAndIndex(ctx context.Context, blockID BlockID, index uint64) (Transaction, error) { - var tx UnknownTransaction + var tx TXN if err := do(ctx, provider.c, "starknet_getTransactionByBlockIdAndIndex", &tx, blockID, index); err != nil { // TODO: Bind Pathfinder/Devnet Error to // INVALID_TXN_INDEX and INVALID_TXN_INDEX return nil, err } - return tx.Transaction, nil + return adaptTransaction(tx) } // PendingTransaction returns the transactions in the transaction pool, recognized by this sequencer. diff --git a/rpcv02/transaction_test.go b/rpcv02/transaction_test.go index 850551c8..be52aee5 100644 --- a/rpcv02/transaction_test.go +++ b/rpcv02/transaction_test.go @@ -6,8 +6,10 @@ import ( "regexp" "testing" - ctypes "github.com/NethermindEth/caigo/types" + "github.com/NethermindEth/caigo/utils" + "github.com/NethermindEth/juno/core/felt" "github.com/google/go-cmp/cmp" + "github.com/test-go/testify/require" ) // TestTransactionByHash tests transaction by hash @@ -15,20 +17,42 @@ func TestTransactionByHash(t *testing.T) { testConfig := beforeEach(t) type testSetType struct { - TxHash ctypes.Felt + TxHash *felt.Felt ExpectedTxn Transaction } + + var InvokeTxnV1example = InvokeTxnV1{ + CommonTransaction: CommonTransaction{ + TransactionHash: utils.TestHexToFelt(t, "0x705547f8f2f8fdfb10ed533d909f76482bb293c5a32648d476774516a0bebd0"), + BroadcastedTxnCommonProperties: BroadcastedTxnCommonProperties{ + Type: TransactionType_Invoke, + MaxFee: utils.TestHexToFelt(t, "0x53685de02fa5"), + Version: TransactionV1, + Nonce: &felt.Zero, + Signature: []*felt.Felt{ + utils.TestHexToFelt(t, "0x4a7849de7b91e52cd0cdaf4f40aa67f54a58e25a15c60e034d2be819c1ecda4"), + utils.TestHexToFelt(t, "0x227fcad2a0007348e64384649365e06d41287b1887999b406389ee73c1d8c4c"), + }, + }, + }, + SenderAddress: utils.TestHexToFelt(t, "0x315e364b162653e5c7b23efd34f8da27ba9c069b68e3042b7d76ce1df890313"), + Calldata: []*felt.Felt{ + utils.TestHexToFelt(t, "0x1"), + utils.TestHexToFelt(t, "0x13befe6eda920ce4af05a50a67bd808d67eee6ba47bb0892bef2d630eaf1bba"), + }, + } + testSet := map[string][]testSetType{ "mock": { { - TxHash: ctypes.StrToFelt("0x705547f8f2f8fdfb10ed533d909f76482bb293c5a32648d476774516a0bebd0"), - ExpectedTxn: InvokeTxnV00x705547f8f2f8f, + TxHash: utils.TestHexToFelt(t, "0x705547f8f2f8fdfb10ed533d909f76482bb293c5a32648d476774516a0bebd0"), + ExpectedTxn: InvokeTxnV1example, }, }, "testnet": { { - TxHash: ctypes.StrToFelt("0x705547f8f2f8fdfb10ed533d909f76482bb293c5a32648d476774516a0bebd0"), - ExpectedTxn: InvokeTxnV00x705547f8f2f8f, + TxHash: utils.TestHexToFelt(t, "0x705547f8f2f8fdfb10ed533d909f76482bb293c5a32648d476774516a0bebd0"), + ExpectedTxn: InvokeTxnV1example, }, }, "mainnet": {}, @@ -37,6 +61,7 @@ func TestTransactionByHash(t *testing.T) { spy := NewSpy(testConfig.provider.c) testConfig.provider.c = spy tx, err := testConfig.provider.TransactionByHash(context.Background(), test.TxHash) + fmt.Println("ALLL FOGOGOG", tx, err) if err != nil { t.Fatal(err) } @@ -44,13 +69,13 @@ func TestTransactionByHash(t *testing.T) { t.Fatal("transaction should exist") } - txTyped, ok := (tx).(InvokeTxnV0) + txCasted, ok := (tx).(InvokeTxnV1) if !ok { - t.Fatalf("transaction should be InvokeTxnV0, instead %T", tx) - } - if !cmp.Equal(test.ExpectedTxn, txTyped) { - t.Fatalf("the expected transaction blocks to match, instead: %s", cmp.Diff(test.ExpectedTxn, txTyped)) + t.Fatalf("transaction should be InvokeTxnV1, instead %T", tx) } + require.Equal(t, txCasted.Type, TransactionType_Invoke) + require.Equal(t, txCasted.TransactionHash, test.TxHash) + require.Equal(t, txCasted, test.ExpectedTxn) } } @@ -62,21 +87,36 @@ func TestTransactionByBlockIdAndIndex(t *testing.T) { Index uint64 ExpectedTxn Transaction } + + var InvokeTxnV1example = InvokeTxnV1{ + CommonTransaction: CommonTransaction{ + TransactionHash: utils.TestHexToFelt(t, "0x705547f8f2f8fdfb10ed533d909f76482bb293c5a32648d476774516a0bebd0"), + BroadcastedTxnCommonProperties: BroadcastedTxnCommonProperties{ + Type: TransactionType_Invoke, + MaxFee: utils.TestHexToFelt(t, "0x53685de02fa5"), + Version: TransactionV1, + Nonce: &felt.Zero, + Signature: []*felt.Felt{ + utils.TestHexToFelt(t, "0x4a7849de7b91e52cd0cdaf4f40aa67f54a58e25a15c60e034d2be819c1ecda4"), + utils.TestHexToFelt(t, "0x227fcad2a0007348e64384649365e06d41287b1887999b406389ee73c1d8c4c"), + }, + }, + }, + SenderAddress: utils.TestHexToFelt(t, "0x315e364b162653e5c7b23efd34f8da27ba9c069b68e3042b7d76ce1df890313"), + Calldata: []*felt.Felt{ + utils.TestHexToFelt(t, "0x1"), + utils.TestHexToFelt(t, "0x13befe6eda920ce4af05a50a67bd808d67eee6ba47bb0892bef2d630eaf1bba"), + }, + } + testSet := map[string][]testSetType{ "mock": { { BlockID: WithBlockNumber(300000), Index: 0, - ExpectedTxn: InvokeTxnV0_300000_0, + ExpectedTxn: InvokeTxnV1example, }, }, - // "testnet": { - // { - // BlockID: WithBlockNumber(300000), - // Index: 0, - // ExpectedTxn: InvokeTxnV0_300000_0, - // }, - // }, "mainnet": {}, }[testEnv] for _, test := range testSet { @@ -89,21 +129,12 @@ func TestTransactionByBlockIdAndIndex(t *testing.T) { if tx == nil { t.Fatal("transaction should exist") } - txTyped, ok := (tx).(InvokeTxnV0) + txCasted, ok := (tx).(InvokeTxnV1) if !ok { t.Fatalf("transaction should be InvokeTxnV0, instead %T", tx) } - diff, err := spy.Compare(txTyped, false) - if err != nil { - t.Fatal("expecting to match", err) - } - if diff != "FullMatch" { - spy.Compare(txTyped, true) - t.Fatal("structure expecting to be FullMatch, instead", diff) - } - if !cmp.Equal(test.ExpectedTxn, txTyped) { - t.Fatalf("the expected transaction blocks to match, instead: %s", cmp.Diff(test.ExpectedTxn, txTyped)) - } + require.Equal(t, txCasted.Type, TransactionType_Invoke) + require.Equal(t, txCasted, test.ExpectedTxn) } } @@ -112,14 +143,44 @@ func TestTransactionReceipt_MatchesCapturedTransaction(t *testing.T) { testConfig := beforeEach(t) type testSetType struct { - TxnHash ctypes.Felt + TxnHash *felt.Felt ExpectedTxnReceipt TransactionReceipt } + var receiptTxn310370_0 = InvokeTransactionReceipt(CommonTransactionReceipt{ + TransactionHash: utils.TestHexToFelt(t, "0x40c82f79dd2bc1953fc9b347a3e7ab40fe218ed5740bf4e120f74e8a3c9ac99"), + ActualFee: utils.TestHexToFelt(t, "0x1709a2f3a2"), + Type: "INVOKE", + Status: TransactionAcceptedOnL1, + BlockHash: utils.TestHexToFelt(t, "0x6c2fe3db009a2e008c2d65fca14204f3405cb74742fcf685f02473acaf70c72"), + BlockNumber: 310370, + MessagesSent: []MsgToL1{}, + Events: []Event{ + { + FromAddress: utils.TestHexToFelt(t, "0x37de00fb1416936b3074fc78bcc811d83046009b162c4a822ce84dabedd0ea9"), + Data: []*felt.Felt{ + utils.TestHexToFelt(t, "0x0"), + utils.TestHexToFelt(t, "0x35b32bb4a1969175fb14b6c09838d1b3200724cc4d2b0891be319764021f5ac"), + utils.TestHexToFelt(t, "0xe9"), + utils.TestHexToFelt(t, "0x0"), + }, + Keys: []*felt.Felt{utils.TestHexToFelt(t, "0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9")}, + }, + { + FromAddress: utils.TestHexToFelt(t, "0x33830ce413e4c096eef81b5e6ffa9b9f5d963f57b8cd63c9ae4c839c383c1a6"), + Data: []*felt.Felt{ + utils.TestHexToFelt(t, "0x61c6e7484657e5dc8b21677ffa33e4406c0600bba06d12cf1048fdaa55bdbc3"), + utils.TestHexToFelt(t, "0x2e28403d7ee5e337b7d456327433f003aa875c29631906908900058c83d8cb6"), + }, + Keys: []*felt.Felt{utils.TestHexToFelt(t, "0xf806f71b19e4744968b37e3fb288e61309ab33a782ea9d11e18f67a1fbb110")}, + }, + }, + }) + testSet := map[string][]testSetType{ "mock": {}, "testnet": { { - TxnHash: ctypes.StrToFelt("0x40c82f79dd2bc1953fc9b347a3e7ab40fe218ed5740bf4e120f74e8a3c9ac99"), + TxnHash: utils.TestHexToFelt(t, "0x40c82f79dd2bc1953fc9b347a3e7ab40fe218ed5740bf4e120f74e8a3c9ac99"), ExpectedTxnReceipt: receiptTxn310370_0, }, }, @@ -151,14 +212,14 @@ func TestTransactionReceipt_MatchesStatus(t *testing.T) { testConfig := beforeEach(t) type testSetType struct { - TxnHash ctypes.Felt + TxnHash *felt.Felt StatusMatch string } testSet := map[string][]testSetType{ "mock": {}, "testnet": { { - TxnHash: ctypes.StrToFelt("0x650667fb0f17e63e1c9d1040e750d160f3dbfebcab990e7d4382f33468b1b59"), + TxnHash: utils.TestHexToFelt(t, "0x650667fb0f17e63e1c9d1040e750d160f3dbfebcab990e7d4382f33468b1b59"), StatusMatch: "(ACCEPTED_ON_L1|ACCEPTED_ON_L2|PENDING)", }, }, @@ -191,18 +252,45 @@ func TestDeployOrDeclareReceipt(t *testing.T) { testConfig := beforeEach(t) type testSetType struct { - TxnHash ctypes.Felt + TxnHash *felt.Felt ExpectedTxnReceipt TransactionReceipt } + + var receiptTxn310843_14 = DeployTransactionReceipt{ + CommonTransactionReceipt: CommonTransactionReceipt{ + TransactionHash: utils.TestHexToFelt(t, "0x035bd2978d2061b3463498f83c09322ed6a82e4b2a188506525e272a7adcdf6a"), + ActualFee: &felt.Zero, + Status: "ACCEPTED_ON_L1", + BlockHash: utils.TestHexToFelt(t, "0x0424fba26a7760b63895abe0c366c2d254cb47090c6f9e91ba2b3fa0824d4fc9"), + BlockNumber: 310843, + Type: "DEPLOY", + MessagesSent: []MsgToL1{}, + Events: []Event{}, + }, + ContractAddress: "0x21c40b1377353924e185c9536469787dbe0cdb77b6877fa3a9946b795c71ec7", + } + + var receiptTxn300114_3 = DeclareTransactionReceipt( + CommonTransactionReceipt{ + TransactionHash: utils.TestHexToFelt(t, "0x46a9f52a96b2d226407929e04cb02507e531f7c78b9196fc8c910351d8c33f3"), + ActualFee: utils.TestHexToFelt(t, "0x0"), + Status: TransactionAcceptedOnL1, + BlockHash: utils.TestHexToFelt(t, "0x184268bfbce24766fa53b65c9c8b30b295e145e8281d543a015b46308e27fdf"), + BlockNumber: 300114, + Type: "DECLARE", + MessagesSent: []MsgToL1{}, + Events: []Event{}, + }) + testSet := map[string][]testSetType{ "mock": {}, "testnet": { { - TxnHash: ctypes.StrToFelt("0x35bd2978d2061b3463498f83c09322ed6a82e4b2a188506525e272a7adcdf6a"), + TxnHash: utils.TestHexToFelt(t, "0x35bd2978d2061b3463498f83c09322ed6a82e4b2a188506525e272a7adcdf6a"), ExpectedTxnReceipt: receiptTxn310843_14, }, { - TxnHash: ctypes.StrToFelt("0x46a9f52a96b2d226407929e04cb02507e531f7c78b9196fc8c910351d8c33f3"), + TxnHash: utils.TestHexToFelt(t, "0x46a9f52a96b2d226407929e04cb02507e531f7c78b9196fc8c910351d8c33f3"), ExpectedTxnReceipt: receiptTxn300114_3, }, }, diff --git a/rpcv02/types_contract_test.go b/rpcv02/types_contract_test.go index 7ef0d397..1003b12d 100644 --- a/rpcv02/types_contract_test.go +++ b/rpcv02/types_contract_test.go @@ -7,8 +7,8 @@ import ( ) const ( - validContractCompiledPath = "./testdata/cairo/minimum_contract_compiled.json" - invalidContractCompiledPath = "./testdata/cairo/invalid_minimum_contract_compiled.json" + validContractCompiledPath = "./tests/0x1efa8f84fd4dff9e2902ec88717cf0dafc8c188f80c3450615944a469428f7f.json" + invalidContractCompiledPath = "./tests/0xFakeContract.json" ) func TestContractClass_UnmarshalValidJSON_Successful(t *testing.T) { @@ -22,15 +22,3 @@ func TestContractClass_UnmarshalValidJSON_Successful(t *testing.T) { t.Fatal("should be able unmarshall Class", err) } } - -func TestContractClass_UnmarshalInvalidJSON_Fails(t *testing.T) { - content, err := os.ReadFile(invalidContractCompiledPath) - if err != nil { - t.Fatal("should be able to read file", err) - } - - contractClass := ContractClass{} - if err := json.Unmarshal(content, &contractClass); err == nil { - t.Fatal("should not be able to unmarshall Class") - } -} diff --git a/rpcv02/types_transaction.go b/rpcv02/types_transaction.go index 83f29430..411c5d9a 100644 --- a/rpcv02/types_transaction.go +++ b/rpcv02/types_transaction.go @@ -10,6 +10,24 @@ import ( "github.com/NethermindEth/juno/core/felt" ) +// https://github.com/starkware-libs/starknet-specs/blob/a789ccc3432c57777beceaa53a34a7ae2f25fda0/api/starknet_api_openrpc.json#L1252 +type TXN struct { + Hash *felt.Felt `json:"transaction_hash,omitempty"` + Type TransactionType `json:"type"` + Version *felt.Felt `json:"version,omitempty"` + Nonce *felt.Felt `json:"nonce,omitempty"` + MaxFee *felt.Felt `json:"max_fee,omitempty"` + ContractAddress *felt.Felt `json:"contract_address,omitempty"` + ContractAddressSalt *felt.Felt `json:"contract_address_salt,omitempty"` + ClassHash *felt.Felt `json:"class_hash,omitempty"` + ConstructorCalldata []*felt.Felt `json:"constructor_calldata,omitempty"` + SenderAddress *felt.Felt `json:"sender_address,omitempty"` + Signature *[]*felt.Felt `json:"signature,omitempty"` + Calldata *[]*felt.Felt `json:"calldata,omitempty"` + EntryPointSelector *felt.Felt `json:"entry_point_selector,omitempty"` + CompiledClassHash *felt.Felt `json:"compiled_class_hash,omitempty"` +} + type TransactionHash struct { TransactionHash *felt.Felt `json:"transaction_hash"` } diff --git a/rpcv02/types_transaction_test.go b/rpcv02/types_transaction_test.go index 3449a475..bf81a7af 100644 --- a/rpcv02/types_transaction_test.go +++ b/rpcv02/types_transaction_test.go @@ -2,67 +2,25 @@ package rpcv02 import ( "encoding/json" - "strconv" "testing" - "github.com/NethermindEth/caigo/types" + "github.com/NethermindEth/caigo/utils" + "github.com/test-go/testify/require" ) -func TestTransactionHash(t *testing.T) { - for _, tc := range []struct { - Hash string `json:"transaction_hash"` - }{{ - Hash: "0x315e364b162653e5c7b23efd34f8da27ba9c069b68e3042b7d76ce1df890313", - }, { - Hash: "0x8d6955e1bc0d5ba78b04630375f962ce6e5c91115173bc5f6e7843c6ee1269", - }, { - Hash: "0x680b0616e65633dfaf06d5a5ee5f1d1d4b641396009f00a67c0d18dc0f9638", - }} { - var th TransactionHash - if err := json.Unmarshal([]byte(strconv.Quote(tc.Hash)), &th); err != nil { - t.Fatalf("Unmarshalling text: %v", err) - } - h := th - h2 := types.StrToFelt(tc.Hash) - - if h.TransactionHash != h2 { - t.Fatalf("Hashes not equal: %s %s", h, h2) - } - - m, err := h.MarshalText() - if err != nil { - t.Fatalf("Marshalling text: %v", err) - } - - m2, err := json.Marshal(h) - if err != nil { - t.Fatalf("Marshalling json: %v", err) - } - - if tc.Hash != string(m) { - t.Errorf("Hash mismatch, want: %s, got: %s", tc.Hash, m) - } - - if strconv.Quote(tc.Hash) != string(m2) { - t.Errorf("Hash mismatch, want: %s, got: %s", tc.Hash, m2) - } - } -} - func TestTransaction(t *testing.T) { - f := types.StrToFelt("0xdead") + f := utils.TestHexToFelt(t, "0xdead") th := TransactionHash{f} b, err := json.Marshal(th) if err != nil { t.Fatalf("marshalling transaction hash: %v", err) } - marshalled, err := f.MarshalText() + marshalled, err := f.MarshalJSON() if err != nil { t.Fatalf("marshalling transaction hash: %v", err) } - if string(b) != strconv.Quote(string(marshalled)) { - t.Fatalf("Marshalled hash mismatch, want: %s, got: %s", marshalled, b) - } + require.Equal(t, b, marshalled) + } diff --git a/rpcv02/write_test.go b/rpcv02/write_test.go index 1a942301..13150a79 100644 --- a/rpcv02/write_test.go +++ b/rpcv02/write_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/NethermindEth/caigo/artifacts" - "github.com/NethermindEth/caigo/types" + "github.com/NethermindEth/caigo/utils" ) // TestDeclareTransaction tests starknet_addDeclareTransaction @@ -39,7 +39,7 @@ func TestDeclareTransaction(t *testing.T) { }[testEnv] for _, test := range testSet { - contractClass := types.ContractClass{} + contractClass := ContractClass{} if err := json.Unmarshal(test.Filename, &contractClass); err != nil { t.Fatal(err) } @@ -50,18 +50,18 @@ func TestDeclareTransaction(t *testing.T) { declareTransaction := BroadcastedDeclareTransaction{ BroadcastedTxnCommonProperties: BroadcastedTxnCommonProperties{ Version: test.Version, - MaxFee: maxFee, - Nonce: nonce, - Signature: test.Signature, + MaxFee: utils.TestBigIntToFelt(t, maxFee), + Nonce: utils.TestBigIntToFelt(t, nonce), + Signature: utils.TestHexArrToFelt(t, test.Signature), }, ContractClass: contractClass, - SenderAddress: types.StrToFelt(TestNetAccount040Address), + SenderAddress: utils.TestHexToFelt(t, TestNetAccount040Address), } dec, err := testConfig.provider.AddDeclareTransaction(context.Background(), declareTransaction) if err != nil { t.Fatal("declare should succeed, instead:", err) } - if dec.ClassHash != test.ExpectedClassHash { + if dec.ClassHash.String() != test.ExpectedClassHash { t.Fatalf("classHash does not match expected, current: %s", dec.ClassHash) } if diff, err := spy.Compare(dec, false); err != nil || diff != "FullMatch" { diff --git a/utils/Test.go b/utils/Test.go new file mode 100644 index 00000000..23c8645c --- /dev/null +++ b/utils/Test.go @@ -0,0 +1,30 @@ +package utils + +import ( + "math/big" + "testing" + + "github.com/NethermindEth/juno/core/felt" + "github.com/test-go/testify/require" +) + +func TestHexToFelt(t testing.TB, hex string) *felt.Felt { + t.Helper() + f, err := HexToFelt(hex) + require.NoError(t, err) + return f +} + +func TestBigIntToFelt(t testing.TB, big *big.Int) *felt.Felt { + t.Helper() + felt, err := BigIntToFelt(big) + require.NoError(t, err) + return felt +} + +func TestHexArrToFelt(t testing.TB, hexArr []string) []*felt.Felt { + t.Helper() + feltArr, err := HexArrToFelt(hexArr) + require.NoError(t, err) + return feltArr +}