diff --git a/README.md b/README.md deleted file mode 100644 index 54e0914..0000000 --- a/README.md +++ /dev/null @@ -1,83 +0,0 @@ -# Layer2Hackathon -Dream big, let's scale! - -# Introduction -Scaling is a Blue Ocean waiting for the developers to explore and find the New World. Scaling blockchains and specifically Ethereum has been a challenge. Every scaling approach has its own trade-offs regarding the security, decentralization, throughput, and flexibility choices.In support of developers to explore more possibilities of Layer2 solutions and open up new paths, IOSG Ventures and Chainlink are organizing a global Layer2 hackathon, find more into here: http://hackathon.iosg.vc - -# Prizes -Top winner: $16,000 1 slot - -Second tier: $10,000 2 slots - -Third tier: $6,000 4 slots - -Favorite Project by Community: $3,000 1 slot - -Award for the Most Promising Project: $3,000 1 slot - -# Challenges Categories -Layer2 Infrastructure (layer2 chains/ underlying technology/ etc..) - -Tools (multi-chain asset management/ middleware/ etc..) - -Applications (products that use or serve layer2..) - -Bridge (cross-chain ...) - -other challenges that related to Layer2 - -# Examples -1, Privacy Oriented Apps on Layer2 - -2, Data analytics tool or data services on Layer2 - -3, Any developer friendly middleware tools or frameworks on Layer2 - -4, Innovative NFT infrastructure or protocols on Layer2 - -5, Innovative DeFi protocols on Layer2 - -6, Improvements over cross Layer2 liquidity - -7, MEV on Layer2 - -8, Layer2 friendly wallet - -# Judging Criteria -Judges will comments according to the below perspectives: Relavence to the event theme ; Completion ; Economic value ; Innovation ; Technical difficulty ; Usability ; Demo performance, etc. Judges will receive specific judging criteria and scoring suggestions before the demo day. - -# Ecological Bounties -🔥 Aztec - $5K Pending - -🔥 Aurora - $4.5K Aurora Tip Web Widget Bounty Aurora Telegram Tip Bot Bounty https://docs.google.com/document/d/1esg-h8HRnNP9eh3jBNEUhn864jY1mYtqQr0M-uBpr3M/edit?usp=sharing - -🔥 The Graph - $7K The Graph Special bounty https://drive.google.com/file/d/1nN6v-pkAbr1Zzc_deGWQHzr92v2OXsBi/view?usp=sharing - -🔥 Arbitrum - $4k https://shimo.im/docs/Rk3KPphw89c8Qwtv/ - -🔥 Polygon - $3K Best NFT or Defi implementation on Polygon Open Track https://docs.google.com/document/d/1qVZXlvoyaAjMTph7Vm3-WAUr5XQZwW3nyxQKas-unbo/edit?usp=sharing - -🔥 Synthetix - $2K Synthetix Special Bounty https://mp.weixin.qq.com/s/cI63SYFp6b6JmNaKbH8C3Q - -🔥 MCDEX - $5K MCDEX Hackathon — Enhancing the MCDEX Ecosystem https://mcdex.medium.com/mcdex-hackathon-enhancing-the-mcdex-ecosystem-7c05747ddfa6 - -🔥 Conflux - $2K Conflux Bounty Challenge https://forum.conflux.fun/t/iosg-chainlink-conflux-bounty-challenge/9126 - -🔥 Chainlink - $8K Chainlink Price Feeds Chainlink VRF Chainlink decentralized oracle network Chainlink Keepers network https://docs.google.com/document/d/1L_RSEpa9XRfAUN0nylduJRrpys89PvCk9y7VR6fEwcc/edit?usp=sharing - -🔥 Kickstarter - $10K - $100k Layer2 related direction https://iosg.vc/kickstarterprogram/ - -# Guide and Timetable -https://drive.google.com/file/d/17Pkcr8JCV6_kcXEpwVgcepYUsshbeNjS/view - -# Communication Channel -https://t.me/iosg_event - -WeChat group: IOSG_VC - -# Social Media Channel -Twitter: https://twitter.com/IOSGVC - -Medium: https://medium.com/iosg-ventures - -WeChat: IOSGVC diff --git a/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/README.md b/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/README.md new file mode 100644 index 0000000..88752c9 --- /dev/null +++ b/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/README.md @@ -0,0 +1,37 @@ +Chainlink Python External Adapter for NVD Impact Score and vulnerability description. + +This repository implemented chanlink external adapter for getting impact score and vulnerability description from Nation vulnerability database. It is coded by Python and chainlink official template. +Install + +pip3 install -r requirements.txt + +Run locally: + +python3 app.py + +open another terminel : + +cat test.sh + +#!/bin/bash + +curl -X POST -H "Content-Type: application/json" http://localhost:8080 -d '{ "id": "CVE-2010-4662" }' +curl -X POST -H "Content-Type: application/json" http://localhost:8080 -d '{ "id": "cve-2021-1675" }' + + +$ bash test.sh + + +Example JSON Response: +{ + "Description": "PmWiki before 2.2.21 has XSS.", + "baseScore": 6.1, + "jobRunID": "CVE-2010-4662", + "statusCode": 200 +} +{ + "Description": "Windows Print Spooler Elevation of Privilege Vulnerability", + "baseScore": 8.8, + "jobRunID": "cve-2021-1675", + "statusCode": 200 +} diff --git a/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/__pycache__/adapter.cpython-38.pyc b/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/__pycache__/adapter.cpython-38.pyc new file mode 100644 index 0000000..9a09328 Binary files /dev/null and b/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/__pycache__/adapter.cpython-38.pyc differ diff --git a/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/__pycache__/bridge.cpython-38.pyc b/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/__pycache__/bridge.cpython-38.pyc new file mode 100644 index 0000000..48a0c18 Binary files /dev/null and b/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/__pycache__/bridge.cpython-38.pyc differ diff --git a/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/__pycache__/elonmusk.cpython-38.pyc b/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/__pycache__/elonmusk.cpython-38.pyc new file mode 100644 index 0000000..766676c Binary files /dev/null and b/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/__pycache__/elonmusk.cpython-38.pyc differ diff --git a/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/__pycache__/nvd.cpython-38.pyc b/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/__pycache__/nvd.cpython-38.pyc new file mode 100644 index 0000000..e956fa1 Binary files /dev/null and b/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/__pycache__/nvd.cpython-38.pyc differ diff --git a/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/adapter.py b/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/adapter.py new file mode 100644 index 0000000..c5158c9 --- /dev/null +++ b/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/adapter.py @@ -0,0 +1,36 @@ +from bridge import Bridge +#from elonmusk import SpaceX +from nvd import CVE +import requests + +class Adapter: + + def __init__(self, input): + self.id = input.get('id', '1') + self.bridge = Bridge() + self.create_request() + + def create_request(self): + try: + data = CVE().get_launch_info(self.id) + self.result_success(data) + except Exception as e: + self.result_error(e) + finally: + self.bridge.close() + + def result_success(self, data): + self.result = { + 'jobRunID' : self.id, + 'baseScore' : data["baseScore"], + 'Description' : data["Description"], + 'statusCode' : 200, + } + + def result_error(self, error): + self.result = { + 'jobRunID': self.id, + 'status': 'errored', + 'error': f'There was an error: {error}', + 'statusCode': 500, + } diff --git a/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/app.py b/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/app.py new file mode 100644 index 0000000..c7c6b19 --- /dev/null +++ b/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/app.py @@ -0,0 +1,20 @@ +from flask import Flask, request, jsonify +from adapter import Adapter + +app = Flask(__name__) + +@app.before_request +def log_request_info(): + app.logger.debug('Headers: %s', request.headers) + app.logger.debug('Body: %s', request.get_data()) + +@app.route('/', methods=['POST']) +def call_adapter(): + data = request.get_json() + if data == '': + data = {} + adapter = Adapter(data) + return jsonify(adapter.result) + +if __name__ == '__main__': + app.run(debug=True, host='127.0.0.1', port='8080', threaded=True) \ No newline at end of file diff --git a/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/bridge.py b/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/bridge.py new file mode 100644 index 0000000..d65a3b0 --- /dev/null +++ b/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/bridge.py @@ -0,0 +1,36 @@ +import requests +from requests.adapters import HTTPAdapter +from requests.packages.urllib3.util.retry import Retry + +class Bridge(object): + + def __init__( + self, + retries=3, + backoff_factor=0.3, + status_forcelist=(500, 502, 504), + ): + self.session = requests.Session() + retry = Retry( + total=retries, + read=retries, + connect=retries, + backoff_factor=backoff_factor, + status_forcelist=status_forcelist, + ) + adapter = HTTPAdapter(max_retries=retry) + self.session.mount('http://', adapter) + self.session.mount('https://', adapter) + + def request(self, url, headers={}, timeout=15): + try: + return self.session.get( + url, + headers=headers, + timeout=timeout + ) + except Exception as e: + raise e + + def close(self): + self.session.close() diff --git a/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/cve.txt b/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/cve.txt new file mode 100644 index 0000000..b10a82a --- /dev/null +++ b/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/cve.txt @@ -0,0 +1,2 @@ +cve-2021-1675 +CVE-2010-4662 diff --git a/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/main.py b/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/main.py new file mode 100644 index 0000000..8fee1be --- /dev/null +++ b/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/main.py @@ -0,0 +1,9 @@ +from adapter import Adapter + +def lambda_handler(event, context): + adapter = Adapter(event) + return adapter.result + +def gcs_handler(request): + adapter = Adapter(request.json) + return json.dumps(adapter.result) \ No newline at end of file diff --git a/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/nvd.py b/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/nvd.py new file mode 100644 index 0000000..fa7e3ee --- /dev/null +++ b/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/nvd.py @@ -0,0 +1,17 @@ +import requests + +class CVE: + + def __init__(self): + self._api_endpoint = "https://plasticuproject.pythonanywhere.com/nvd-api/v1/" + + def get_launch_info(self,cve): + response = requests.get(self._api_endpoint + cve).json() + try: + cve ={ + "baseScore" : response['impact']['baseMetricV3']['cvssV3']['baseScore'], + "Description": response['cve']['description']['description_data'][0]['value'] + } + return cve + except Exception as error: + return error diff --git a/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/requirements.txt b/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/requirements.txt new file mode 100644 index 0000000..fe6cc5c --- /dev/null +++ b/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/requirements.txt @@ -0,0 +1,12 @@ +-i https://pypi.org/simple +certifi==2020.4.5.1 +chardet==3.0.4 +click==7.1.1 +flask==1.1.1 +idna==2.9 +itsdangerous==1.1.0 +jinja2==2.11.1 +markupsafe==1.1.1 +requests==2.23.0 +urllib3==1.25.8 +werkzeug==1.0.1 \ No newline at end of file diff --git a/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/test.sh b/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/test.sh new file mode 100644 index 0000000..a51100b --- /dev/null +++ b/projects/Team-2-EtherEdge/NVD-Chainlink-Adapter/test.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +curl -X POST -H "Content-Type: application/json" http://localhost:8080 -d '{ "id": "CVE-2010-4662" }' +curl -X POST -H "Content-Type: application/json" http://localhost:8080 -d '{ "id": "cve-2021-1675" }' + diff --git a/projects/Team-2-EtherEdge/README.md b/projects/Team-2-EtherEdge/README.md new file mode 100644 index 0000000..88752c9 --- /dev/null +++ b/projects/Team-2-EtherEdge/README.md @@ -0,0 +1,37 @@ +Chainlink Python External Adapter for NVD Impact Score and vulnerability description. + +This repository implemented chanlink external adapter for getting impact score and vulnerability description from Nation vulnerability database. It is coded by Python and chainlink official template. +Install + +pip3 install -r requirements.txt + +Run locally: + +python3 app.py + +open another terminel : + +cat test.sh + +#!/bin/bash + +curl -X POST -H "Content-Type: application/json" http://localhost:8080 -d '{ "id": "CVE-2010-4662" }' +curl -X POST -H "Content-Type: application/json" http://localhost:8080 -d '{ "id": "cve-2021-1675" }' + + +$ bash test.sh + + +Example JSON Response: +{ + "Description": "PmWiki before 2.2.21 has XSS.", + "baseScore": 6.1, + "jobRunID": "CVE-2010-4662", + "statusCode": 200 +} +{ + "Description": "Windows Print Spooler Elevation of Privilege Vulnerability", + "baseScore": 8.8, + "jobRunID": "cve-2021-1675", + "statusCode": 200 +} diff --git a/projects/Team-2-EtherEdge/docs/the-second-law-of-hacker-metaverse.pdf b/projects/Team-2-EtherEdge/docs/the-second-law-of-hacker-metaverse.pdf new file mode 100644 index 0000000..30bb50c Binary files /dev/null and b/projects/Team-2-EtherEdge/docs/the-second-law-of-hacker-metaverse.pdf differ