Skip to content

Commit

Permalink
Merge pull request #112 from valory-xyz/fix/audit
Browse files Browse the repository at this point in the history
Fix/audit
  • Loading branch information
dvilelaf authored Dec 13, 2023
2 parents 485bef1 + d143757 commit ac73d6a
Show file tree
Hide file tree
Showing 40 changed files with 2,237 additions and 162 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
- name: License compatibility check
run: tox -e liccheck
- name: Check doc links
run: tomte check-doc-links --url-skips "https://goerli.infura.io/v3/<infura_api_key>"
run: tomte check-doc-links --url-skips "https://goerli.infura.io/v3/<infura_api_key>" --url-skips "https://twitter.com/autonolas" --url-skips "https://developer.twitter.com/en/portal/dashboard"
- name: Check doc IPFS hashes
run: tox -e check-doc-hashes

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ generators:
.PHONY: common-checks-1
common-checks-1:
tomte check-copyright --author valory --exclude-part abci --exclude-part http_client --exclude-part ipfs --exclude-part ledger --exclude-part p2p_libp2p_client --exclude-part gnosis_safe --exclude-part gnosis_safe_proxy_factory --exclude-part multisend --exclude-part service_registry --exclude-part acn --exclude-part contract_api --exclude-part http --exclude-part ipfs --exclude-part ledger_api --exclude-part tendermint --exclude-part abstract_abci --exclude-part abstract_round_abci --exclude-part registration_abci --exclude-part reset_pause_abci --exclude-part termination_abci --exclude-part transaction_settlement_abci --exclude-part http_server
tomte tomte check-doc-links --url-skips "https://goerli.infura.io/v3/<infura_api_key>"
tomte check-doc-links --url-skips "https://goerli.infura.io/v3/<infura_api_key>" --url-skips "https://twitter.com/autonolas" --url-skips "https://developer.twitter.com/en/portal/dashboard"
tox -p -e check-hash -e check-packages -e check-doc-hashes

.PHONY: test
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:bafybeihifcozsbnx5k43d5vrlguqhvnzsgjlatq2yydiwmuhjmucnxftke --service
autonomy fetch valory/impact_evaluator:0.1.0:bafybeiffhzgpy4tfklast46gdhrz2wyickvlibug4gbvxqam7ald2csgkm --service
```

3. Build the Docker image of the service agents
Expand Down
20 changes: 11 additions & 9 deletions packages/packages.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
{
"dev": {
"agent/valory/impact_evaluator/0.1.0": "bafybeihna6zpewivep3ayangyvvz3uzcr67wtypoafdkxqgnitdaxcabw4",
"agent/valory/impact_evaluator/0.1.0": "bafybeihd7diqbkneyl2coi4chmfx3geayemv5a6hcalvputuiqj5uc5rui",
"contract/valory/dynamic_contribution/0.1.0": "bafybeia54zrihbupv35dkw23x4lc7cgeh3obinqlszvjighm7rxap6komi",
"service/valory/impact_evaluator/0.1.0": "bafybeihifcozsbnx5k43d5vrlguqhvnzsgjlatq2yydiwmuhjmucnxftke",
"service/valory/impact_evaluator/0.1.0": "bafybeiffhzgpy4tfklast46gdhrz2wyickvlibug4gbvxqam7ald2csgkm",
"skill/valory/dynamic_nft_abci/0.1.0": "bafybeibwx2r4pdvzy2myn5keawjskd5mz2w7yfdflqff5wz4cxiubpanlu",
"skill/valory/twitter_scoring_abci/0.1.0": "bafybeiezvn76bbkmfuddcitooj7b3r7kv4cdehz7noepybqylhz2cjt3hm",
"skill/valory/ceramic_read_abci/0.1.0": "bafybeigqpkvsxfhz5jt3yuipmkl6eyfgqcw36226sgfhdgud7mphsjmopa",
"skill/valory/ceramic_write_abci/0.1.0": "bafybeighmakx2u2okkvokdimxyzrnfn5qb2cib3qzvzdh4tnkfr6hkx32a",
"skill/valory/impact_evaluator_abci/0.1.0": "bafybeihv52iil4qknszjts33wpiknbvx46g2otowl6w2oklx3pvb5g7fye",
"skill/valory/impact_evaluator_abci/0.1.0": "bafybeifi55u4cghp4mpq6fnolaoqozxiu4iqyecyo3kjc3m4xg3sow56bq",
"skill/valory/generic_scoring_abci/0.1.0": "bafybeiexjfu736oe3u43siklxsyqwvlltoks5rnmhl2t7jjmwpwuhc3fey",
"protocol/valory/twitter/0.1.0": "bafybeig7dugazhljpb4qtu4zfnoimttvivopiq574rogjz3qggf5eysnk4",
"protocol/valory/llm/1.0.0": "bafybeihj2orqapokafg7co3wlogwgf6cckaaj2bz3nuv4rm3opkoyhrlp4",
"connection/valory/twitter/0.1.0": "bafybeigwywkh4ep72pu6yqr4v3qkahj6buo6f4ng5hhgkkgr5fvcv6ztey",
"connection/valory/twitter/0.1.0": "bafybeibju7477agfjcveypdv4smso2iy6vy2iqy5lz2ua2bbjhyxlm5dre",
"connection/valory/openai/0.1.0": "bafybeiepsxac7e2tq3mcfkgcx62zt6oiaeic5wwcs4mnv733l762kn62du",
"skill/valory/twitter_write_abci/0.1.0": "bafybeigcpqeu2ymlgozqq6o6befqnmvyfkudqpvfvh255ovrtd3erhodlu",
"skill/valory/twitter_write_abci/0.1.0": "bafybeiga55lbnr6k632ytgwintyuaxegrvvt7k6bn7vwymbgcq7w6tqi7m",
"skill/valory/llm_abci/0.1.0": "bafybeiav6mfjf5ltrhpmrelfpix3s7irgrk35ejx6zuqjm4wengyihmsse",
"skill/valory/decision_making_abci/0.1.0": "bafybeibx6wvyp76xkzcdnfpluxjoxlwqpcgmn7ovyam6pghhl6jfdz6kie",
"service/valory/impact_evaluator_local/0.1.0": "bafybeifipmeobm6w65kx2wgxnag4idren3oexwgv3mh5qv2nwsj434u2zu",
"skill/valory/decision_making_abci/0.1.0": "bafybeifgex5tw3vllnkulzwktupnirftaxr36c26vrdlpy5gcbtbry2eiy",
"service/valory/impact_evaluator_local/0.1.0": "bafybeignbzld4tcce2vjort7nrh2wckvpf636zek5lfffmlffpgxzqe6y4",
"skill/valory/olas_week_abci/0.1.0": "bafybeiholnppuo6zfrxh3yqjedvf5m7s2w6ahwsdfq444zfo7jlvfigfdu",
"skill/valory/mech_interact_abci/0.1.0": "bafybeielb6agwj5jfdv3nqnc7iugb4qz5us223jpr5uwolke4fmzxvmkna",
"contract/valory/mech/0.1.0": "bafybeibv6ydk326zkny4pphze64zgzzv2sc5qkt2iyymoi6pt3ci2gtxne"
"skill/valory/mech_interact_abci/0.1.0": "bafybeihwvjvxyv2ca2eskt3d5cvac4onr7m2hla2inydpqdipw4ze3yz6a",
"contract/valory/mech/0.1.0": "bafybeibv6ydk326zkny4pphze64zgzzv2sc5qkt2iyymoi6pt3ci2gtxne",
"contract/valory/compatibility_fallback_handler/0.1.0": "bafybeifyan3wzhsvafwwkyq7tptojvkm3mzjtzgjqewvdbpkuia7r2dfnq",
"contract/valory/wveolas/0.1.0": "bafybeifap7ourb6ginmbndgwzsyq2xvap2t6uy6m6yshm2klvbio7nuobi"
},
"third_party": {
"protocol/open_aea/signing/1.0.0": "bafybeie7xyems76v5b4wc2lmaidcujizpxfzjnnwdeokmhje53g7ym25ii",
Expand Down
14 changes: 8 additions & 6 deletions packages/valory/agents/impact_evaluator/aea-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ connections:
- valory/ledger:0.19.0:bafybeia47rr37ianvwsh77tjjpv3nwif5sywhhy2fbdshnz4a2icwln76a
- valory/p2p_libp2p_client:0.1.0:bafybeihge56dn3xep2dzomu7rtvbgo4uc2qqh7ljl3fubqdi2lq44gs5lq
- valory/openai:0.1.0:bafybeiepsxac7e2tq3mcfkgcx62zt6oiaeic5wwcs4mnv733l762kn62du
- valory/twitter:0.1.0:bafybeigwywkh4ep72pu6yqr4v3qkahj6buo6f4ng5hhgkkgr5fvcv6ztey
- valory/twitter:0.1.0:bafybeibju7477agfjcveypdv4smso2iy6vy2iqy5lz2ua2bbjhyxlm5dre
contracts:
- valory/dynamic_contribution:0.1.0:bafybeia54zrihbupv35dkw23x4lc7cgeh3obinqlszvjighm7rxap6komi
- valory/gnosis_safe:0.1.0:bafybeidll7frtdsq2ckiluazkwk4zpkp7natt4kdejjehwvykqwzyuf6ei
Expand All @@ -42,7 +42,7 @@ protocols:
skills:
- valory/abstract_abci:0.1.0:bafybeiflcfufixmsrhobf56bn5745m2iipcfqyulwk2qegtnagb3kvaaxi
- valory/abstract_round_abci:0.1.0:bafybeiaqcl7h2famylusiffigwem7tevkcsyocdu5xd42jkmgq6kvowzgq
- valory/impact_evaluator_abci:0.1.0:bafybeihv52iil4qknszjts33wpiknbvx46g2otowl6w2oklx3pvb5g7fye
- valory/impact_evaluator_abci:0.1.0:bafybeifi55u4cghp4mpq6fnolaoqozxiu4iqyecyo3kjc3m4xg3sow56bq
- valory/generic_scoring_abci:0.1.0:bafybeiexjfu736oe3u43siklxsyqwvlltoks5rnmhl2t7jjmwpwuhc3fey
- valory/twitter_scoring_abci:0.1.0:bafybeiezvn76bbkmfuddcitooj7b3r7kv4cdehz7noepybqylhz2cjt3hm
- valory/ceramic_read_abci:0.1.0:bafybeigqpkvsxfhz5jt3yuipmkl6eyfgqcw36226sgfhdgud7mphsjmopa
Expand All @@ -52,11 +52,11 @@ skills:
- valory/reset_pause_abci:0.1.0:bafybeidzajbe3erygeh2xbd6lrjv7nsptznjuzrt24ykgvhgotdeyhfnba
- valory/termination_abci:0.1.0:bafybeie4zvjfxvdu7qrulmur3chpjz3kpj5m4bjsxvpk4gvj5zbyyayfaa
- valory/transaction_settlement_abci:0.1.0:bafybeiaefgqbs7zsn5xe5kdwrujj7ivygkn3ujpw6crnvi3knvxw75qmja
- valory/twitter_write_abci:0.1.0:bafybeigcpqeu2ymlgozqq6o6befqnmvyfkudqpvfvh255ovrtd3erhodlu
- valory/decision_making_abci:0.1.0:bafybeibx6wvyp76xkzcdnfpluxjoxlwqpcgmn7ovyam6pghhl6jfdz6kie
- valory/twitter_write_abci:0.1.0:bafybeiga55lbnr6k632ytgwintyuaxegrvvt7k6bn7vwymbgcq7w6tqi7m
- valory/decision_making_abci:0.1.0:bafybeifgex5tw3vllnkulzwktupnirftaxr36c26vrdlpy5gcbtbry2eiy
- valory/llm_abci:0.1.0:bafybeiav6mfjf5ltrhpmrelfpix3s7irgrk35ejx6zuqjm4wengyihmsse
- valory/olas_week_abci:0.1.0:bafybeiholnppuo6zfrxh3yqjedvf5m7s2w6ahwsdfq444zfo7jlvfigfdu
- valory/mech_interact_abci:0.1.0:bafybeielb6agwj5jfdv3nqnc7iugb4qz5us223jpr5uwolke4fmzxvmkna
- valory/mech_interact_abci:0.1.0:bafybeihwvjvxyv2ca2eskt3d5cvac4onr7m2hla2inydpqdipw4ze3yz6a
default_ledger: ethereum
required_ledgers:
- ethereum
Expand Down Expand Up @@ -250,9 +250,11 @@ models:
light_slash_unit_amount: ${int:5000000000000000}
serious_slash_unit_amount: ${int:8000000000000000}
multisend_batch_size: ${int:50}
mech_contract_address: ${str:0xff82123dfb52ab75c417195c5fdb87630145ae81}
mech_contract_address: ${str:0x77af31de935740567cf4ff1986d04b2c964a786a}
ipfs_address: ${str:https://gateway.autonolas.tech/ipfs/}
default_chain_id: ${str:ethereum}
transaction_service_url: ${str:https://safe-transaction-mainnet.safe.global/api/v1/messages/{message_hash}/}
wveolas_address: ${str:0x4039B809E0C0Ad04F6Fc880193366b251dDf4B40}
---
public_id: valory/http_server:0.22.0:bafybeicblltx7ha3ulthg7bzfccuqqyjmihhrvfeztlgrlcoxhr7kf6nbq
type: connection
Expand Down
56 changes: 37 additions & 19 deletions packages/valory/connections/twitter/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,30 @@ def create_tweet(

# Call the staging API
if self.use_staging_api:
url = self.staging_api
url = f"{self.staging_api}/twitter/create_tweet"

if isinstance(text, list):
# Thread
first_tweet_id = None
for tweet in text:
self.logger.info(
f"Posting tweet using the staging API {url}"
)

try:
if isinstance(text, list):
# Thread
first_tweet_id = None
for tweet in text:
response = requests.post(
url,
json={
"user_name": "staging_contribute",
"text": text
},
timeout=10
)

if not first_tweet_id:
first_tweet_id = response.json()["tweet_id"]
else:
# Single tweet
response = requests.post(
url,
json={
Expand All @@ -188,31 +206,31 @@ def create_tweet(
},
timeout=10
)

if not first_tweet_id:
first_tweet_id = response.json()["tweet_id"]
else:
# Single tweet
response = requests.post(
url,
json={
"user_name": "staging_contribute",
"text": text
},
timeout=10
first_tweet_id = response.json()["tweet_id"]

except requests.exceptions.ConnectionError as error:
return cast(
TwitterMessage,
dialogue.reply(
performative=TwitterMessage.Performative.ERROR,
target_message=message,
message=error,
),
)
first_tweet_id = response.json()["tweet_id"]

return cast(
TwitterMessage,
dialogue.reply(
performative=TwitterMessage.Performative.TWEET_CREATED,
target_message=message,
tweet_id=first_tweet_id,
tweet_id=str(first_tweet_id),
),
)

# Call the Twitter API
self.logger.info(
"Posting tweet using tweepy"
)
api = (
self.api
if not credentials
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/connections/twitter/connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license: Apache-2.0
aea_version: '>=1.0.0, <2.0.0'
fingerprint:
__init__.py: bafybeibxwzkyh7odchnlkeczpguencdjiizm4nezfmi4drybn2zd25xdkq
connection.py: bafybeih7u4dn4aglafa4bhsl6yfgshckr6ephgjuza6uzwvmbp5whrhk3a
connection.py: bafybeigyjxqsyu3e7x6dhvjlmb4xvdkikxkts6ik5v7thwpq5i2blixvta
readme.md: bafybeihg5yfzgqvg5ngy7r2o5tfeqnelx2ffxw4po5hmheqjfhumpmxpoq
fingerprint_ignore_patterns: []
connections: []
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2021-2023 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 Safe's CompatibilityFallbackHandler contract."""
Loading

0 comments on commit ac73d6a

Please sign in to comment.