diff --git a/docs/index.md b/docs/index.md index 5d20afea..d7d6b39d 100644 --- a/docs/index.md +++ b/docs/index.md @@ -31,7 +31,7 @@ In order to run a local demo service based on the IEKit: 2. Fetch the IEKit. ```bash - autonomy fetch valory/impact_evaluator:0.1.0:bafybeihig5bdamlnm5m6nbyeunku3bmugzn2r5xkemsqwgvh7fiq6sguqm --service + autonomy fetch valory/impact_evaluator:0.1.0:bafybeigsixyvmdpuvvzltedhqg6a3pscjsrtu6uvg7db2ijnteeamnqi6e --service ``` 3. Build the Docker image of the service agents diff --git a/packages/packages.json b/packages/packages.json index 25552ddc..78304340 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -9,26 +9,27 @@ "contract/valory/wveolas/0.1.0": "bafybeibt33dfhx5o3hbahdbhveaadh77xm7avfqxhirufu2kb7jq6tp2mi", "contract/valory/veolas_delegation/0.1.0": "bafybeieicrbkito2hglwvd4j2cbq3etxpm3rrzfyx5kqqe34fu7q5aftye", "contract/valory/erc20/0.1.0": "bafybeid2p2jyvjjlcsqugnawksdzsca6ljghpqbp2kfi3cxuxoy2233dbi", + "contract/valory/mech_marketplace/0.1.0": "bafybeiba7kh3wygwtpyf7oo3sili6givzo2gyadhbb66rvwsokswsywvuu", "connection/valory/twitter/0.1.0": "bafybeidcalgczvpoq6l2uh7kkfblwxmytm6bicmsxub7pevu2k46sp7mky", "connection/valory/openai/0.1.0": "bafybeigyehjbahya5mp7vyp5tjvn36rey4btvzskp3ql3mgxp3zu6gwq5a", "connection/valory/farcaster/0.1.0": "bafybeibbdas7lxbipksodaphjms3uop7vnzjqkroktjq2g6wbvgtlldaxi", - "skill/valory/dynamic_nft_abci/0.1.0": "bafybeietq6nqkeze6esw5dwa4cjajluzd2tvg24hlg2pihxz2v67vxorpu", - "skill/valory/twitter_scoring_abci/0.1.0": "bafybeiedultjq4wokxuchbr4nv7m3y3mqq6qwtir6m5epggnbgew6yb24i", - "skill/valory/ceramic_read_abci/0.1.0": "bafybeiede3ehp4bfpbk23gncj52goq62rd3rm5wwlbyaexxrfohucdcpia", - "skill/valory/ceramic_write_abci/0.1.0": "bafybeiemid3ipekyqupbqpfw55g7b2wwx56g2ita73rjalk6fyqgneroam", - "skill/valory/impact_evaluator_abci/0.1.0": "bafybeifbgoisaa553l6oi5odt5d24hqwdz3ev6eqffh4tqkfzd73l3f6uu", - "skill/valory/generic_scoring_abci/0.1.0": "bafybeidxytbreu7sudoggnfjxpbfxsxwbis6dipokkq6uo23xaautnwca4", - "skill/valory/twitter_write_abci/0.1.0": "bafybeid377kr5f3dmb5nyhvucglyaaqkuhthxkfosgl54zskwmsuwz56ie", - "skill/valory/llm_abci/0.1.0": "bafybeibmckwphs5zqdfnutktwgq7bxfw2auhsxezoopkep5dadkuwqvwgy", - "skill/valory/decision_making_abci/0.1.0": "bafybeigsywkfb4lujy4y2c5tsmr2iulq7s6uad7uv2fbiwv7awxz5wfbi4", - "skill/valory/olas_week_abci/0.1.0": "bafybeifvhx6issf3xzesjihtbl63ymfrdvzfp4lqrg7liesyes4aiaydfm", - "skill/valory/mech_interact_abci/0.1.0": "bafybeigto5ssrbrbqmeoc6wijcly2klmrhfcnaioa5u3wsofdm7bccowcq", - "skill/valory/farcaster_write_abci/0.1.0": "bafybeihiayft7ovmijrstdo6m7fd5pqnqi7z2mximljpeskambbgo6476q", - "skill/valory/farcaster_test_abci/0.1.0": "bafybeidkrbog6z54364dor5irf5tlebhaxy4btnmb2cgobpswqfh6cfk5i", - "agent/valory/impact_evaluator/0.1.0": "bafybeifhygewmf2pdq4vyeiwucoutziaw6nral34pxjtwjgybjp5rfu4aq", - "agent/valory/farcaster_test/0.1.0": "bafybeihelkwq4ocgpdkiglclwhigklp67clhjkaabg7dkiduw5apb6zwbe", - "service/valory/impact_evaluator/0.1.0": "bafybeihig5bdamlnm5m6nbyeunku3bmugzn2r5xkemsqwgvh7fiq6sguqm", - "service/valory/impact_evaluator_local/0.1.0": "bafybeiflg7sn26pqmvkvm7feohjolorwtutqqwc3kk7d4uqamr3qzi5xpq" + "skill/valory/dynamic_nft_abci/0.1.0": "bafybeiakaaancbm4skuhd4tur4u7imftfmboocaef55hbqvbtvbgyvupuu", + "skill/valory/twitter_scoring_abci/0.1.0": "bafybeifufpx2b34psg3ut5tcwsl5nz2hcwsvqtf2qansta6spgir5nahfu", + "skill/valory/ceramic_read_abci/0.1.0": "bafybeiaycqch7edausdhktbxmrve5i2hbslus2feyog2aqjlfq6rcr5ajy", + "skill/valory/ceramic_write_abci/0.1.0": "bafybeifbqpvl6dmvm6wke626lzoubmid36yefjrpqfmpb63y6snbzebdva", + "skill/valory/impact_evaluator_abci/0.1.0": "bafybeihnp2bq2jysvwscyh7h5wf3mnir6ydhebhvyfcs52to42lz2rzl3y", + "skill/valory/generic_scoring_abci/0.1.0": "bafybeigdvre5wm6x4pqp523b33nw4ofmyjgx43dsqmzeieazba6aioj3ye", + "skill/valory/twitter_write_abci/0.1.0": "bafybeihzssdoyl36g6if247ceohq26kjeazugwavl7u5vvickzknczoqye", + "skill/valory/llm_abci/0.1.0": "bafybeiaz6sb7ez7kusriiijk5bb7oqynzxmlgkrbqjhur7u52gkcrfdwmy", + "skill/valory/decision_making_abci/0.1.0": "bafybeigv6c7azm3gryzuqu4e2egh3ge2wvk3hlv4da7gyis6lnonehje6e", + "skill/valory/olas_week_abci/0.1.0": "bafybeieugq7vjzjia237c7dfwfquvwfvyk765wybhrmmqtcwmjk5mydeie", + "skill/valory/mech_interact_abci/0.1.0": "bafybeidyshkn7hefjfbyjyl53sc5kllemwpoh6zxhnlsbwnk3xnzvaveyu", + "skill/valory/farcaster_write_abci/0.1.0": "bafybeicnw7awdmzyvat4ts4ankw57auvxr2dsjcofmiklenblmrd7fdeye", + "skill/valory/farcaster_test_abci/0.1.0": "bafybeicj77n27dskvotxx7dujwbdau4cu4v2tsualmgzbm2xseqc2naeae", + "agent/valory/impact_evaluator/0.1.0": "bafybeidtf6ae27b6hkxk2nvyjrt3wak7brofru5x3fwyx4ur2bvxtebbom", + "agent/valory/farcaster_test/0.1.0": "bafybeihcfhnlfwumai4fq3mts6pmmuogwikvivaihtj56badstduivvase", + "service/valory/impact_evaluator/0.1.0": "bafybeigsixyvmdpuvvzltedhqg6a3pscjsrtu6uvg7db2ijnteeamnqi6e", + "service/valory/impact_evaluator_local/0.1.0": "bafybeihec37cdytopzld2xlxaltqqurgjlqkko3sjqgnzfiwjczg575zpm" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", @@ -39,21 +40,21 @@ "protocol/valory/acn/1.1.0": "bafybeidluaoeakae3exseupaea4i3yvvk5vivyt227xshjlffywwxzcxqe", "protocol/valory/ipfs/0.1.0": "bafybeiftxi2qhreewgsc5wevogi7yc5g6hbcbo4uiuaibauhv3nhfcdtvm", "protocol/valory/tendermint/0.1.0": "bafybeig4mi3vmlv5zpbjbfuzcgida6j5f2nhrpedxicmrrfjweqc5r7cra", - "contract/valory/service_registry/0.1.0": "bafybeiaop64kwdoetxtedoehabmsalojmms7ihuoqcdwxtwb2hk5i6bzye", - "contract/valory/gnosis_safe_proxy_factory/0.1.0": "bafybeieg57u3z7cdlmdamad5e6lk7kmsli2zurzkg3sl4y7lhekcu4y3au", + "contract/valory/service_registry/0.1.0": "bafybeicjpbrvcuzad4aaf56r5gsd4sebmeqkytr3zsbvb54snix73pvz2m", + "contract/valory/gnosis_safe_proxy_factory/0.1.0": "bafybeibcq4gedbqxrvg2lwj3gwcxoyfa45x3s2qiefiru6epudzu4dhjr4", "contract/valory/multisend/0.1.0": "bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y", - "contract/valory/gnosis_safe/0.1.0": "bafybeih3ropivth4wn7zbzudisx3qezbht5jyndd4w7az7fq634lpozoge", - "connection/valory/abci/0.1.0": "bafybeia6etkacvqend7xj6viejkqgo7ozu3yn4yg3qezfthf2xhrjjwse4", + "contract/valory/gnosis_safe/0.1.0": "bafybeihjaxefx27ppcghwmnsehbrqqmhwkiur5mprpsdp7tluge7zzwqgm", + "connection/valory/abci/0.1.0": "bafybeibvb5gixohtgx22oymwlb2nntdzicdu2jkbs66azvmag6zf7vgfoq", "connection/valory/http_client/0.23.0": "bafybeihi772xgzpqeipp3fhmvpct4y6e6tpjp4sogwqrnf3wqspgeilg4u", - "connection/valory/ipfs/0.1.0": "bafybeigcijdbwgdekow5c2ikeltetoteabfp52ewy3xfkd7ygaqbl7j3ke", - "connection/valory/ledger/0.19.0": "bafybeig7woeog4srdby75hpjkmx4rhpkzncbf4h2pm5r6varsp26pf2uhu", + "connection/valory/ipfs/0.1.0": "bafybeiegnapkvkamis47v5ioza2haerrjdzzb23rptpmcydyneas7jc2wm", + "connection/valory/ledger/0.19.0": "bafybeigntoericenpzvwejqfuc3kqzo2pscs76qoygg5dbj6f4zxusru5e", "connection/valory/p2p_libp2p_client/0.1.0": "bafybeid3xg5k2ol5adflqloy75ibgljmol6xsvzvezebsg7oudxeeolz7e", "connection/valory/http_server/0.22.0": "bafybeihpgu56ovmq4npazdbh6y6ru5i7zuv6wvdglpxavsckyih56smu7m", - "skill/valory/abstract_abci/0.1.0": "bafybeieeaseuy5rbbw465knz27vccvpkfge43q7isl7fkdlfapwd7bpi24", - "skill/valory/reset_pause_abci/0.1.0": "bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba", - "skill/valory/registration_abci/0.1.0": "bafybeibc7duasoaw5b4ene5oxfba2dmdzstsrws6ipi57ymgdtoxjadn54", - "skill/valory/abstract_round_abci/0.1.0": "bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u", - "skill/valory/termination_abci/0.1.0": "bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm", - "skill/valory/transaction_settlement_abci/0.1.0": "bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae" + "skill/valory/abstract_abci/0.1.0": "bafybeidhxykmvnc35de2ne52vwncoowcvcsc6xwja4txg6j27wicadojuq", + "skill/valory/reset_pause_abci/0.1.0": "bafybeib6yae55mfof2yamd7plwr6twuxobfvpurm4bede6rhcqhllyoxnm", + "skill/valory/registration_abci/0.1.0": "bafybeihu4srivuolt4hdw6ovwl33p7bcsm44soaebqpfjvy32jbbtypwum", + "skill/valory/abstract_round_abci/0.1.0": "bafybeid3f7hted4j44fpmlg6hbjadtldir6k2jauo7gyptuezwpbvkqsrm", + "skill/valory/termination_abci/0.1.0": "bafybeigq3ehr5gvaysomh6lo4j6vmgyw2dgdemsoxzf5kxjanktbibgci4", + "skill/valory/transaction_settlement_abci/0.1.0": "bafybeie3tjka4hwcvtg2rm5n6peazpskzuhg2p4zykdcypjotouclqw2ui" } } \ No newline at end of file diff --git a/packages/valory/agents/farcaster_test/aea-config.yaml b/packages/valory/agents/farcaster_test/aea-config.yaml index 56a100dd..6b5dc9ce 100644 --- a/packages/valory/agents/farcaster_test/aea-config.yaml +++ b/packages/valory/agents/farcaster_test/aea-config.yaml @@ -8,17 +8,17 @@ fingerprint: __init__.py: bafybeiatca7tc6weiyw7zame2rcm7ihchahqwzavoz6uqchs4w7ejpbmqa fingerprint_ignore_patterns: [] connections: -- valory/ipfs:0.1.0:bafybeigcijdbwgdekow5c2ikeltetoteabfp52ewy3xfkd7ygaqbl7j3ke -- valory/abci:0.1.0:bafybeia6etkacvqend7xj6viejkqgo7ozu3yn4yg3qezfthf2xhrjjwse4 +- valory/ipfs:0.1.0:bafybeiegnapkvkamis47v5ioza2haerrjdzzb23rptpmcydyneas7jc2wm +- valory/abci:0.1.0:bafybeibvb5gixohtgx22oymwlb2nntdzicdu2jkbs66azvmag6zf7vgfoq - valory/http_client:0.23.0:bafybeihi772xgzpqeipp3fhmvpct4y6e6tpjp4sogwqrnf3wqspgeilg4u -- valory/ledger:0.19.0:bafybeig7woeog4srdby75hpjkmx4rhpkzncbf4h2pm5r6varsp26pf2uhu +- valory/ledger:0.19.0:bafybeigntoericenpzvwejqfuc3kqzo2pscs76qoygg5dbj6f4zxusru5e - valory/p2p_libp2p_client:0.1.0:bafybeid3xg5k2ol5adflqloy75ibgljmol6xsvzvezebsg7oudxeeolz7e - valory/farcaster:0.1.0:bafybeibbdas7lxbipksodaphjms3uop7vnzjqkroktjq2g6wbvgtlldaxi contracts: -- valory/gnosis_safe:0.1.0:bafybeih3ropivth4wn7zbzudisx3qezbht5jyndd4w7az7fq634lpozoge -- valory/gnosis_safe_proxy_factory:0.1.0:bafybeieg57u3z7cdlmdamad5e6lk7kmsli2zurzkg3sl4y7lhekcu4y3au +- valory/gnosis_safe:0.1.0:bafybeihjaxefx27ppcghwmnsehbrqqmhwkiur5mprpsdp7tluge7zzwqgm +- valory/gnosis_safe_proxy_factory:0.1.0:bafybeibcq4gedbqxrvg2lwj3gwcxoyfa45x3s2qiefiru6epudzu4dhjr4 - valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y -- valory/service_registry:0.1.0:bafybeiaop64kwdoetxtedoehabmsalojmms7ihuoqcdwxtwb2hk5i6bzye +- valory/service_registry:0.1.0:bafybeicjpbrvcuzad4aaf56r5gsd4sebmeqkytr3zsbvb54snix73pvz2m protocols: - open_aea/signing:1.0.0:bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi - valory/abci:0.1.0:bafybeiaqmp7kocbfdboksayeqhkbrynvlfzsx4uy4x6nohywnmaig4an7u @@ -30,12 +30,12 @@ protocols: - valory/tendermint:0.1.0:bafybeig4mi3vmlv5zpbjbfuzcgida6j5f2nhrpedxicmrrfjweqc5r7cra - valory/srr:0.1.0:bafybeihrixgptxuqpf2s4nujypwlv5aed2nboozq5kl4c26cxw6r7si2x4 skills: -- valory/abstract_abci:0.1.0:bafybeieeaseuy5rbbw465knz27vccvpkfge43q7isl7fkdlfapwd7bpi24 -- valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/farcaster_test_abci:0.1.0:bafybeidkrbog6z54364dor5irf5tlebhaxy4btnmb2cgobpswqfh6cfk5i -- valory/registration_abci:0.1.0:bafybeibc7duasoaw5b4ene5oxfba2dmdzstsrws6ipi57ymgdtoxjadn54 -- valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba -- valory/farcaster_write_abci:0.1.0:bafybeihiayft7ovmijrstdo6m7fd5pqnqi7z2mximljpeskambbgo6476q +- valory/abstract_abci:0.1.0:bafybeidhxykmvnc35de2ne52vwncoowcvcsc6xwja4txg6j27wicadojuq +- valory/abstract_round_abci:0.1.0:bafybeid3f7hted4j44fpmlg6hbjadtldir6k2jauo7gyptuezwpbvkqsrm +- valory/farcaster_test_abci:0.1.0:bafybeicj77n27dskvotxx7dujwbdau4cu4v2tsualmgzbm2xseqc2naeae +- valory/registration_abci:0.1.0:bafybeihu4srivuolt4hdw6ovwl33p7bcsm44soaebqpfjvy32jbbtypwum +- valory/reset_pause_abci:0.1.0:bafybeib6yae55mfof2yamd7plwr6twuxobfvpurm4bede6rhcqhllyoxnm +- valory/farcaster_write_abci:0.1.0:bafybeicnw7awdmzyvat4ts4ankw57auvxr2dsjcofmiklenblmrd7fdeye default_ledger: ethereum required_ledgers: - ethereum diff --git a/packages/valory/agents/impact_evaluator/aea-config.yaml b/packages/valory/agents/impact_evaluator/aea-config.yaml index 6e206c9a..b184db5a 100644 --- a/packages/valory/agents/impact_evaluator/aea-config.yaml +++ b/packages/valory/agents/impact_evaluator/aea-config.yaml @@ -16,18 +16,18 @@ fingerprint: fingerprint_ignore_patterns: [] connections: - valory/http_server:0.22.0:bafybeihpgu56ovmq4npazdbh6y6ru5i7zuv6wvdglpxavsckyih56smu7m -- valory/abci:0.1.0:bafybeia6etkacvqend7xj6viejkqgo7ozu3yn4yg3qezfthf2xhrjjwse4 +- valory/abci:0.1.0:bafybeibvb5gixohtgx22oymwlb2nntdzicdu2jkbs66azvmag6zf7vgfoq - valory/http_client:0.23.0:bafybeihi772xgzpqeipp3fhmvpct4y6e6tpjp4sogwqrnf3wqspgeilg4u -- valory/ledger:0.19.0:bafybeig7woeog4srdby75hpjkmx4rhpkzncbf4h2pm5r6varsp26pf2uhu +- valory/ledger:0.19.0:bafybeigntoericenpzvwejqfuc3kqzo2pscs76qoygg5dbj6f4zxusru5e - valory/p2p_libp2p_client:0.1.0:bafybeid3xg5k2ol5adflqloy75ibgljmol6xsvzvezebsg7oudxeeolz7e - valory/openai:0.1.0:bafybeigyehjbahya5mp7vyp5tjvn36rey4btvzskp3ql3mgxp3zu6gwq5a - valory/twitter:0.1.0:bafybeidcalgczvpoq6l2uh7kkfblwxmytm6bicmsxub7pevu2k46sp7mky contracts: - valory/dynamic_contribution:0.1.0:bafybeia4qhu3u3fl6gx5vk7ue3qadbcliltuvcx46zsxcffq7phsb54rbq -- valory/gnosis_safe:0.1.0:bafybeih3ropivth4wn7zbzudisx3qezbht5jyndd4w7az7fq634lpozoge -- valory/gnosis_safe_proxy_factory:0.1.0:bafybeieg57u3z7cdlmdamad5e6lk7kmsli2zurzkg3sl4y7lhekcu4y3au +- valory/gnosis_safe:0.1.0:bafybeihjaxefx27ppcghwmnsehbrqqmhwkiur5mprpsdp7tluge7zzwqgm +- valory/gnosis_safe_proxy_factory:0.1.0:bafybeibcq4gedbqxrvg2lwj3gwcxoyfa45x3s2qiefiru6epudzu4dhjr4 - valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y -- valory/service_registry:0.1.0:bafybeiaop64kwdoetxtedoehabmsalojmms7ihuoqcdwxtwb2hk5i6bzye +- valory/service_registry:0.1.0:bafybeicjpbrvcuzad4aaf56r5gsd4sebmeqkytr3zsbvb54snix73pvz2m - valory/veolas_delegation:0.1.0:bafybeieicrbkito2hglwvd4j2cbq3etxpm3rrzfyx5kqqe34fu7q5aftye protocols: - open_aea/signing:1.0.0:bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi @@ -41,23 +41,23 @@ protocols: - valory/tendermint:0.1.0:bafybeig4mi3vmlv5zpbjbfuzcgida6j5f2nhrpedxicmrrfjweqc5r7cra - valory/twitter:0.1.0:bafybeig7dugazhljpb4qtu4zfnoimttvivopiq574rogjz3qggf5eysnk4 skills: -- valory/abstract_abci:0.1.0:bafybeieeaseuy5rbbw465knz27vccvpkfge43q7isl7fkdlfapwd7bpi24 -- valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/impact_evaluator_abci:0.1.0:bafybeifbgoisaa553l6oi5odt5d24hqwdz3ev6eqffh4tqkfzd73l3f6uu -- valory/generic_scoring_abci:0.1.0:bafybeidxytbreu7sudoggnfjxpbfxsxwbis6dipokkq6uo23xaautnwca4 -- valory/twitter_scoring_abci:0.1.0:bafybeiedultjq4wokxuchbr4nv7m3y3mqq6qwtir6m5epggnbgew6yb24i -- valory/ceramic_read_abci:0.1.0:bafybeiede3ehp4bfpbk23gncj52goq62rd3rm5wwlbyaexxrfohucdcpia -- valory/ceramic_write_abci:0.1.0:bafybeiemid3ipekyqupbqpfw55g7b2wwx56g2ita73rjalk6fyqgneroam -- valory/dynamic_nft_abci:0.1.0:bafybeietq6nqkeze6esw5dwa4cjajluzd2tvg24hlg2pihxz2v67vxorpu -- valory/registration_abci:0.1.0:bafybeibc7duasoaw5b4ene5oxfba2dmdzstsrws6ipi57ymgdtoxjadn54 -- valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba -- valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm -- valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae -- valory/twitter_write_abci:0.1.0:bafybeid377kr5f3dmb5nyhvucglyaaqkuhthxkfosgl54zskwmsuwz56ie -- valory/decision_making_abci:0.1.0:bafybeigsywkfb4lujy4y2c5tsmr2iulq7s6uad7uv2fbiwv7awxz5wfbi4 -- valory/llm_abci:0.1.0:bafybeibmckwphs5zqdfnutktwgq7bxfw2auhsxezoopkep5dadkuwqvwgy -- valory/olas_week_abci:0.1.0:bafybeifvhx6issf3xzesjihtbl63ymfrdvzfp4lqrg7liesyes4aiaydfm -- valory/mech_interact_abci:0.1.0:bafybeigto5ssrbrbqmeoc6wijcly2klmrhfcnaioa5u3wsofdm7bccowcq +- valory/abstract_abci:0.1.0:bafybeidhxykmvnc35de2ne52vwncoowcvcsc6xwja4txg6j27wicadojuq +- valory/abstract_round_abci:0.1.0:bafybeid3f7hted4j44fpmlg6hbjadtldir6k2jauo7gyptuezwpbvkqsrm +- valory/impact_evaluator_abci:0.1.0:bafybeihnp2bq2jysvwscyh7h5wf3mnir6ydhebhvyfcs52to42lz2rzl3y +- valory/generic_scoring_abci:0.1.0:bafybeigdvre5wm6x4pqp523b33nw4ofmyjgx43dsqmzeieazba6aioj3ye +- valory/twitter_scoring_abci:0.1.0:bafybeifufpx2b34psg3ut5tcwsl5nz2hcwsvqtf2qansta6spgir5nahfu +- valory/ceramic_read_abci:0.1.0:bafybeiaycqch7edausdhktbxmrve5i2hbslus2feyog2aqjlfq6rcr5ajy +- valory/ceramic_write_abci:0.1.0:bafybeifbqpvl6dmvm6wke626lzoubmid36yefjrpqfmpb63y6snbzebdva +- valory/dynamic_nft_abci:0.1.0:bafybeiakaaancbm4skuhd4tur4u7imftfmboocaef55hbqvbtvbgyvupuu +- valory/registration_abci:0.1.0:bafybeihu4srivuolt4hdw6ovwl33p7bcsm44soaebqpfjvy32jbbtypwum +- valory/reset_pause_abci:0.1.0:bafybeib6yae55mfof2yamd7plwr6twuxobfvpurm4bede6rhcqhllyoxnm +- valory/termination_abci:0.1.0:bafybeigq3ehr5gvaysomh6lo4j6vmgyw2dgdemsoxzf5kxjanktbibgci4 +- valory/transaction_settlement_abci:0.1.0:bafybeie3tjka4hwcvtg2rm5n6peazpskzuhg2p4zykdcypjotouclqw2ui +- valory/twitter_write_abci:0.1.0:bafybeihzssdoyl36g6if247ceohq26kjeazugwavl7u5vvickzknczoqye +- valory/decision_making_abci:0.1.0:bafybeigv6c7azm3gryzuqu4e2egh3ge2wvk3hlv4da7gyis6lnonehje6e +- valory/llm_abci:0.1.0:bafybeiaz6sb7ez7kusriiijk5bb7oqynzxmlgkrbqjhur7u52gkcrfdwmy +- valory/olas_week_abci:0.1.0:bafybeieugq7vjzjia237c7dfwfquvwfvyk765wybhrmmqtcwmjk5mydeie +- valory/mech_interact_abci:0.1.0:bafybeidyshkn7hefjfbyjyl53sc5kllemwpoh6zxhnlsbwnk3xnzvaveyu default_ledger: ethereum required_ledgers: - ethereum diff --git a/packages/valory/contracts/mech_marketplace/README.md b/packages/valory/contracts/mech_marketplace/README.md new file mode 100644 index 00000000..22522064 --- /dev/null +++ b/packages/valory/contracts/mech_marketplace/README.md @@ -0,0 +1 @@ +# Agent Mech Marketplace Contract diff --git a/packages/valory/contracts/mech_marketplace/__init__.py b/packages/valory/contracts/mech_marketplace/__init__.py new file mode 100644 index 00000000..bb07482e --- /dev/null +++ b/packages/valory/contracts/mech_marketplace/__init__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------------------------ +# +# Copyright 2024 Valory AG +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ------------------------------------------------------------------------------ + +"""This module contains the support resources for an agent MechMarketplace.""" diff --git a/packages/valory/contracts/mech_marketplace/build/mech.json b/packages/valory/contracts/mech_marketplace/build/mech.json new file mode 100644 index 00000000..dae53c60 --- /dev/null +++ b/packages/valory/contracts/mech_marketplace/build/mech.json @@ -0,0 +1,837 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "AgentMech", + "sourceName": "contracts/AgentMech.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_stakingFactory", + "type": "address" + }, + { + "internalType": "address", + "name": "_karmaProxy", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_minResponseTimeout", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxResponseTimeout", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + } + ], + "name": "AlreadyDelivered", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "provided", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "OutOfBounds", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "provided", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "Overflow", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnerOnly", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "current", + "type": "uint256" + } + ], + "name": "PriorityMechResponseTimeout", + "type": "error" + }, + { + "inputs": [], + "name": "ReentrancyGuard", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "stakingInstance", + "type": "address" + }, + { + "internalType": "uint256", + "name": "serviceId", + "type": "uint256" + } + ], + "name": "ServiceNotStaked", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "UnauthorizedAccount", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroValue", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "factory", + "type": "address" + } + ], + "name": "FactoryUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "priorityMech", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "actualMech", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "requester", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "MarketplaceDeliver", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "requester", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "requestedMech", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "MarketplaceRequest", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "mech", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "status", + "type": "bool" + } + ], + "name": "MechRegistrationStatusChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "minResponseTimeout", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maxResponseTimeout", + "type": "uint256" + } + ], + "name": "MinMaxResponseTimeoutUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnerUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR_TYPE_HASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "chainId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "mech", + "type": "address" + }, + { + "internalType": "address", + "name": "mechStakingInstance", + "type": "address" + }, + { + "internalType": "uint256", + "name": "mechServiceId", + "type": "uint256" + } + ], + "name": "checkMech", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "requester", + "type": "address" + }, + { + "internalType": "address", + "name": "requesterStakingInstance", + "type": "address" + }, + { + "internalType": "uint256", + "name": "requesterServiceId", + "type": "uint256" + } + ], + "name": "checkRequester", + "outputs": [], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "stakingInstance", + "type": "address" + }, + { + "internalType": "uint256", + "name": "serviceId", + "type": "uint256" + } + ], + "name": "checkStakingInstance", + "outputs": [], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "requestData", + "type": "bytes" + }, + { + "internalType": "address", + "name": "deliveryMechStakingInstance", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deliveryMechServiceId", + "type": "uint256" + } + ], + "name": "deliverMarketplace", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "domainSeparator", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getDeliveriesCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDomainSeparator", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + } + ], + "name": "getMechDeliveryInfo", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "priorityMech", + "type": "address" + }, + { + "internalType": "address", + "name": "deliveryMech", + "type": "address" + }, + { + "internalType": "address", + "name": "requester", + "type": "address" + }, + { + "internalType": "uint32", + "name": "responseTimeout", + "type": "uint32" + } + ], + "internalType": "struct MechDelivery", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "mechService", + "type": "address" + } + ], + "name": "getMechServiceDeliveriesCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "getRequestId", + "outputs": [ + { + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + } + ], + "name": "getRequestStatus", + "outputs": [ + { + "internalType": "enum MechMarketplace.RequestStatus", + "name": "status", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getRequestsCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "karmaProxy", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "mapDeliveryCounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "mapMechServiceDeliveryCounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "mapNonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "mapRequestCounts", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "mapRequestIdDeliveries", + "outputs": [ + { + "internalType": "address", + "name": "priorityMech", + "type": "address" + }, + { + "internalType": "address", + "name": "deliveryMech", + "type": "address" + }, + { + "internalType": "address", + "name": "requester", + "type": "address" + }, + { + "internalType": "uint32", + "name": "responseTimeout", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxResponseTimeout", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minResponseTimeout", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "numTotalRequests", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "numUndeliveredRequests", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "address", + "name": "priorityMech", + "type": "address" + }, + { + "internalType": "address", + "name": "priorityMechStakingInstance", + "type": "address" + }, + { + "internalType": "uint256", + "name": "priorityMechServiceId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "requesterStakingInstance", + "type": "address" + }, + { + "internalType": "uint256", + "name": "requesterServiceId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "responseTimeout", + "type": "uint256" + } + ], + "name": "request", + "outputs": [ + { + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "stakingFactory", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x60806040525f805534801562000013575f80fd5b50604051620026cc380380620026cc833981016040819052620000369162000391565b604080516001600160a01b03851660208201528082018490528151808203830181526060909101909152839083906200006f8162000145565b5050506001600160a01b0383166200009a5760405163d92e233d60e01b815260040160405180910390fd5b6040516331a9108f60e11b8152600481018390525f906001600160a01b03851690636352211e90602401602060405180830381865afa158015620000e0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620001069190620003c6565b90506001600160a01b0381166200013857604051630ede975960e01b8152600481018490526024015b60405180910390fd5b50600155506200049a9050565b6200014f620001ad565b51156200019f5760405162461bcd60e51b815260206004820152601360248201527f416c726561647920696e697469616c697a65640000000000000000000000000060448201526064016200012f565b620001aa8162000218565b50565b6060620002136200020d604051606b60f91b6020820152602560fa1b60218201526001600160601b03193060601b166022820152600160f81b60368201525f90603701604051602081830303815290604052805190602001205f1c905090565b620002e1565b905090565b5f620002248262000339565b90505f8151602083015ff090506200028b604051606b60f91b6020820152602560fa1b60218201526001600160601b03193060601b166022820152600160f81b60368201525f90603701604051602081830303815290604052805190602001205f1c905090565b6001600160a01b0316816001600160a01b031614620002dc5760405162461bcd60e51b815260206004820152600c60248201526b15dc9a5d194819985a5b195960a21b60448201526064016200012f565b505050565b6060813b600181116200030357505060408051602081019091525f8152919050565b806200030f81620003fd565b9150506040519150601f19601f602083010116820160405280825280600160208401853c50919050565b6060815160016200034b919062000415565b826040516020016200035f92919062000431565b6040516020818303038152906040529050919050565b80516001600160a01b03811681146200038c575f80fd5b919050565b5f805f60608486031215620003a4575f80fd5b620003af8462000375565b925060208401519150604084015190509250925092565b5f60208284031215620003d7575f80fd5b620003e28262000375565b9392505050565b634e487b7160e01b5f52601160045260245ffd5b5f816200040e576200040e620003e9565b505f190190565b808201808211156200042b576200042b620003e9565b92915050565b606360f81b815260e083901b6001600160e01b03191660018201526880600e6000396000f360b81b60058201525f600e82018190528251815b8181101562000489576020818601810151600f8684010152016200046a565b505f9201600f019182525092915050565b61222480620004a85f395ff3fe60806040526004361061017a575f3560e01c8063a035b1fe116100d1578063bdf863171161007c578063f23a6e6111610057578063f23a6e61146104d2578063f6171e4414610517578063fc0c546a14610536575f80fd5b8063bdf8631714610472578063c7dec3fc14610487578063e00b9118146104b3575f80fd5b8063b0d691fe116100ac578063b0d691fe146103d1578063b94207d314610418578063bc197c811461042b575f80fd5b8063a035b1fe1461038a578063a4f9edbf1461039f578063affed0e0146103be575f80fd5b80633a871cdd116101315780636d70f7ae1161010c5780636d70f7ae146102fb5780637af734731461032a57806391b7f5ed1461036b575f80fd5b80633a871cdd1461028557806358ce0909146102a45780635fee6085146102d0575f80fd5b8063157305fe11610161578063157305fe146102255780631626ba7e1461024457806317d70f7c14610263575f80fd5b806223de2914610185578063150b7a02146101ab575f80fd5b3661018157005b5f80fd5b348015610190575f80fd5b506101a961019f366004611943565b5050505050505050565b005b3480156101b6575f80fd5b506101ef6101c53660046119ed565b7f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020015b60405180910390f35b348015610230575f80fd5b506101a961023f366004611b2f565b61054a565b34801561024f575f80fd5b506101ef61025e366004611b2f565b610771565b34801561026e575f80fd5b50610277610914565b60405190815260200161021c565b348015610290575f80fd5b5061027761029f366004611b73565b610938565b3480156102af575f80fd5b506102c36102be366004611bc2565b610974565b60405161021c9190611be2565b3480156102db575f80fd5b506102776102ea366004611c25565b60036020525f908152604090205481565b348015610306575f80fd5b5061031a610315366004611c25565b610ada565b604051901515815260200161021c565b348015610335575f80fd5b50610277610344366004611c25565b73ffffffffffffffffffffffffffffffffffffffff165f9081526003602052604090205490565b348015610376575f80fd5b506101a9610385366004611c40565b610bac565b348015610395575f80fd5b5061027760015481565b3480156103aa575f80fd5b506101a96103b9366004611c57565b610c9a565b3480156103c9575f80fd5b505f54610277565b3480156103dc575f80fd5b50730576a174d229e3cfa37253523e645a78a0c91b575b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161021c565b610277610426366004611c57565b610d16565b348015610436575f80fd5b506101ef610445366004611cd2565b7fbc197c810000000000000000000000000000000000000000000000000000000098975050505050505050565b34801561047d575f80fd5b5061027760025481565b348015610492575f80fd5b506104a66104a1366004611d68565b610e63565b60405161021c9190611e45565b3480156104be575f80fd5b506102776104cd366004611e57565b610f4d565b3480156104dd575f80fd5b506101ef6104ec366004611e8e565b7ff23a6e61000000000000000000000000000000000000000000000000000000009695505050505050565b348015610522575f80fd5b50610277610531366004611bc2565b610f9e565b348015610541575f80fd5b506103f3610fc0565b61055333610ada565b80610571575033730576a174d229e3cfa37253523e645a78a0c91b57145b610602576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4f6e6c792063616c6c61626c6520627920746865206d656368206f706572617460448201527f6f72206f722074686520656e74727920706f696e7420636f6e7472616374000060648201526084015b60405180910390fd5b5f828152600460205260408082208151808301928390529160029082845b8154815260200190600101908083116106205750505050509050805f6002811061064c5761064c611f05565b602002015115801561066057506020810151155b801561069557505f805260046020527f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ed548314155b156106cf576040517ffe239804000000000000000000000000000000000000000000000000000000008152600481018490526024016105f9565b6020818101805183515f908152600490935260408084206001908101929092558451925184528084209290925585835290822082815501819055600280549161071783611f5f565b91905055503373ffffffffffffffffffffffffffffffffffffffff167f0cd979445339c62199996f208428d987b1cea24d18e62b79ec24d94b636e8b708484604051610764929190611f93565b60405180910390a2505050565b5f805f8061079185602081015160408201516060909201515f1a92909190565b9094509250905060ff81165f036108a757828583016020016107b282610ada565b1580156107d5575073ffffffffffffffffffffffffffffffffffffffff82163014155b1561080857507fffffffff00000000000000000000000000000000000000000000000000000000945061090e9350505050565b6040517f1626ba7e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff831690631626ba7e9061085c908b908590600401611f93565b602060405180830381865afa158015610877573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061089b9190611fab565b9550505050505061090e565b6108b661031587838686610fdd565b156108e757507f1626ba7e00000000000000000000000000000000000000000000000000000000925061090e915050565b507fffffffff00000000000000000000000000000000000000000000000000000000925050505b92915050565b5f8061091e610ff9565b8060200190518101906109319190611fea565b9392505050565b5f6109416110cd565b61094b848461114c565b905061095a6040850185612016565b90505f0361096b5761096b8461124c565b610931826112ca565b6002546060905f849003610986578093505b806109918486612077565b11156109de576109a18385612077565b6040517f7ae596850000000000000000000000000000000000000000000000000000000081526004810191909152602481018290526044016105f9565b8315610ad3578367ffffffffffffffff8111156109fd576109fd611a5b565b604051908082528060200260200182016040528015610a26578160200160208202803683370190505b505f80805260046020527f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ed549193505b84811015610a81575f828152600460205260409020600101549150610a7a8161208a565b9050610a56565b505f5b85811015610ad05781848281518110610a9f57610a9f611f05565b6020908102919091018101919091525f9283526004905260409091206001015490610ac98161208a565b9050610a84565b50505b5092915050565b5f805f610ae5610ff9565b806020019051810190610af89190611fea565b915091508373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b8152600401610b4e91815260200190565b602060405180830381865afa158015610b69573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b8d91906120c1565b73ffffffffffffffffffffffffffffffffffffffff1614949350505050565b610bb533610ada565b80610bd3575033730576a174d229e3cfa37253523e645a78a0c91b57145b610c5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4f6e6c792063616c6c61626c6520627920746865206d656368206f706572617460448201527f6f72206f722074686520656e74727920706f696e7420636f6e7472616374000060648201526084016105f9565b60018190556040518181527f66cbca4f3c64fecf1dcb9ce094abcf7f68c3450a1d4e3a8e917dd621edb4ebe09060200160405180910390a150565b610ca2610ff9565b5115610d0a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f416c726561647920696e697469616c697a65640000000000000000000000000060448201526064016105f9565b610d138161133e565b50565b5f600154341015610d60576001546040517fb489782800000000000000000000000000000000000000000000000000000000815234600482015260248101919091526044016105f9565b610d6a3383610f4d565b335f908152600360205260408120805492935090610d878361208a565b909155505060046020525f81815260408082207f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ed80546001830181905590859055808452918320849055600280547f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ec94929392909190610e068361208a565b91905055503373ffffffffffffffffffffffffffffffffffffffff167f4bda649efe6b98b0f9c1d5e859c29e20910f45c66dabfe6fad4a4881f7faf9cc8587604051610e53929190611f93565b60405180910390a2505050919050565b6060610e6e33610ada565b80610e8c575033730576a174d229e3cfa37253523e645a78a0c91b57145b610f18576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4f6e6c792063616c6c61626c6520627920746865206d656368206f706572617460448201527f6f72206f722074686520656e74727920706f696e7420636f6e7472616374000060648201526084016105f9565b5f610f32878787878715610f2c57876114b3565b5a6114b3565b9250905080610f4357815160208301fd5b5095945050505050565b5f8282604051602001610f619291906120dc565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101209392505050565b6004602052815f5260405f208160028110610fb7575f80fd5b01549150829050565b5f80610fca610ff9565b80602001905181019061090e91906120c1565b5f805f610fec878787876115b6565b91509150610f438161169e565b60606110c86110c36040517fd60000000000000000000000000000000000000000000000000000000000000060208201527f940000000000000000000000000000000000000000000000000000000000000060218201527fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003060601b1660228201527f010000000000000000000000000000000000000000000000000000000000000060368201525f90603701604051602081830303815290604052805190602001205f1c905090565b611850565b905090565b33730576a174d229e3cfa37253523e645a78a0c91b571461114a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f6163636f756e743a206e6f742066726f6d20456e747279506f696e740000000060448201526064016105f9565b565b5f806111a4836040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c81018290525f90605c01604051602081830303815290604052805190602001209050919050565b90507f1626ba7e00000000000000000000000000000000000000000000000000000000611212826111d9610140880188612016565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061077192505050565b7fffffffff00000000000000000000000000000000000000000000000000000000161461124357600191505061090e565b505f9392505050565b5f80546020830135918061125f8361208a565b9190505514610d13576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f496e76616c6964206e6f6e63650000000000000000000000000000000000000060448201526064016105f9565b8015610d13576040515f9033907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90849084818181858888f193505050503d805f8114611332576040519150601f19603f3d011682016040523d82523d5f602084013e611337565b606091505b5050505050565b5f611348826118a5565b90505f8151602083015ff0905061141a6040517fd60000000000000000000000000000000000000000000000000000000000000060208201527f940000000000000000000000000000000000000000000000000000000000000060218201527fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003060601b1660228201527f010000000000000000000000000000000000000000000000000000000000000060368201525f90603701604051602081830303815290604052805190602001205f1c905090565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146114ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f5772697465206661696c6564000000000000000000000000000000000000000060448201526064016105f9565b505050565b5f606060018460018111156114ca576114ca61210a565b0361153e578673ffffffffffffffffffffffffffffffffffffffff1683866040516114f59190612137565b5f604051808303818686f4925050503d805f811461152e576040519150601f19603f3d011682016040523d82523d5f602084013e611533565b606091505b5090925090506115ac565b8673ffffffffffffffffffffffffffffffffffffffff168387876040516115659190612137565b5f60405180830381858888f193505050503d805f81146115a0576040519150601f19603f3d011682016040523d82523d5f602084013e6115a5565b606091505b5090925090505b9550959350505050565b5f807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156115eb57505f90506003611695565b604080515f8082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561163c573d5f803e3d5ffd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811661168f575f60019250925050611695565b91505f90505b94509492505050565b5f8160048111156116b1576116b161210a565b036116b95750565b60018160048111156116cd576116cd61210a565b03611734576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016105f9565b60028160048111156117485761174861210a565b036117af576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016105f9565b60038160048111156117c3576117c361210a565b03610d13576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016105f9565b6060813b6001811161187157505060408051602081019091525f8152919050565b8061187b81611f5f565b9150506040519150601f19601f602083010116820160405280825280600160208401853c50919050565b6060815160016118b59190612077565b826040516020016118c7929190612152565b6040516020818303038152906040529050919050565b73ffffffffffffffffffffffffffffffffffffffff81168114610d13575f80fd5b5f8083601f84011261190e575f80fd5b50813567ffffffffffffffff811115611925575f80fd5b60208301915083602082850101111561193c575f80fd5b9250929050565b5f805f805f805f8060c0898b03121561195a575f80fd5b8835611965816118dd565b97506020890135611975816118dd565b96506040890135611985816118dd565b955060608901359450608089013567ffffffffffffffff808211156119a8575f80fd5b6119b48c838d016118fe565b909650945060a08b01359150808211156119cc575f80fd5b506119d98b828c016118fe565b999c989b5096995094979396929594505050565b5f805f805f60808688031215611a01575f80fd5b8535611a0c816118dd565b94506020860135611a1c816118dd565b935060408601359250606086013567ffffffffffffffff811115611a3e575f80fd5b611a4a888289016118fe565b969995985093965092949392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f82601f830112611a97575f80fd5b813567ffffffffffffffff80821115611ab257611ab2611a5b565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715611af857611af8611a5b565b81604052838152866020858801011115611b10575f80fd5b836020870160208301375f602085830101528094505050505092915050565b5f8060408385031215611b40575f80fd5b82359150602083013567ffffffffffffffff811115611b5d575f80fd5b611b6985828601611a88565b9150509250929050565b5f805f60608486031215611b85575f80fd5b833567ffffffffffffffff811115611b9b575f80fd5b84016101608187031215611bad575f80fd5b95602085013595506040909401359392505050565b5f8060408385031215611bd3575f80fd5b50508035926020909101359150565b602080825282518282018190525f9190848201906040850190845b81811015611c1957835183529284019291840191600101611bfd565b50909695505050505050565b5f60208284031215611c35575f80fd5b8135610931816118dd565b5f60208284031215611c50575f80fd5b5035919050565b5f60208284031215611c67575f80fd5b813567ffffffffffffffff811115611c7d575f80fd5b611c8984828501611a88565b949350505050565b5f8083601f840112611ca1575f80fd5b50813567ffffffffffffffff811115611cb8575f80fd5b6020830191508360208260051b850101111561193c575f80fd5b5f805f805f805f8060a0898b031215611ce9575f80fd5b8835611cf4816118dd565b97506020890135611d04816118dd565b9650604089013567ffffffffffffffff80821115611d20575f80fd5b611d2c8c838d01611c91565b909850965060608b0135915080821115611d44575f80fd5b611d508c838d01611c91565b909650945060808b01359150808211156119cc575f80fd5b5f805f805f60a08688031215611d7c575f80fd5b8535611d87816118dd565b945060208601359350604086013567ffffffffffffffff811115611da9575f80fd5b611db588828901611a88565b935050606086013560028110611dc9575f80fd5b949793965091946080013592915050565b5f5b83811015611df4578181015183820152602001611ddc565b50505f910152565b5f8151808452611e13816020860160208601611dda565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081525f6109316020830184611dfc565b5f8060408385031215611e68575f80fd5b8235611e73816118dd565b9150602083013567ffffffffffffffff811115611b5d575f80fd5b5f805f805f8060a08789031215611ea3575f80fd5b8635611eae816118dd565b95506020870135611ebe816118dd565b94506040870135935060608701359250608087013567ffffffffffffffff811115611ee7575f80fd5b611ef389828a016118fe565b979a9699509497509295939492505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f81611f6d57611f6d611f32565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b828152604060208201525f611c896040830184611dfc565b5f60208284031215611fbb575f80fd5b81517fffffffff0000000000000000000000000000000000000000000000000000000081168114610931575f80fd5b5f8060408385031215611ffb575f80fd5b8251612006816118dd565b6020939093015192949293505050565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612049575f80fd5b83018035915067ffffffffffffffff821115612063575f80fd5b60200191503681900382131561193c575f80fd5b8082018082111561090e5761090e611f32565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036120ba576120ba611f32565b5060010190565b5f602082840312156120d1575f80fd5b8151610931816118dd565b73ffffffffffffffffffffffffffffffffffffffff83168152604060208201525f611c896040830184611dfc565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b5f8251612148818460208701611dda565b9190910192915050565b7f630000000000000000000000000000000000000000000000000000000000000081527fffffffff000000000000000000000000000000000000000000000000000000008360e01b1660018201527f80600e6000396000f3000000000000000000000000000000000000000000000060058201525f600e8201525f82516121e081600f850160208701611dda565b91909101600f01939250505056fea2646970667358221220c1913351e275e1fecd00c79cd676ed135b575df5d3a88ccc57419dc3081980a264736f6c63430008150033", + "deployedBytecode": "0x60806040526004361061017a575f3560e01c8063a035b1fe116100d1578063bdf863171161007c578063f23a6e6111610057578063f23a6e61146104d2578063f6171e4414610517578063fc0c546a14610536575f80fd5b8063bdf8631714610472578063c7dec3fc14610487578063e00b9118146104b3575f80fd5b8063b0d691fe116100ac578063b0d691fe146103d1578063b94207d314610418578063bc197c811461042b575f80fd5b8063a035b1fe1461038a578063a4f9edbf1461039f578063affed0e0146103be575f80fd5b80633a871cdd116101315780636d70f7ae1161010c5780636d70f7ae146102fb5780637af734731461032a57806391b7f5ed1461036b575f80fd5b80633a871cdd1461028557806358ce0909146102a45780635fee6085146102d0575f80fd5b8063157305fe11610161578063157305fe146102255780631626ba7e1461024457806317d70f7c14610263575f80fd5b806223de2914610185578063150b7a02146101ab575f80fd5b3661018157005b5f80fd5b348015610190575f80fd5b506101a961019f366004611943565b5050505050505050565b005b3480156101b6575f80fd5b506101ef6101c53660046119ed565b7f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020015b60405180910390f35b348015610230575f80fd5b506101a961023f366004611b2f565b61054a565b34801561024f575f80fd5b506101ef61025e366004611b2f565b610771565b34801561026e575f80fd5b50610277610914565b60405190815260200161021c565b348015610290575f80fd5b5061027761029f366004611b73565b610938565b3480156102af575f80fd5b506102c36102be366004611bc2565b610974565b60405161021c9190611be2565b3480156102db575f80fd5b506102776102ea366004611c25565b60036020525f908152604090205481565b348015610306575f80fd5b5061031a610315366004611c25565b610ada565b604051901515815260200161021c565b348015610335575f80fd5b50610277610344366004611c25565b73ffffffffffffffffffffffffffffffffffffffff165f9081526003602052604090205490565b348015610376575f80fd5b506101a9610385366004611c40565b610bac565b348015610395575f80fd5b5061027760015481565b3480156103aa575f80fd5b506101a96103b9366004611c57565b610c9a565b3480156103c9575f80fd5b505f54610277565b3480156103dc575f80fd5b50730576a174d229e3cfa37253523e645a78a0c91b575b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161021c565b610277610426366004611c57565b610d16565b348015610436575f80fd5b506101ef610445366004611cd2565b7fbc197c810000000000000000000000000000000000000000000000000000000098975050505050505050565b34801561047d575f80fd5b5061027760025481565b348015610492575f80fd5b506104a66104a1366004611d68565b610e63565b60405161021c9190611e45565b3480156104be575f80fd5b506102776104cd366004611e57565b610f4d565b3480156104dd575f80fd5b506101ef6104ec366004611e8e565b7ff23a6e61000000000000000000000000000000000000000000000000000000009695505050505050565b348015610522575f80fd5b50610277610531366004611bc2565b610f9e565b348015610541575f80fd5b506103f3610fc0565b61055333610ada565b80610571575033730576a174d229e3cfa37253523e645a78a0c91b57145b610602576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4f6e6c792063616c6c61626c6520627920746865206d656368206f706572617460448201527f6f72206f722074686520656e74727920706f696e7420636f6e7472616374000060648201526084015b60405180910390fd5b5f828152600460205260408082208151808301928390529160029082845b8154815260200190600101908083116106205750505050509050805f6002811061064c5761064c611f05565b602002015115801561066057506020810151155b801561069557505f805260046020527f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ed548314155b156106cf576040517ffe239804000000000000000000000000000000000000000000000000000000008152600481018490526024016105f9565b6020818101805183515f908152600490935260408084206001908101929092558451925184528084209290925585835290822082815501819055600280549161071783611f5f565b91905055503373ffffffffffffffffffffffffffffffffffffffff167f0cd979445339c62199996f208428d987b1cea24d18e62b79ec24d94b636e8b708484604051610764929190611f93565b60405180910390a2505050565b5f805f8061079185602081015160408201516060909201515f1a92909190565b9094509250905060ff81165f036108a757828583016020016107b282610ada565b1580156107d5575073ffffffffffffffffffffffffffffffffffffffff82163014155b1561080857507fffffffff00000000000000000000000000000000000000000000000000000000945061090e9350505050565b6040517f1626ba7e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff831690631626ba7e9061085c908b908590600401611f93565b602060405180830381865afa158015610877573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061089b9190611fab565b9550505050505061090e565b6108b661031587838686610fdd565b156108e757507f1626ba7e00000000000000000000000000000000000000000000000000000000925061090e915050565b507fffffffff00000000000000000000000000000000000000000000000000000000925050505b92915050565b5f8061091e610ff9565b8060200190518101906109319190611fea565b9392505050565b5f6109416110cd565b61094b848461114c565b905061095a6040850185612016565b90505f0361096b5761096b8461124c565b610931826112ca565b6002546060905f849003610986578093505b806109918486612077565b11156109de576109a18385612077565b6040517f7ae596850000000000000000000000000000000000000000000000000000000081526004810191909152602481018290526044016105f9565b8315610ad3578367ffffffffffffffff8111156109fd576109fd611a5b565b604051908082528060200260200182016040528015610a26578160200160208202803683370190505b505f80805260046020527f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ed549193505b84811015610a81575f828152600460205260409020600101549150610a7a8161208a565b9050610a56565b505f5b85811015610ad05781848281518110610a9f57610a9f611f05565b6020908102919091018101919091525f9283526004905260409091206001015490610ac98161208a565b9050610a84565b50505b5092915050565b5f805f610ae5610ff9565b806020019051810190610af89190611fea565b915091508373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b8152600401610b4e91815260200190565b602060405180830381865afa158015610b69573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b8d91906120c1565b73ffffffffffffffffffffffffffffffffffffffff1614949350505050565b610bb533610ada565b80610bd3575033730576a174d229e3cfa37253523e645a78a0c91b57145b610c5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4f6e6c792063616c6c61626c6520627920746865206d656368206f706572617460448201527f6f72206f722074686520656e74727920706f696e7420636f6e7472616374000060648201526084016105f9565b60018190556040518181527f66cbca4f3c64fecf1dcb9ce094abcf7f68c3450a1d4e3a8e917dd621edb4ebe09060200160405180910390a150565b610ca2610ff9565b5115610d0a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f416c726561647920696e697469616c697a65640000000000000000000000000060448201526064016105f9565b610d138161133e565b50565b5f600154341015610d60576001546040517fb489782800000000000000000000000000000000000000000000000000000000815234600482015260248101919091526044016105f9565b610d6a3383610f4d565b335f908152600360205260408120805492935090610d878361208a565b909155505060046020525f81815260408082207f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ed80546001830181905590859055808452918320849055600280547f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ec94929392909190610e068361208a565b91905055503373ffffffffffffffffffffffffffffffffffffffff167f4bda649efe6b98b0f9c1d5e859c29e20910f45c66dabfe6fad4a4881f7faf9cc8587604051610e53929190611f93565b60405180910390a2505050919050565b6060610e6e33610ada565b80610e8c575033730576a174d229e3cfa37253523e645a78a0c91b57145b610f18576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4f6e6c792063616c6c61626c6520627920746865206d656368206f706572617460448201527f6f72206f722074686520656e74727920706f696e7420636f6e7472616374000060648201526084016105f9565b5f610f32878787878715610f2c57876114b3565b5a6114b3565b9250905080610f4357815160208301fd5b5095945050505050565b5f8282604051602001610f619291906120dc565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101209392505050565b6004602052815f5260405f208160028110610fb7575f80fd5b01549150829050565b5f80610fca610ff9565b80602001905181019061090e91906120c1565b5f805f610fec878787876115b6565b91509150610f438161169e565b60606110c86110c36040517fd60000000000000000000000000000000000000000000000000000000000000060208201527f940000000000000000000000000000000000000000000000000000000000000060218201527fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003060601b1660228201527f010000000000000000000000000000000000000000000000000000000000000060368201525f90603701604051602081830303815290604052805190602001205f1c905090565b611850565b905090565b33730576a174d229e3cfa37253523e645a78a0c91b571461114a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f6163636f756e743a206e6f742066726f6d20456e747279506f696e740000000060448201526064016105f9565b565b5f806111a4836040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c81018290525f90605c01604051602081830303815290604052805190602001209050919050565b90507f1626ba7e00000000000000000000000000000000000000000000000000000000611212826111d9610140880188612016565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061077192505050565b7fffffffff00000000000000000000000000000000000000000000000000000000161461124357600191505061090e565b505f9392505050565b5f80546020830135918061125f8361208a565b9190505514610d13576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f496e76616c6964206e6f6e63650000000000000000000000000000000000000060448201526064016105f9565b8015610d13576040515f9033907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90849084818181858888f193505050503d805f8114611332576040519150601f19603f3d011682016040523d82523d5f602084013e611337565b606091505b5050505050565b5f611348826118a5565b90505f8151602083015ff0905061141a6040517fd60000000000000000000000000000000000000000000000000000000000000060208201527f940000000000000000000000000000000000000000000000000000000000000060218201527fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003060601b1660228201527f010000000000000000000000000000000000000000000000000000000000000060368201525f90603701604051602081830303815290604052805190602001205f1c905090565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146114ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f5772697465206661696c6564000000000000000000000000000000000000000060448201526064016105f9565b505050565b5f606060018460018111156114ca576114ca61210a565b0361153e578673ffffffffffffffffffffffffffffffffffffffff1683866040516114f59190612137565b5f604051808303818686f4925050503d805f811461152e576040519150601f19603f3d011682016040523d82523d5f602084013e611533565b606091505b5090925090506115ac565b8673ffffffffffffffffffffffffffffffffffffffff168387876040516115659190612137565b5f60405180830381858888f193505050503d805f81146115a0576040519150601f19603f3d011682016040523d82523d5f602084013e6115a5565b606091505b5090925090505b9550959350505050565b5f807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156115eb57505f90506003611695565b604080515f8082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561163c573d5f803e3d5ffd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811661168f575f60019250925050611695565b91505f90505b94509492505050565b5f8160048111156116b1576116b161210a565b036116b95750565b60018160048111156116cd576116cd61210a565b03611734576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016105f9565b60028160048111156117485761174861210a565b036117af576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016105f9565b60038160048111156117c3576117c361210a565b03610d13576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016105f9565b6060813b6001811161187157505060408051602081019091525f8152919050565b8061187b81611f5f565b9150506040519150601f19601f602083010116820160405280825280600160208401853c50919050565b6060815160016118b59190612077565b826040516020016118c7929190612152565b6040516020818303038152906040529050919050565b73ffffffffffffffffffffffffffffffffffffffff81168114610d13575f80fd5b5f8083601f84011261190e575f80fd5b50813567ffffffffffffffff811115611925575f80fd5b60208301915083602082850101111561193c575f80fd5b9250929050565b5f805f805f805f8060c0898b03121561195a575f80fd5b8835611965816118dd565b97506020890135611975816118dd565b96506040890135611985816118dd565b955060608901359450608089013567ffffffffffffffff808211156119a8575f80fd5b6119b48c838d016118fe565b909650945060a08b01359150808211156119cc575f80fd5b506119d98b828c016118fe565b999c989b5096995094979396929594505050565b5f805f805f60808688031215611a01575f80fd5b8535611a0c816118dd565b94506020860135611a1c816118dd565b935060408601359250606086013567ffffffffffffffff811115611a3e575f80fd5b611a4a888289016118fe565b969995985093965092949392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f82601f830112611a97575f80fd5b813567ffffffffffffffff80821115611ab257611ab2611a5b565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715611af857611af8611a5b565b81604052838152866020858801011115611b10575f80fd5b836020870160208301375f602085830101528094505050505092915050565b5f8060408385031215611b40575f80fd5b82359150602083013567ffffffffffffffff811115611b5d575f80fd5b611b6985828601611a88565b9150509250929050565b5f805f60608486031215611b85575f80fd5b833567ffffffffffffffff811115611b9b575f80fd5b84016101608187031215611bad575f80fd5b95602085013595506040909401359392505050565b5f8060408385031215611bd3575f80fd5b50508035926020909101359150565b602080825282518282018190525f9190848201906040850190845b81811015611c1957835183529284019291840191600101611bfd565b50909695505050505050565b5f60208284031215611c35575f80fd5b8135610931816118dd565b5f60208284031215611c50575f80fd5b5035919050565b5f60208284031215611c67575f80fd5b813567ffffffffffffffff811115611c7d575f80fd5b611c8984828501611a88565b949350505050565b5f8083601f840112611ca1575f80fd5b50813567ffffffffffffffff811115611cb8575f80fd5b6020830191508360208260051b850101111561193c575f80fd5b5f805f805f805f8060a0898b031215611ce9575f80fd5b8835611cf4816118dd565b97506020890135611d04816118dd565b9650604089013567ffffffffffffffff80821115611d20575f80fd5b611d2c8c838d01611c91565b909850965060608b0135915080821115611d44575f80fd5b611d508c838d01611c91565b909650945060808b01359150808211156119cc575f80fd5b5f805f805f60a08688031215611d7c575f80fd5b8535611d87816118dd565b945060208601359350604086013567ffffffffffffffff811115611da9575f80fd5b611db588828901611a88565b935050606086013560028110611dc9575f80fd5b949793965091946080013592915050565b5f5b83811015611df4578181015183820152602001611ddc565b50505f910152565b5f8151808452611e13816020860160208601611dda565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081525f6109316020830184611dfc565b5f8060408385031215611e68575f80fd5b8235611e73816118dd565b9150602083013567ffffffffffffffff811115611b5d575f80fd5b5f805f805f8060a08789031215611ea3575f80fd5b8635611eae816118dd565b95506020870135611ebe816118dd565b94506040870135935060608701359250608087013567ffffffffffffffff811115611ee7575f80fd5b611ef389828a016118fe565b979a9699509497509295939492505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f81611f6d57611f6d611f32565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b828152604060208201525f611c896040830184611dfc565b5f60208284031215611fbb575f80fd5b81517fffffffff0000000000000000000000000000000000000000000000000000000081168114610931575f80fd5b5f8060408385031215611ffb575f80fd5b8251612006816118dd565b6020939093015192949293505050565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612049575f80fd5b83018035915067ffffffffffffffff821115612063575f80fd5b60200191503681900382131561193c575f80fd5b8082018082111561090e5761090e611f32565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036120ba576120ba611f32565b5060010190565b5f602082840312156120d1575f80fd5b8151610931816118dd565b73ffffffffffffffffffffffffffffffffffffffff83168152604060208201525f611c896040830184611dfc565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b5f8251612148818460208701611dda565b9190910192915050565b7f630000000000000000000000000000000000000000000000000000000000000081527fffffffff000000000000000000000000000000000000000000000000000000008360e01b1660018201527f80600e6000396000f3000000000000000000000000000000000000000000000060058201525f600e8201525f82516121e081600f850160208701611dda565b91909101600f01939250505056fea2646970667358221220c1913351e275e1fecd00c79cd676ed135b575df5d3a88ccc57419dc3081980a264736f6c63430008150033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/packages/valory/contracts/mech_marketplace/contract.py b/packages/valory/contracts/mech_marketplace/contract.py new file mode 100644 index 00000000..33e5a91c --- /dev/null +++ b/packages/valory/contracts/mech_marketplace/contract.py @@ -0,0 +1,260 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------------------------ +# +# Copyright 2024 Valory AG +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ------------------------------------------------------------------------------ + +"""This module contains the class to connect to a Mech Marketplace contract.""" + +import concurrent.futures +from typing import Any, Callable, Dict, List, cast + +from aea.common import JSONLike +from aea.configurations.base import PublicId +from aea.contracts.base import Contract +from aea.crypto.base import LedgerApi +from aea_ledger_ethereum import EthereumApi +from eth_typing import HexStr +from web3.types import BlockData, BlockIdentifier, EventData, TxReceipt + + +PUBLIC_ID = PublicId.from_str("valory/mech_marketplace:0.1.0") +FIVE_MINUTES = 300.0 + + + +class MechMarketplace(Contract): + """The Mech Marketplace contract.""" + + contract_id = PUBLIC_ID + + @staticmethod + def execute_with_timeout(func: Callable, timeout: float) -> Any: + """Execute a function with a timeout.""" + + # Create a ProcessPoolExecutor with a maximum of 1 worker (process) + with concurrent.futures.ThreadPoolExecutor(max_workers=1) as executor: + # Submit the function to the executor + future = executor.submit( + func, + ) + + try: + # Wait for the result with a 5-minute timeout + data = future.result(timeout=timeout) + except TimeoutError: + # Handle the case where the execution times out + err = f"The RPC didn't respond in {timeout}." + return None, err + + # Check if an error occurred + if isinstance(data, str): + # Handle the case where the execution failed + return None, data + + return data, None + + @classmethod + def get_request_data( + cls, + ledger_api: LedgerApi, + contract_address: str, + request_data: bytes, + priority_mech: str, + priority_mech_staking_instance: str, + priority_mech_service_id: int, + requester_staking_instance: str, + requester_service_id: int, + response_timeout: int, + **kwargs: Any + ) -> Dict[str, bytes]: + """Gets the encoded arguments for a request tx, which should only be called via the multisig. + + :param ledger_api: the ledger API object + :param contract_address: the contract's address + :param request_data: the request data + :param priority_mech: the priority mech address + :param priority_mech_staking_instance: the priority mech staking instance address + :param priority_mech_service_id: the priority mech service id + :param requester_staking_instance: the requester staking instance address + :param requester_service_id: the requester service id + :param response_timeout: the response timeout + """ + contract_address = ledger_api.api.to_checksum_address(contract_address) + contract_instance = cls.get_instance(ledger_api, contract_address) + encoded_data = contract_instance.encodeABI( + fn_name="request", + args=( + request_data, + priority_mech, + priority_mech_staking_instance, + priority_mech_service_id, + requester_staking_instance, + requester_service_id, + response_timeout, + ) + ) + return {"data": bytes.fromhex(encoded_data[2:])} + + @classmethod + def _process_event( + cls, + ledger_api: LedgerApi, + contract: Any, + tx_hash: HexStr, + expected_logs: int, + event_name: str, + *args: Any, + **kwargs: Any + ) -> JSONLike: + """Process the logs of the given event.""" + ledger_api = cast(EthereumApi, ledger_api) + receipt: TxReceipt = ledger_api.api.eth.get_transaction_receipt(tx_hash) + event_method = getattr(contract.events, event_name) + logs: List[EventData] = list(event_method().process_receipt(receipt)) + + n_logs = len(logs) + if n_logs != expected_logs: + error = f"{expected_logs} {event_name!r} events were expected. tx {tx_hash} emitted {n_logs} instead." + return {"error": error} + + results = [] + for log in logs: + event_args = log.get("args", None) + if event_args is None or any( + expected_key not in event_args for expected_key in args + ): + return {"error": f"The emitted event's ({event_name}) logs for tx {tx_hash} do not match the expected format: {log}"} + results.append({arg_name: event_args[arg_name] for arg_name in args}) + + return dict(results=results) + + @classmethod + def process_request_event( + cls, + ledger_api: LedgerApi, + contract_address: str, + tx_hash: HexStr, + expected_logs: int = 1, + **kwargs: Any + ) -> JSONLike: + """ + Process the request receipt to get the requestId and the given data from the `Request` event's logs. + + :param ledger_api: the ledger apis. + :param contract_address: the contract address. + :param tx_hash: the hash of a request tx to be processed. + :param expected_logs: the number of logs expected. + :return: a dictionary with a key named `results` + which contains a list of dictionaries (as many as the expected logs) containing the request id and the data. + """ + contract_address = ledger_api.api.to_checksum_address(contract_address) + contract_instance = cls.get_instance(ledger_api, contract_address) + res = cls._process_event( + ledger_api, contract_instance, tx_hash, expected_logs, "MarketplaceRequest", "requestId", "data" + ) + + return res + + @classmethod + def process_deliver_event( + cls, + ledger_api: LedgerApi, + contract_address: str, + tx_hash: HexStr, + expected_logs: int = 1, + **kwargs: Any + ) -> JSONLike: + """ + Process the request receipt to get the requestId and the delivered data if the `MarketplaceDeliver` event has been emitted. + + :param ledger_api: the ledger apis. + :param contract_address: the contract address. + :param tx_hash: the hash of a request tx to be processed. + :param expected_logs: the number of logs expected. + :return: a dictionary with the request id and the data. + """ + contract_address = ledger_api.api.to_checksum_address(contract_address) + contract_instance = cls.get_instance(ledger_api, contract_address) + res = cls._process_event( + ledger_api, contract_instance, tx_hash, expected_logs, "MarketplaceDeliver", "requestId", "data" + ) + + return res + + @classmethod + def get_block_number( + cls, + ledger_api: EthereumApi, + contract_address: str, + tx_hash: HexStr, + **kwargs: Any + ) -> JSONLike: + """Get the number of the block in which the tx of the given hash was settled.""" + contract_address = ledger_api.api.to_checksum_address(contract_address) + receipt: TxReceipt = ledger_api.api.eth.get_transaction_receipt(tx_hash) + block: BlockData = ledger_api.api.eth.get_block(receipt["blockNumber"]) + return dict(number=block["number"]) + + @classmethod + def get_response( + cls, + ledger_api: LedgerApi, + contract_address: str, + request_id: int, + from_block: BlockIdentifier = "earliest", + to_block: BlockIdentifier = "latest", + timeout: float = FIVE_MINUTES, + **kwargs: Any + ) -> JSONLike: + """Filter the `MarketplaceDeliver` events emitted by the contract and get the data of the given `request_id`.""" + contract_address = ledger_api.api.to_checksum_address(contract_address) + ledger_api = cast(EthereumApi, ledger_api) + + def get_responses() -> Any: + """Get the responses from the contract.""" + contract_instance = cls.get_instance(ledger_api, contract_address) + deliver_filter = contract_instance.events.MarketplaceDeliver.build_filter() + deliver_filter.fromBlock = from_block + deliver_filter.toBlock = to_block + deliver_filter.args.requestId.match_single(request_id) + delivered = list(deliver_filter.deploy(ledger_api.api).get_all_entries()) + n_delivered = len(delivered) + + if n_delivered == 0: + info = f"The mech ({contract_address}) has not delivered a response yet for request with id {request_id}." + return {"info": info} + + if n_delivered != 1: + error = ( + f"A single response was expected by the mech ({contract_address}) for request with id {request_id}. " + f"Received {n_delivered} responses: {delivered}." + ) + return error + + delivered_event = delivered.pop() + deliver_args = delivered_event.get("args", None) + if deliver_args is None or "data" not in deliver_args: + error = f"The mech's response does not match the expected format: {delivered_event}" + return error + + return dict(data=deliver_args["data"]) + + data, err = cls.execute_with_timeout(get_responses, timeout=timeout) + if err is not None: + return {"error": err} + + return data diff --git a/packages/valory/contracts/mech_marketplace/contract.yaml b/packages/valory/contracts/mech_marketplace/contract.yaml new file mode 100644 index 00000000..d41799bd --- /dev/null +++ b/packages/valory/contracts/mech_marketplace/contract.yaml @@ -0,0 +1,23 @@ +name: mech_marketplace +author: valory +version: 0.1.0 +type: contract +description: Agent mech marketplace contract. +license: Apache-2.0 +aea_version: '>=1.0.0, <2.0.0' +fingerprint: + README.md: bafybeihygfmkbo4cegrqnz5ws6bbjaifubvk7r2uyvuanxpqy24l634tba + __init__.py: bafybeie6625ddrcph7pcxef4fbfcuhyd6yuzdyyqcoqpc5xdjb4rttw7my + build/mech.json: bafybeif2doizav5rs5hig6bruaoz2bedlyesyh23s735llblh64vazespi + contract.py: bafybeiawzcqvkx7tip7tck2czf47d5rnolebmet3fbmv5p4hzpv3fmarwq +fingerprint_ignore_patterns: [] +contracts: [] +class_name: MechMarketplace +contract_interface_paths: + ethereum: build/mech.json +dependencies: + open-aea-ledger-ethereum: + version: ==1.53.0 + web3: + version: <7,>=6.0.0 + eth_typing: {} diff --git a/packages/valory/services/impact_evaluator/service.yaml b/packages/valory/services/impact_evaluator/service.yaml index 426bb934..9c6b2abc 100644 --- a/packages/valory/services/impact_evaluator/service.yaml +++ b/packages/valory/services/impact_evaluator/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeifhygewmf2pdq4vyeiwucoutziaw6nral34pxjtwjgybjp5rfu4aq +agent: valory/impact_evaluator:0.1.0:bafybeidtf6ae27b6hkxk2nvyjrt3wak7brofru5x3fwyx4ur2bvxtebbom number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/impact_evaluator_local/service.yaml b/packages/valory/services/impact_evaluator_local/service.yaml index 6bbe6fa1..e93e7df7 100644 --- a/packages/valory/services/impact_evaluator_local/service.yaml +++ b/packages/valory/services/impact_evaluator_local/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeifhygewmf2pdq4vyeiwucoutziaw6nral34pxjtwjgybjp5rfu4aq +agent: valory/impact_evaluator:0.1.0:bafybeidtf6ae27b6hkxk2nvyjrt3wak7brofru5x3fwyx4ur2bvxtebbom number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/ceramic_read_abci/skill.yaml b/packages/valory/skills/ceramic_read_abci/skill.yaml index 2f336715..f3bf3867 100644 --- a/packages/valory/skills/ceramic_read_abci/skill.yaml +++ b/packages/valory/skills/ceramic_read_abci/skill.yaml @@ -28,7 +28,7 @@ connections: [] contracts: [] protocols: [] skills: -- valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u +- valory/abstract_round_abci:0.1.0:bafybeid3f7hted4j44fpmlg6hbjadtldir6k2jauo7gyptuezwpbvkqsrm behaviours: main: args: {} diff --git a/packages/valory/skills/ceramic_write_abci/skill.yaml b/packages/valory/skills/ceramic_write_abci/skill.yaml index d614589f..f4b71603 100644 --- a/packages/valory/skills/ceramic_write_abci/skill.yaml +++ b/packages/valory/skills/ceramic_write_abci/skill.yaml @@ -28,8 +28,8 @@ connections: [] contracts: [] protocols: [] skills: -- valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/ceramic_read_abci:0.1.0:bafybeiede3ehp4bfpbk23gncj52goq62rd3rm5wwlbyaexxrfohucdcpia +- valory/abstract_round_abci:0.1.0:bafybeid3f7hted4j44fpmlg6hbjadtldir6k2jauo7gyptuezwpbvkqsrm +- valory/ceramic_read_abci:0.1.0:bafybeiaycqch7edausdhktbxmrve5i2hbslus2feyog2aqjlfq6rcr5ajy behaviours: main: args: {} diff --git a/packages/valory/skills/decision_making_abci/skill.yaml b/packages/valory/skills/decision_making_abci/skill.yaml index 96606668..42c9f2d6 100644 --- a/packages/valory/skills/decision_making_abci/skill.yaml +++ b/packages/valory/skills/decision_making_abci/skill.yaml @@ -52,8 +52,8 @@ contracts: protocols: - valory/contract_api:1.0.0:bafybeidgu7o5llh26xp3u3ebq3yluull5lupiyeu6iooi2xyymdrgnzq5i skills: -- valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/ceramic_read_abci:0.1.0:bafybeiede3ehp4bfpbk23gncj52goq62rd3rm5wwlbyaexxrfohucdcpia +- valory/abstract_round_abci:0.1.0:bafybeid3f7hted4j44fpmlg6hbjadtldir6k2jauo7gyptuezwpbvkqsrm +- valory/ceramic_read_abci:0.1.0:bafybeiaycqch7edausdhktbxmrve5i2hbslus2feyog2aqjlfq6rcr5ajy behaviours: main: args: {} diff --git a/packages/valory/skills/dynamic_nft_abci/skill.yaml b/packages/valory/skills/dynamic_nft_abci/skill.yaml index 86d87e74..5aa463d4 100644 --- a/packages/valory/skills/dynamic_nft_abci/skill.yaml +++ b/packages/valory/skills/dynamic_nft_abci/skill.yaml @@ -30,8 +30,8 @@ protocols: - valory/contract_api:1.0.0:bafybeidgu7o5llh26xp3u3ebq3yluull5lupiyeu6iooi2xyymdrgnzq5i - valory/http:1.0.0:bafybeifugzl63kfdmwrxwphrnrhj7bn6iruxieme3a4ntzejf6kmtuwmae skills: -- valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/decision_making_abci:0.1.0:bafybeigsywkfb4lujy4y2c5tsmr2iulq7s6uad7uv2fbiwv7awxz5wfbi4 +- valory/abstract_round_abci:0.1.0:bafybeid3f7hted4j44fpmlg6hbjadtldir6k2jauo7gyptuezwpbvkqsrm +- valory/decision_making_abci:0.1.0:bafybeigv6c7azm3gryzuqu4e2egh3ge2wvk3hlv4da7gyis6lnonehje6e behaviours: main: args: {} diff --git a/packages/valory/skills/farcaster_test_abci/skill.yaml b/packages/valory/skills/farcaster_test_abci/skill.yaml index b1ca4f9f..fd951cc0 100644 --- a/packages/valory/skills/farcaster_test_abci/skill.yaml +++ b/packages/valory/skills/farcaster_test_abci/skill.yaml @@ -18,10 +18,10 @@ connections: [] contracts: [] protocols: [] skills: -- valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/registration_abci:0.1.0:bafybeibc7duasoaw5b4ene5oxfba2dmdzstsrws6ipi57ymgdtoxjadn54 -- valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba -- valory/farcaster_write_abci:0.1.0:bafybeihiayft7ovmijrstdo6m7fd5pqnqi7z2mximljpeskambbgo6476q +- valory/abstract_round_abci:0.1.0:bafybeid3f7hted4j44fpmlg6hbjadtldir6k2jauo7gyptuezwpbvkqsrm +- valory/registration_abci:0.1.0:bafybeihu4srivuolt4hdw6ovwl33p7bcsm44soaebqpfjvy32jbbtypwum +- valory/reset_pause_abci:0.1.0:bafybeib6yae55mfof2yamd7plwr6twuxobfvpurm4bede6rhcqhllyoxnm +- valory/farcaster_write_abci:0.1.0:bafybeicnw7awdmzyvat4ts4ankw57auvxr2dsjcofmiklenblmrd7fdeye behaviours: main: args: {} diff --git a/packages/valory/skills/farcaster_write_abci/skill.yaml b/packages/valory/skills/farcaster_write_abci/skill.yaml index 5c4154e9..15110c91 100644 --- a/packages/valory/skills/farcaster_write_abci/skill.yaml +++ b/packages/valory/skills/farcaster_write_abci/skill.yaml @@ -21,7 +21,7 @@ contracts: [] protocols: - valory/srr:0.1.0:bafybeihrixgptxuqpf2s4nujypwlv5aed2nboozq5kl4c26cxw6r7si2x4 skills: -- valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u +- valory/abstract_round_abci:0.1.0:bafybeid3f7hted4j44fpmlg6hbjadtldir6k2jauo7gyptuezwpbvkqsrm behaviours: main: args: {} diff --git a/packages/valory/skills/generic_scoring_abci/skill.yaml b/packages/valory/skills/generic_scoring_abci/skill.yaml index 85c5520f..b4ebb477 100644 --- a/packages/valory/skills/generic_scoring_abci/skill.yaml +++ b/packages/valory/skills/generic_scoring_abci/skill.yaml @@ -27,8 +27,8 @@ connections: [] contracts: [] protocols: [] skills: -- valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/decision_making_abci:0.1.0:bafybeigsywkfb4lujy4y2c5tsmr2iulq7s6uad7uv2fbiwv7awxz5wfbi4 +- valory/abstract_round_abci:0.1.0:bafybeid3f7hted4j44fpmlg6hbjadtldir6k2jauo7gyptuezwpbvkqsrm +- valory/decision_making_abci:0.1.0:bafybeigv6c7azm3gryzuqu4e2egh3ge2wvk3hlv4da7gyis6lnonehje6e behaviours: main: args: {} diff --git a/packages/valory/skills/impact_evaluator_abci/skill.yaml b/packages/valory/skills/impact_evaluator_abci/skill.yaml index 1e7b1b2e..b58079f2 100644 --- a/packages/valory/skills/impact_evaluator_abci/skill.yaml +++ b/packages/valory/skills/impact_evaluator_abci/skill.yaml @@ -23,21 +23,21 @@ connections: [] contracts: [] protocols: [] skills: -- valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/ceramic_read_abci:0.1.0:bafybeiede3ehp4bfpbk23gncj52goq62rd3rm5wwlbyaexxrfohucdcpia -- valory/generic_scoring_abci:0.1.0:bafybeidxytbreu7sudoggnfjxpbfxsxwbis6dipokkq6uo23xaautnwca4 -- valory/twitter_scoring_abci:0.1.0:bafybeiedultjq4wokxuchbr4nv7m3y3mqq6qwtir6m5epggnbgew6yb24i -- valory/ceramic_write_abci:0.1.0:bafybeiemid3ipekyqupbqpfw55g7b2wwx56g2ita73rjalk6fyqgneroam -- valory/dynamic_nft_abci:0.1.0:bafybeietq6nqkeze6esw5dwa4cjajluzd2tvg24hlg2pihxz2v67vxorpu -- valory/registration_abci:0.1.0:bafybeibc7duasoaw5b4ene5oxfba2dmdzstsrws6ipi57ymgdtoxjadn54 -- valory/reset_pause_abci:0.1.0:bafybeigrdlxed3xlsnxtjhnsbl3cojruihxcqx4jxhgivkd5i2fkjncgba -- valory/termination_abci:0.1.0:bafybeib5l7jhew5ic6iq24dd23nidcoimzqkrk556gqywhoziatj33zvwm -- valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae -- valory/decision_making_abci:0.1.0:bafybeigsywkfb4lujy4y2c5tsmr2iulq7s6uad7uv2fbiwv7awxz5wfbi4 -- valory/llm_abci:0.1.0:bafybeibmckwphs5zqdfnutktwgq7bxfw2auhsxezoopkep5dadkuwqvwgy -- valory/twitter_write_abci:0.1.0:bafybeid377kr5f3dmb5nyhvucglyaaqkuhthxkfosgl54zskwmsuwz56ie -- valory/olas_week_abci:0.1.0:bafybeifvhx6issf3xzesjihtbl63ymfrdvzfp4lqrg7liesyes4aiaydfm -- valory/mech_interact_abci:0.1.0:bafybeigto5ssrbrbqmeoc6wijcly2klmrhfcnaioa5u3wsofdm7bccowcq +- valory/abstract_round_abci:0.1.0:bafybeid3f7hted4j44fpmlg6hbjadtldir6k2jauo7gyptuezwpbvkqsrm +- valory/ceramic_read_abci:0.1.0:bafybeiaycqch7edausdhktbxmrve5i2hbslus2feyog2aqjlfq6rcr5ajy +- valory/generic_scoring_abci:0.1.0:bafybeigdvre5wm6x4pqp523b33nw4ofmyjgx43dsqmzeieazba6aioj3ye +- valory/twitter_scoring_abci:0.1.0:bafybeifufpx2b34psg3ut5tcwsl5nz2hcwsvqtf2qansta6spgir5nahfu +- valory/ceramic_write_abci:0.1.0:bafybeifbqpvl6dmvm6wke626lzoubmid36yefjrpqfmpb63y6snbzebdva +- valory/dynamic_nft_abci:0.1.0:bafybeiakaaancbm4skuhd4tur4u7imftfmboocaef55hbqvbtvbgyvupuu +- valory/registration_abci:0.1.0:bafybeihu4srivuolt4hdw6ovwl33p7bcsm44soaebqpfjvy32jbbtypwum +- valory/reset_pause_abci:0.1.0:bafybeib6yae55mfof2yamd7plwr6twuxobfvpurm4bede6rhcqhllyoxnm +- valory/termination_abci:0.1.0:bafybeigq3ehr5gvaysomh6lo4j6vmgyw2dgdemsoxzf5kxjanktbibgci4 +- valory/transaction_settlement_abci:0.1.0:bafybeie3tjka4hwcvtg2rm5n6peazpskzuhg2p4zykdcypjotouclqw2ui +- valory/decision_making_abci:0.1.0:bafybeigv6c7azm3gryzuqu4e2egh3ge2wvk3hlv4da7gyis6lnonehje6e +- valory/llm_abci:0.1.0:bafybeiaz6sb7ez7kusriiijk5bb7oqynzxmlgkrbqjhur7u52gkcrfdwmy +- valory/twitter_write_abci:0.1.0:bafybeihzssdoyl36g6if247ceohq26kjeazugwavl7u5vvickzknczoqye +- valory/olas_week_abci:0.1.0:bafybeieugq7vjzjia237c7dfwfquvwfvyk765wybhrmmqtcwmjk5mydeie +- valory/mech_interact_abci:0.1.0:bafybeidyshkn7hefjfbyjyl53sc5kllemwpoh6zxhnlsbwnk3xnzvaveyu behaviours: main: args: {} diff --git a/packages/valory/skills/llm_abci/skill.yaml b/packages/valory/skills/llm_abci/skill.yaml index dc4e5d8a..1cd1f9ba 100644 --- a/packages/valory/skills/llm_abci/skill.yaml +++ b/packages/valory/skills/llm_abci/skill.yaml @@ -28,7 +28,7 @@ contracts: [] protocols: - valory/llm:1.0.0:bafybeihj2orqapokafg7co3wlogwgf6cckaaj2bz3nuv4rm3opkoyhrlp4 skills: -- valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u +- valory/abstract_round_abci:0.1.0:bafybeid3f7hted4j44fpmlg6hbjadtldir6k2jauo7gyptuezwpbvkqsrm behaviours: main: args: {} diff --git a/packages/valory/skills/mech_interact_abci/behaviours/base.py b/packages/valory/skills/mech_interact_abci/behaviours/base.py index e105230b..45444cb8 100644 --- a/packages/valory/skills/mech_interact_abci/behaviours/base.py +++ b/packages/valory/skills/mech_interact_abci/behaviours/base.py @@ -28,13 +28,18 @@ from aea.configurations.data_types import PublicId from packages.valory.contracts.mech.contract import Mech +from packages.valory.contracts.mech_marketplace.contract import MechMarketplace from packages.valory.protocols.contract_api import ContractApiMessage from packages.valory.skills.abstract_round_abci.base import BaseTxPayload from packages.valory.skills.abstract_round_abci.behaviour_utils import ( BaseBehaviour, TimeoutException, ) -from packages.valory.skills.mech_interact_abci.models import MechParams, MultisendBatch +from packages.valory.skills.mech_interact_abci.models import ( + MechMarketplaceConfig, + MechParams, + MultisendBatch, +) from packages.valory.skills.mech_interact_abci.states.base import SynchronizedData @@ -61,6 +66,11 @@ def params(self) -> MechParams: """Return the params.""" return cast(MechParams, self.context.params) + @property + def mech_marketplace_config(self) -> MechMarketplaceConfig: + """Return the mech marketplace config.""" + return cast(MechMarketplaceConfig, self.context.params.mech_marketplace_config) + def default_error( self, contract_id: str, contract_callable: str, response_msg: ContractApiMessage ) -> None: @@ -141,6 +151,25 @@ def _mech_contract_interact( ) return status + def _mech_marketplace_contract_interact( + self, + contract_callable: str, + data_key: str, + placeholder: str, + **kwargs: Any, + ) -> WaitableConditionType: + """Interact with the mech marketplace contract.""" + status = yield from self.contract_interact( + performative=ContractApiMessage.Performative.GET_RAW_TRANSACTION, # type: ignore + contract_address=self.params.mech_marketplace_config.mech_marketplace_address, + contract_public_id=MechMarketplace.contract_id, + contract_callable=contract_callable, + data_key=data_key, + placeholder=placeholder, + **kwargs, + ) + return status + def wait_for_condition_with_sleep( self, condition_gen: Callable[[], WaitableConditionType], diff --git a/packages/valory/skills/mech_interact_abci/behaviours/request.py b/packages/valory/skills/mech_interact_abci/behaviours/request.py index aa3870c3..51410893 100644 --- a/packages/valory/skills/mech_interact_abci/behaviours/request.py +++ b/packages/valory/skills/mech_interact_abci/behaviours/request.py @@ -392,17 +392,37 @@ def _send_metadata_to_ipfs( def _build_request_data(self) -> WaitableConditionType: """Get the request tx data encoded.""" - status = yield from self._mech_contract_interact( - "get_request_data", - "data", - get_name(MechRequestBehaviour.request_data), - request_data=self._v1_hex_truncated, - chain_id=self.params.mech_chain_id, - ) + if self.params.use_mech_marketplace: + status = yield from self._mech_marketplace_contract_interact( + "get_request_data", + "data", + get_name(MechRequestBehaviour.request_data), + request_data=self._v1_hex_truncated, + priority_mech=self.mech_marketplace_config.priority_mech_address, + priority_mech_staking_instance=self.mech_marketplace_config.priority_mech_staking_instance_address, + priority_mech_service_id=self.mech_marketplace_config.priority_mech_service_id, + requester_staking_instance=self.mech_marketplace_config.requester_staking_instance_address, + requester_service_id=self.params.on_chain_service_id, + response_timeout=self.mech_marketplace_config.response_timeout, + chain_id=self.params.mech_chain_id, + ) + else: + status = yield from self._mech_contract_interact( + "get_request_data", + "data", + get_name(MechRequestBehaviour.request_data), + request_data=self._v1_hex_truncated, + chain_id=self.params.mech_chain_id, + ) if status: + to = ( + self.mech_marketplace_config.mech_marketplace_address + if self.params.use_mech_marketplace + else self.params.mech_contract_address + ) batch = MultisendBatch( - to=self.params.mech_contract_address, + to=to, data=HexBytes(self.request_data), value=self.price, ) diff --git a/packages/valory/skills/mech_interact_abci/behaviours/response.py b/packages/valory/skills/mech_interact_abci/behaviours/response.py index c9c30dec..61a2ba60 100644 --- a/packages/valory/skills/mech_interact_abci/behaviours/response.py +++ b/packages/valory/skills/mech_interact_abci/behaviours/response.py @@ -20,7 +20,7 @@ """This module contains the response state of the mech interaction abci app.""" import json -from typing import Any, Dict, Generator, List, Optional +from typing import Any, Callable, Dict, Generator, List, Optional from web3.constants import ADDRESS_ZERO @@ -136,9 +136,17 @@ def _get_block_number(self) -> WaitableConditionType: return result + @property + def mech_contract_interact(self) -> Callable[..., WaitableConditionType]: + """Interact with the mech contract.""" + if self.params.use_mech_marketplace: + return self._mech_marketplace_contract_interact + + return self._mech_contract_interact + def _process_request_event(self) -> WaitableConditionType: """Process the request event.""" - result = yield from self._mech_contract_interact( + result = yield from self.mech_contract_interact( contract_callable="process_request_event", data_key="results", placeholder=get_name(MechResponseBehaviour.requests), @@ -155,7 +163,7 @@ def _get_response_hash(self) -> WaitableConditionType: f"Filtering the mech's events from block {self.from_block} " f"for a response to our request with id {request_id!r}." ) - result = yield from self._mech_contract_interact( + result = yield from self.mech_contract_interact( contract_callable="get_response", data_key="data", placeholder=get_name(MechResponseBehaviour.response_hex), diff --git a/packages/valory/skills/mech_interact_abci/models.py b/packages/valory/skills/mech_interact_abci/models.py index 19cd9476..96fc52cc 100644 --- a/packages/valory/skills/mech_interact_abci/models.py +++ b/packages/valory/skills/mech_interact_abci/models.py @@ -20,7 +20,7 @@ """This module contains the models for the abci skill of MechInteractAbciApp.""" from dataclasses import dataclass -from typing import Any, Optional +from typing import Any, Dict, Optional from aea.exceptions import enforce from hexbytes import HexBytes @@ -51,6 +51,34 @@ class SharedState(BaseSharedState): abci_app_cls = MechInteractAbciApp +@dataclass(frozen=True) +class MechMarketplaceConfig: + """The configuration for the Mech marketplace.""" + + mech_marketplace_address: str + priority_mech_address: str + priority_mech_staking_instance_address: str + priority_mech_service_id: int + requester_staking_instance_address: str + response_timeout: int + + @classmethod + def from_dict(cls, data: Dict[str, Any]) -> "MechMarketplaceConfig": + """Create an instance from a dictionary.""" + return cls( + mech_marketplace_address=data["mech_marketplace_address"], + priority_mech_address=data["priority_mech_address"], + priority_mech_staking_instance_address=data[ + "priority_mech_staking_instance_address" + ], + priority_mech_service_id=data["priority_mech_service_id"], + requester_staking_instance_address=data[ + "requester_staking_instance_address" + ], + response_timeout=data["response_timeout"], + ) + + class MechParams(BaseParams): """The mech interact abci skill's parameters.""" @@ -74,6 +102,16 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.mech_interaction_sleep_time: int = self._ensure( "mech_interaction_sleep_time", kwargs, int ) + self.use_mech_marketplace = self._ensure("use_mech_marketplace", kwargs, bool) + self.mech_marketplace_config: MechMarketplaceConfig = ( + MechMarketplaceConfig.from_dict(kwargs["mech_marketplace_config"]) + ) + enforce( + not self.use_mech_marketplace + or self.mech_contract_address + == self.mech_marketplace_config.priority_mech_address, + "The mech contract address must be the same as the priority mech address when using the marketplace.", + ) super().__init__(*args, **kwargs) @property diff --git a/packages/valory/skills/mech_interact_abci/skill.yaml b/packages/valory/skills/mech_interact_abci/skill.yaml index 75a92b9d..e19098a4 100644 --- a/packages/valory/skills/mech_interact_abci/skill.yaml +++ b/packages/valory/skills/mech_interact_abci/skill.yaml @@ -9,14 +9,14 @@ aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeidf3nlv5fpvfy4libtscayhirdw64shgmhfmvjiftjmjkmhu7auxq behaviours/__init__.py: bafybeie3zsi6p3yanz5mqwpkdrcgywaqvkit3hdintsb4awnvalgxpxa4i - behaviours/base.py: bafybeibiun7xv7ucg3ysrfxmnbsjxz2jsda4xlr6gdihsfs6foqkkz55li - behaviours/request.py: bafybeige7yjjrjun6atkfi2kjec7y3cll56ziwjdoz36tx25kjeyc2cboi - behaviours/response.py: bafybeigquse6twwelumj346kt4nptyxwlkyfcrlnws5tggwle5aghh4uxu + behaviours/base.py: bafybeif4dvt4p5wfh6q3ybqwnzy62lbr3vqy322sr3wm6pkcrha2ggin6q + behaviours/request.py: bafybeihaevbnfn66atdutf7rt7v3lw3vbw3tr4bugfdssebtmydgnuvjyq + behaviours/response.py: bafybeibigqdtdxxzufx7cclzjrafszg2lb6y5ommp3jzbyoit735wtm7tq behaviours/round_behaviour.py: bafybeib33inrpyzzlx7k7i3okkslsx4p46dgdaww2m5k7rno57o5nndage dialogues.py: bafybeigjmyzd2bx6mgqiet2c223k6wkc5jk7kdkstbhpaxlqxatey26tlm fsm_specification.yaml: bafybeiapzwz6zcneelc2b2wrcb7cae7x6vbthmf6a57cm4mv6hucp67lz4 handlers.py: bafybeiduy2nwkqdynainuimkjulcv7u2qq6iglkuut3gfurkckydapitg4 - models.py: bafybeicvivxyrae7rjew4c6h5ivo3vj6v4qgvbdurz3rgobctvrxbsssmu + models.py: bafybeidfes4ovzsyntxvqtx55qi2tznmllhzznf5qmozi52zrukiyrtbni payloads.py: bafybeihhnbwsnaqxcltqxp4camiw3tz7gcymrdvxhmqlk4nww24tujiy7q rounds.py: bafybeif7taciv6pqupb7xuewurqssziplbjeobbv4d7ea3vbngz3kpjnee states/__init__.py: bafybeie34wx5znr2hxwh3gs2fchmbeuzjcfnraymdvtzjaxaq5zsiw233q @@ -25,25 +25,27 @@ fingerprint: states/request.py: bafybeifdkqn4o2tx57yflnxfhy6eoy42z7bdpadcevre64aw7l2hh2kpjy states/response.py: bafybeibaxnp2oxwjptoq7qzm6o7ww2qrdj2vnxzg2qt523vz2ftqzx5hyi tests/__init__.py: bafybeifojfnffwlsv6aiku25nwyjwm7h4m45yci3fgmaawpeoyoogzonum - tests/test_behaviours.py: bafybeidj7git7zaego7k75eejtxlr3usj6wnnqisu7urqwvalpwh5w7nyq + tests/test_behaviours.py: bafybeid34kv6ho6xzynppy3olrsuoau5ia6gpxy5ii4wkog2piqn2rmfre tests/test_dialogues.py: bafybeig6uzk7fklieyxapemiobdvv5tyx7hgdkdpl4vnacohgw2ecphdpq tests/test_handlers.py: bafybeidwrmekr5tydmehvkolyksw37sah5js7buy3ca5fxkpgkppmgb3wi - tests/test_models.py: bafybeid3cvcttdxlklwvr6tqmiurb2qywvmgr5bnsn62pb5gl5p552eagy + tests/test_models.py: bafybeifakxkpvq6p6nkva3kpy7odnefvjnjurcva5anwlxv6qlo6agxtyu tests/test_payloads.py: bafybeiakqhgochfu4ra4hp65hi7jvxtjd7fdub5wqmhlccrc4va26hb7da tests/test_rounds.py: bafybeiauu5adaoxu7yvtrfa6uwdw4sxr5gn2pj7qjh6vowd556iji6vtca + tests/test_states_base.py: bafybeigognrbwfajutxxzssprfnwu3s67zfuhckerwhzdf6d2wbgt7zg24 fingerprint_ignore_patterns: [] connections: [] contracts: -- valory/gnosis_safe:0.1.0:bafybeih3ropivth4wn7zbzudisx3qezbht5jyndd4w7az7fq634lpozoge +- valory/gnosis_safe:0.1.0:bafybeihjaxefx27ppcghwmnsehbrqqmhwkiur5mprpsdp7tluge7zzwqgm - valory/mech:0.1.0:bafybeiejfjfoxqggghcme43sx53q5gruefrws3k2jam2opkxl5uzffoarm - valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y - valory/erc20:0.1.0:bafybeid2p2jyvjjlcsqugnawksdzsca6ljghpqbp2kfi3cxuxoy2233dbi +- valory/mech_marketplace:0.1.0:bafybeiba7kh3wygwtpyf7oo3sili6givzo2gyadhbb66rvwsokswsywvuu protocols: - valory/contract_api:1.0.0:bafybeidgu7o5llh26xp3u3ebq3yluull5lupiyeu6iooi2xyymdrgnzq5i - valory/ledger_api:1.0.0:bafybeihdk6psr4guxmbcrc26jr2cbgzpd5aljkqvpwo64bvaz7tdti2oni skills: -- valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/transaction_settlement_abci:0.1.0:bafybeic7q7recyka272udwcupblwbkc3jkodgp74fvcdxb7urametg5dae +- valory/abstract_round_abci:0.1.0:bafybeid3f7hted4j44fpmlg6hbjadtldir6k2jauo7gyptuezwpbvkqsrm +- valory/transaction_settlement_abci:0.1.0:bafybeie3tjka4hwcvtg2rm5n6peazpskzuhg2p4zykdcypjotouclqw2ui behaviours: main: args: {} @@ -157,6 +159,14 @@ models: light_slash_unit_amount: 5000000000000000 serious_slash_unit_amount: 8000000000000000 mech_interaction_sleep_time: 10 + use_mech_marketplace: false + mech_marketplace_config: + mech_marketplace_address: '0x0000000000000000000000000000000000000000' + priority_mech_address: '0x0000000000000000000000000000000000000000' + priority_mech_staking_instance_address: '0x0000000000000000000000000000000000000000' + priority_mech_service_id: 0 + requester_staking_instance_address: '0x0000000000000000000000000000000000000000' + response_timeout: 300 class_name: Params mech_response: args: diff --git a/packages/valory/skills/mech_interact_abci/tests/test_behaviours.py b/packages/valory/skills/mech_interact_abci/tests/test_behaviours.py index 2905d0b7..79425314 100644 --- a/packages/valory/skills/mech_interact_abci/tests/test_behaviours.py +++ b/packages/valory/skills/mech_interact_abci/tests/test_behaviours.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # -# Copyright 2023 Valory AG +# Copyright 2023-2024 Valory AG # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,15 +21,22 @@ from dataclasses import dataclass, field from pathlib import Path -from typing import Any, Dict, Hashable, Optional, Type +from typing import Any, Dict, Hashable, Optional, Type, cast +from unittest import mock +from unittest.mock import MagicMock import pytest +from packages.valory.protocols.contract_api import ContractApiMessage from packages.valory.skills.abstract_round_abci.base import AbciAppDB +from packages.valory.skills.abstract_round_abci.behaviour_utils import ( + make_degenerate_behaviour, +) from packages.valory.skills.abstract_round_abci.behaviours import BaseBehaviour from packages.valory.skills.abstract_round_abci.test_tools.base import ( FSMBehaviourBaseCase, ) +from packages.valory.skills.abstract_round_abci.tests.test_common import dummy_generator from packages.valory.skills.mech_interact_abci.behaviours.base import ( MechInteractBaseBehaviour, ) @@ -42,10 +49,14 @@ from packages.valory.skills.mech_interact_abci.behaviours.round_behaviour import ( MechInteractRoundBehaviour, ) +from packages.valory.skills.mech_interact_abci.models import SharedState from packages.valory.skills.mech_interact_abci.states.base import ( Event, SynchronizedData, ) +from packages.valory.skills.mech_interact_abci.states.final_states import ( + FinishedMechRequestRound, +) @dataclass @@ -55,6 +66,7 @@ class BehaviourTestCase: name: str initial_data: Dict[str, Hashable] event: Event + return_value: Any kwargs: Dict[str, Any] = field(default_factory=dict) @@ -80,11 +92,14 @@ def fast_forward(self, data: Optional[Dict[str, Any]] = None) -> None: data = data if data is not None else {} self.fast_forward_to_behaviour( - self.behaviour, - self.behaviour_class.behaviour_id, + self.behaviour, # type: ignore + self.behaviour_class.auto_behaviour_id(), SynchronizedData(AbciAppDB(setup_data=AbciAppDB.data_to_lists(data))), ) - assert self.current_behaviour_id == self.behaviour_class.behaviour_id + assert ( + self.behaviour.current_behaviour.auto_behaviour_id() # type: ignore + == self.behaviour_class.auto_behaviour_id() + ) def complete(self, event: Event) -> None: """Complete test""" @@ -93,25 +108,110 @@ def complete(self, event: Event) -> None: self.mock_a2a_transaction() self._test_done_flag_set() self.end_round(done_event=event) - assert self.current_behaviour_id == self.next_behaviour_class.behaviour_id + assert ( + self.behaviour.current_behaviour.auto_behaviour_id() # type: ignore + == self.next_behaviour_class.auto_behaviour_id() + ) class TestMechRequestBehaviour(BaseMechInteractTest): """Tests MechRequestBehaviour""" - # TODO: set next_behaviour_class behaviour_class: Type[BaseBehaviour] = MechRequestBehaviour - next_behaviour_class: Type[BaseBehaviour] = ... - - # TODO: provide test cases - @pytest.mark.parametrize("test_case", []) - def test_run(self, test_case: BehaviourTestCase) -> None: + next_behaviour_class: Type[BaseBehaviour] = make_degenerate_behaviour( + FinishedMechRequestRound + ) + + @pytest.mark.parametrize( + "test_case, kwargs", + [ + ( + BehaviourTestCase( + "Happy path - no mech request", + initial_data=dict(mech_requests=[]), + event=Event.DONE, + return_value={ + "ledger": None, + "contract": None, + "metadata_hash": None, + "multisend_safe_tx_hash": None, + }, + ), + {}, + ), + ( + BehaviourTestCase( + "Happy path", + initial_data=dict( + mech_requests='[{"prompt": "dummy_prompt_1", "tool": "dummy_tool_1", "nonce": "dummy_nonce_1"}, {"prompt": "dummy_prompt_2", "tool": "dummy_tool_2", "nonce": "dummy_nonce_2"}]', + safe_contract_address="mock_safe_contract_address", + ), + event=Event.DONE, + return_value={ + "ledger": MagicMock( + state=MagicMock(body={"get_balance_result": "10"}) + ), + "contract": MagicMock( + performative=ContractApiMessage.Performative.RAW_TRANSACTION, + raw_transaction=MagicMock( + body={ + "token": 10, + "wallet": "mock_safe_contract_address", + "data": "0x0000deadbeef0000", + "request_data": "dummy_request_data", + } + ), + ), + "metadata_hash": "QmTzQ1iVRmDDeh8aW5HX99o9dsPwzUo9tb5w1DLT8PaJfM", + "multisend_safe_tx_hash": MagicMock( + performative=ContractApiMessage.Performative.STATE, + state=MagicMock( + body={ + "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000000" + } + ), + ), + }, + ), + {}, + ), + ], + ) + def test_run(self, test_case: BehaviourTestCase, kwargs) -> None: """Run tests.""" - - self.fast_forward(test_case.initial_data) - # TODO: mock the necessary calls - # self.mock_ ... - self.complete(test_case.event) + with mock.patch.object( + MechRequestBehaviour, + "get_ledger_api_response", + dummy_generator(test_case.return_value["ledger"]), + ), mock.patch.object( + MechRequestBehaviour, + "get_contract_api_response", + dummy_generator(test_case.return_value["contract"]), + ), mock.patch.object( + MechRequestBehaviour, + "send_to_ipfs", + dummy_generator(test_case.return_value["metadata_hash"]), + ): + params = cast(SharedState, self._skill.skill_context.params) + params.__dict__["_frozen"] = False + params.mech_request_price = 1 + params.mech_contract_address = "dummy_mech_contract_address" + self.fast_forward(test_case.initial_data) + self.behaviour.act_wrapper() + self.behaviour.act_wrapper() + self.behaviour.act_wrapper() + self.behaviour.act_wrapper() + self.behaviour.act_wrapper() + self.behaviour.act_wrapper() + self.behaviour.act_wrapper() + + with mock.patch.object( + MechRequestBehaviour, + "get_contract_api_response", + dummy_generator(test_case.return_value["multisend_safe_tx_hash"]), + ): + self.behaviour.act_wrapper() + self.complete(test_case.event) class TestMechResponseBehaviour(BaseMechInteractTest): diff --git a/packages/valory/skills/mech_interact_abci/tests/test_models.py b/packages/valory/skills/mech_interact_abci/tests/test_models.py index 1b18face..f4355076 100644 --- a/packages/valory/skills/mech_interact_abci/tests/test_models.py +++ b/packages/valory/skills/mech_interact_abci/tests/test_models.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # -# Copyright 2023 Valory AG +# Copyright 2023-2024 Valory AG # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,9 +18,37 @@ # ------------------------------------------------------------------------------ """Test the models.py module of the MechInteract.""" +import pytest +from hexbytes import HexBytes from packages.valory.skills.abstract_round_abci.test_tools.base import DummyContext -from packages.valory.skills.mech_interact_abci.models import SharedState +from packages.valory.skills.abstract_round_abci.tests.test_models import ( + BASE_DUMMY_PARAMS, + BASE_DUMMY_SPECS_CONFIG, +) +from packages.valory.skills.mech_interact_abci.models import ( + MechParams, + MechResponseSpecs, + MultisendBatch, + SharedState, +) + + +class TestMechResponseSpecs: + """Test MechResponseSpecs of MechInteract models.""" + + def test_initialization(self) -> None: + """Test initialization.""" + MechResponseSpecs( + **BASE_DUMMY_SPECS_CONFIG, + response_key="value", + response_index=0, + response_type="float", + error_key="error", + error_index=None, + error_type="str", + error_data="error text", + ) class TestSharedState: @@ -29,3 +57,44 @@ class TestSharedState: def test_initialization(self) -> None: """Test initialization.""" SharedState(name="", skill_context=DummyContext()) + + +class TestMechParams: + """Test MechParams of MechInteract models.""" + + def setup(self) -> None: + """Set up the tests.""" + self.mech_params = MechParams( + **BASE_DUMMY_PARAMS, + multisend_address="dummy_multisend_address", + multisend_batch_size=1, + mech_contract_address="dummy_mech_contract_address", + ipfs_address="dummy_ipfs_address", + mech_interaction_sleep_time=1, + ) + + def test_initialization(self) -> None: + """Test initialization""" + assert isinstance(self.mech_params, MechParams) + + @pytest.mark.parametrize( + "dummy_ipfs_address", ["dummy_ipfs_address", "dummy_ipfs_address/"] + ) + def test_ipfs_address(self, dummy_ipfs_address) -> None: + """Test ipfs address.""" + print(self.mech_params.ipfs_address) + self.mech_params.__dict__["_frozen"] = False + self.mech_params._ipfs_address = dummy_ipfs_address + ipfs_address = self.mech_params.ipfs_address + assert ipfs_address == "dummy_ipfs_address/" + + +class TestMultisendBatch: + """Test MultisendBatch of MechInteract models.""" + + def test_initialization(self) -> None: + """Test initialization.""" + MultisendBatch( + to="", + data=HexBytes("0xabcdef1234567890"), + ) diff --git a/packages/valory/skills/mech_interact_abci/tests/test_states_base.py b/packages/valory/skills/mech_interact_abci/tests/test_states_base.py new file mode 100644 index 00000000..87a14cfb --- /dev/null +++ b/packages/valory/skills/mech_interact_abci/tests/test_states_base.py @@ -0,0 +1,210 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------------------------ +# +# Copyright 2023-2024 Valory AG +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ------------------------------------------------------------------------------ +"""This module contains the tests for the state/base of the mech interact abci app.""" + +from typing import Mapping +from unittest.mock import MagicMock + +from packages.valory.skills.abstract_round_abci.base import AbciAppDB +from packages.valory.skills.mech_interact_abci.payloads import ( + MechRequestPayload, + MechResponsePayload, +) +from packages.valory.skills.mech_interact_abci.states.base import ( + Event, + MechInteractionResponse, + MechInteractionRound, + MechMetadata, + MechRequest, + SynchronizedData, +) + + +class TestEvent: + """Test the Event class of MechInteract.""" + + def test_import(self) -> None: + """Test import.""" + assert Event.DONE.value == "done" + assert Event.NO_MAJORITY.value == "no_majority" + assert Event.ROUND_TIMEOUT.value == "round_timeout" + assert Event.SKIP_REQUEST.value == "skip_request" + + +class TestMechMetaData: + """Test the MechMetaData of MechInteract.""" + + def test_initialization(self) -> None: + """Test initialization.""" + MechMetadata(prompt="dummy_prompt", tool="dummy_tool", nonce="dummy_nonce") + + +class TestMechRequest: + """Test MechRequest of MechInteract.""" + + def test_initialization(self) -> None: + """Test Initialization.""" + MechRequest() + + +class TestMechInteractionResponse: + """Test MechInteractionResponse of MechInteract.""" + + def test_initialization(self) -> None: + """Test initialization.""" + MechInteractionResponse() + + def test_retries_exceeded(self) -> None: + """Test retries exceeded.""" + mech_interact_response = MechInteractionResponse() + mech_interact_response.retries_exceeded() + assert ( + mech_interact_response.error + == "Retries were exceeded while trying to get the mech's response." + ) + + def test_incorrect_format(self) -> None: + """Test incorrect format.""" + mech_interact_response = MechInteractionResponse() + mech_interact_response.incorrect_format("dummy_res") + print(mech_interact_response.error) + assert ( + mech_interact_response.error + == "The response's format was unexpected: dummy_res" + ) + + +class TestSynchronizedData: + """Test SynchronizedData of Base States of MechInteract.""" + + def setup(self) -> None: + """Set up the tests.""" + self.synchronized_data = SynchronizedData( + db=AbciAppDB(setup_data=dict(participants=[])) + ) + self.synchronized_data.update(**dict(mech_price=1)) + self.synchronized_data.update( + **dict( + mech_requests='[{"prompt": "dummy_prompt_1", "tool": "dummy_tool_1", "nonce": "dummy_nonce_1"}, {"prompt": "dummy_prompt_2", "tool": "dummy_tool_2", "nonce": "dummy_nonce_2"}]' + ) + ) + self.synchronized_data.update( + **dict( + mech_responses=[{"nonce": "dummy_nonce_1", "result": "dummy_result_1"}] + ) + ) + self.synchronized_data.update( + **dict( + participant_to_requests={ + "dummy_sender": { + "round_count": -1, + "id_": "dummy_id", + "tx_submitter": "dummy_tx_submitter", + "tx_hash": "dummy_tx_hash", + "price": 1, + "mech_requests": "dummy_mech_requests", + "mech_responses": "dummy_mech_responses", + "sender": "dummy_sender", + "chain_id": 1, + "_metaclass_registry_key": "packages.valory.skills.mech_interact_abci.payloads.MechRequestPayload", + } + } + ) + ) + self.synchronized_data.update( + **dict( + participant_to_responses={ + "dummy_sender": { + "round_count": -1, + "id_": "dummy_id", + "sender": "dummy_sender", + "mech_responses": "dummy_mech_responses", + "_metaclass_registry_key": "packages.valory.skills.mech_interact_abci.payloads.MechResponsePayload", + } + } + ) + ) + self.synchronized_data.update(**dict(final_tx_hash="dummy_tx_hash")) + self.synchronized_data.update(**dict(chain_id="dummy_chain_id")) + self.synchronized_data.update(**dict(tx_submitter=1)) + + def test_initialization(self) -> None: + """Test initialization.""" + assert isinstance(self.synchronized_data, SynchronizedData) + + def test_mech_price(self) -> None: + """Test mech price.""" + assert self.synchronized_data.mech_price == 1 + + def test_mech_requests(self) -> None: + """Test mech requests.""" + assert self.synchronized_data.mech_requests == [ + MechMetadata( + prompt="dummy_prompt_1", tool="dummy_tool_1", nonce="dummy_nonce_1" + ), + MechMetadata( + prompt="dummy_prompt_2", tool="dummy_tool_2", nonce="dummy_nonce_2" + ), + ] + + def test_mech_responses(self) -> None: + """Test mech responses.""" + assert self.synchronized_data.mech_responses == [ + MechInteractionResponse( + data="", + requestId=0, + nonce="dummy_nonce_1", + result="dummy_result_1", + error="Unknown", + ) + ] + + def test_participant_to_requests(self) -> None: + """Test participant to requests.""" + assert isinstance(self.synchronized_data.participant_to_requests, Mapping) + for key, value in self.synchronized_data.participant_to_requests.items(): + assert isinstance(key, str) + assert isinstance(value, MechRequestPayload) + + def test_participant_to_responses(self) -> None: + """Test participant to responses.""" + assert isinstance(self.synchronized_data.participant_to_responses, Mapping) + for key, value in self.synchronized_data.participant_to_responses.items(): + assert isinstance(key, str) + assert isinstance(value, MechResponsePayload) + + def test_final_tx_hash(self) -> None: + """Test final tx hash.""" + assert self.synchronized_data.final_tx_hash == "dummy_tx_hash" + + def test_chain_id(self) -> None: + """Test chain id.""" + assert self.synchronized_data.chain_id == "dummy_chain_id" + + def test_tx_submitter(self) -> None: + """Test tx submitter.""" + assert self.synchronized_data.tx_submitter == "1" + + +class TestMechInteractionRound: + """Test MechInteractionRound of MechInteract.""" + + def test_initialization(self) -> None: + """Test initialization.""" + MechInteractionRound(synchronized_data=MagicMock(), context=MagicMock()) diff --git a/packages/valory/skills/olas_week_abci/skill.yaml b/packages/valory/skills/olas_week_abci/skill.yaml index c68876af..41917927 100644 --- a/packages/valory/skills/olas_week_abci/skill.yaml +++ b/packages/valory/skills/olas_week_abci/skill.yaml @@ -30,8 +30,8 @@ contracts: [] protocols: - valory/llm:1.0.0:bafybeihj2orqapokafg7co3wlogwgf6cckaaj2bz3nuv4rm3opkoyhrlp4 skills: -- valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/decision_making_abci:0.1.0:bafybeigsywkfb4lujy4y2c5tsmr2iulq7s6uad7uv2fbiwv7awxz5wfbi4 +- valory/abstract_round_abci:0.1.0:bafybeid3f7hted4j44fpmlg6hbjadtldir6k2jauo7gyptuezwpbvkqsrm +- valory/decision_making_abci:0.1.0:bafybeigv6c7azm3gryzuqu4e2egh3ge2wvk3hlv4da7gyis6lnonehje6e behaviours: main: args: {} diff --git a/packages/valory/skills/twitter_scoring_abci/skill.yaml b/packages/valory/skills/twitter_scoring_abci/skill.yaml index 8155e05d..861a5a77 100644 --- a/packages/valory/skills/twitter_scoring_abci/skill.yaml +++ b/packages/valory/skills/twitter_scoring_abci/skill.yaml @@ -29,9 +29,9 @@ contracts: [] protocols: - valory/llm:1.0.0:bafybeihj2orqapokafg7co3wlogwgf6cckaaj2bz3nuv4rm3opkoyhrlp4 skills: -- valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u -- valory/decision_making_abci:0.1.0:bafybeigsywkfb4lujy4y2c5tsmr2iulq7s6uad7uv2fbiwv7awxz5wfbi4 -- valory/mech_interact_abci:0.1.0:bafybeigto5ssrbrbqmeoc6wijcly2klmrhfcnaioa5u3wsofdm7bccowcq +- valory/abstract_round_abci:0.1.0:bafybeid3f7hted4j44fpmlg6hbjadtldir6k2jauo7gyptuezwpbvkqsrm +- valory/decision_making_abci:0.1.0:bafybeigv6c7azm3gryzuqu4e2egh3ge2wvk3hlv4da7gyis6lnonehje6e +- valory/mech_interact_abci:0.1.0:bafybeidyshkn7hefjfbyjyl53sc5kllemwpoh6zxhnlsbwnk3xnzvaveyu behaviours: main: args: {} diff --git a/packages/valory/skills/twitter_write_abci/skill.yaml b/packages/valory/skills/twitter_write_abci/skill.yaml index 30658eab..71a9dd72 100644 --- a/packages/valory/skills/twitter_write_abci/skill.yaml +++ b/packages/valory/skills/twitter_write_abci/skill.yaml @@ -29,7 +29,7 @@ contracts: [] protocols: - valory/twitter:0.1.0:bafybeig7dugazhljpb4qtu4zfnoimttvivopiq574rogjz3qggf5eysnk4 skills: -- valory/abstract_round_abci:0.1.0:bafybeib733xfbndtpvkf44mtk7oyodnficgloo6xhn7xmqxxeos33es65u +- valory/abstract_round_abci:0.1.0:bafybeid3f7hted4j44fpmlg6hbjadtldir6k2jauo7gyptuezwpbvkqsrm behaviours: main: args: {}