From 790af5871105fe0946d9538631395433a47415a7 Mon Sep 17 00:00:00 2001 From: Amin Moghaddam Date: Thu, 14 Mar 2024 16:56:36 +0100 Subject: [PATCH 1/2] Update naming on express relay interfaces --- .../{IPERMulticall.sol => IExpressRelay.sol} | 12 ++-- ...eiver.sol => IExpressRelayFeeReceiver.sol} | 2 +- express_relay/sdk/solidity/README.md | 8 +-- ...{IPERMulticall.json => IExpressRelay.json} | 4 +- ...ver.json => IExpressRelayFeeReceiver.json} | 0 express_relay/sdk/solidity/package.json | 8 +-- package-lock.json | 72 ++----------------- 7 files changed, 24 insertions(+), 82 deletions(-) rename express_relay/sdk/solidity/{IPERMulticall.sol => IExpressRelay.sol} (58%) rename express_relay/sdk/solidity/{IPERFeeReceiver.sol => IExpressRelayFeeReceiver.sol} (90%) rename express_relay/sdk/solidity/abis/{IPERMulticall.json => IExpressRelay.json} (84%) rename express_relay/sdk/solidity/abis/{IPERFeeReceiver.json => IExpressRelayFeeReceiver.json} (100%) diff --git a/express_relay/sdk/solidity/IPERMulticall.sol b/express_relay/sdk/solidity/IExpressRelay.sol similarity index 58% rename from express_relay/sdk/solidity/IPERMulticall.sol rename to express_relay/sdk/solidity/IExpressRelay.sol index 4d149a6adc..172852e7bd 100644 --- a/express_relay/sdk/solidity/IPERMulticall.sol +++ b/express_relay/sdk/solidity/IExpressRelay.sol @@ -2,14 +2,14 @@ // Copyright (C) 2024 Lavra Holdings Limited - All Rights Reserved pragma solidity ^0.8.0; -interface IPERMulticall { +interface IExpressRelay { // Check if the combination of protocol and permissionKey is allowed within this transaction. - // This will return true if and only if it's being called while executing the auction winner call. - // @param protocol The address of the protocol that is gating an action behind this permission - // @param permissionKey The permission key that is being checked + // This will return true if and only if it's being called while executing the auction winner(s) call. + // @param protocolFeeReceiver The address of the protocol that is gating an action behind this permission + // @param permissionId The id that represents the action being gated // @return permissioned True if the permission is allowed, false otherwise function isPermissioned( - address protocol, - bytes calldata permissionKey + address protocolFeeReceiver, + bytes calldata permissionId ) external view returns (bool permissioned); } diff --git a/express_relay/sdk/solidity/IPERFeeReceiver.sol b/express_relay/sdk/solidity/IExpressRelayFeeReceiver.sol similarity index 90% rename from express_relay/sdk/solidity/IPERFeeReceiver.sol rename to express_relay/sdk/solidity/IExpressRelayFeeReceiver.sol index 6d285e0412..a4226222b0 100644 --- a/express_relay/sdk/solidity/IPERFeeReceiver.sol +++ b/express_relay/sdk/solidity/IExpressRelayFeeReceiver.sol @@ -2,7 +2,7 @@ // Copyright (C) 2024 Lavra Holdings Limited - All Rights Reserved pragma solidity ^0.8.0; -interface IPERFeeReceiver { +interface IExpressRelayFeeReceiver { // Receive the proceeds of an auction. // @param permissionKey The permission key where the auction was conducted on. function receiveAuctionProceedings( diff --git a/express_relay/sdk/solidity/README.md b/express_relay/sdk/solidity/README.md index c05959a450..b2d3edbf8e 100644 --- a/express_relay/sdk/solidity/README.md +++ b/express_relay/sdk/solidity/README.md @@ -1,4 +1,4 @@ -# Pyth Express Relay Solidity SDK +# Express Relay Solidity SDK ## Install @@ -7,7 +7,7 @@ If you are using Truffle or Hardhat, simply install the NPM package: ```bash -npm install @pythnetwork/per-sdk-solidity +npm install @pythnetwork/express-relay-sdk-solidity ``` ### Foundry @@ -17,11 +17,11 @@ From the root directory of your project, run: ```bash npm init -y -npm install @pythnetwork/per-sdk-solidity +npm install @pythnetwork/express-relay-sdk-solidity ``` Then add the following line to your `remappings.txt` file: ```text -@pythnetwork/per-sdk-solidity/=node_modules/@pythnetwork/per-sdk-solidity +@pythnetwork/express-relay-sdk-solidity/=node_modules/@pythnetwork/express-relay-sdk-solidity ``` diff --git a/express_relay/sdk/solidity/abis/IPERMulticall.json b/express_relay/sdk/solidity/abis/IExpressRelay.json similarity index 84% rename from express_relay/sdk/solidity/abis/IPERMulticall.json rename to express_relay/sdk/solidity/abis/IExpressRelay.json index c8588feeb9..a73d837e78 100644 --- a/express_relay/sdk/solidity/abis/IPERMulticall.json +++ b/express_relay/sdk/solidity/abis/IExpressRelay.json @@ -3,12 +3,12 @@ "inputs": [ { "internalType": "address", - "name": "protocol", + "name": "protocolFeeReceiver", "type": "address" }, { "internalType": "bytes", - "name": "permissionKey", + "name": "permissionId", "type": "bytes" } ], diff --git a/express_relay/sdk/solidity/abis/IPERFeeReceiver.json b/express_relay/sdk/solidity/abis/IExpressRelayFeeReceiver.json similarity index 100% rename from express_relay/sdk/solidity/abis/IPERFeeReceiver.json rename to express_relay/sdk/solidity/abis/IExpressRelayFeeReceiver.json diff --git a/express_relay/sdk/solidity/package.json b/express_relay/sdk/solidity/package.json index d19d3d2ec6..07dbd1cad8 100644 --- a/express_relay/sdk/solidity/package.json +++ b/express_relay/sdk/solidity/package.json @@ -1,7 +1,7 @@ { - "name": "@pythnetwork/per-sdk-solidity", - "version": "0.1.0", - "description": "Solidity SDK for interacting with Pyth express relay contracts", + "name": "@pythnetwork/express-relay-sdk-solidity", + "version": "0.2.0", + "description": "Solidity SDK for interacting with express relay contracts", "repository": { "type": "git", "url": "https://github.com/pyth-network/pyth-crosschain", @@ -12,7 +12,7 @@ }, "scripts": { "format": "npx prettier --write .", - "generate-abi": "npx generate-abis IPERMulticall IPERFeeReceiver", + "generate-abi": "npx generate-abis IExpressRelay IExpressRelayFeeReceiver", "check-abi": "git diff --exit-code abis" }, "keywords": [ diff --git a/package-lock.json b/package-lock.json index 8d4f976aae..c172ee795a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2132,8 +2132,8 @@ } }, "express_relay/sdk/solidity": { - "name": "@pythnetwork/per-sdk-solidity", - "version": "0.1.0", + "name": "@pythnetwork/express-relay-sdk-solidity", + "version": "0.2.0", "license": "Apache-2.0", "devDependencies": { "abi_generator": "*", @@ -13601,7 +13601,7 @@ "resolved": "express_relay/sdk/js", "link": true }, - "node_modules/@pythnetwork/per-sdk-solidity": { + "node_modules/@pythnetwork/express-relay-sdk-solidity": { "resolved": "express_relay/sdk/solidity", "link": true }, @@ -58739,7 +58739,7 @@ }, "target_chains/ethereum/entropy_sdk/solidity": { "name": "@pythnetwork/entropy-sdk-solidity", - "version": "1.1.3", + "version": "1.2.0", "license": "Apache-2.0", "devDependencies": { "abi_generator": "*", @@ -59314,47 +59314,6 @@ "typescript": "^4.6.3" } }, - "target_chains/solana/sdk/js/solana_utils": { - "name": "@pythnetwork/solana-utils", - "version": "0.1.0", - "license": "Apache-2.0", - "dependencies": { - "@coral-xyz/anchor": "^0.29.0", - "@solana/web3.js": "^1.90.0" - }, - "devDependencies": { - "@types/jest": "^29.4.0", - "@typescript-eslint/eslint-plugin": "^5.20.0", - "@typescript-eslint/parser": "^5.20.0", - "eslint": "^8.13.0", - "jest": "^29.4.0", - "prettier": "^2.6.2", - "quicktype": "^23.0.76", - "ts-jest": "^29.0.5", - "typescript": "^4.6.3" - } - }, - "target_chains/solana/sdk/js/pyth_solana_receiver": { - "version": "0.1.0", - "license": "Apache-2.0", - "dependencies": { - "@coral-xyz/anchor": "^0.29.0", - "@pythnetwork/price-service-sdk": "*", - "@pythnetwork/solana-utils": "*", - "@solana/web3.js": "^1.90.0" - }, - "devDependencies": { - "@types/jest": "^29.4.0", - "@typescript-eslint/eslint-plugin": "^5.20.0", - "@typescript-eslint/parser": "^5.20.0", - "eslint": "^8.13.0", - "jest": "^29.4.0", - "prettier": "^2.6.2", - "quicktype": "^23.0.76", - "ts-jest": "^29.0.5", - "typescript": "^4.6.3" - } - }, "target_chains/solana/sdk/js/pyth_solana_receiver/node_modules/@coral-xyz/anchor": { "version": "0.29.0", "resolved": "https://registry.npmjs.org/@coral-xyz/anchor/-/anchor-0.29.0.tgz", @@ -59421,6 +59380,7 @@ "version": "0.1.0", "license": "Apache-2.0", "dependencies": { + "@coral-xyz/anchor": "^0.29.0", "@solana/web3.js": "^1.90.0" }, "devDependencies": { @@ -69047,7 +69007,7 @@ } } }, - "@pythnetwork/per-sdk-solidity": { + "@pythnetwork/express-relay-sdk-solidity": { "version": "file:express_relay/sdk/solidity", "requires": { "abi_generator": "*", @@ -71143,24 +71103,6 @@ "prettier-plugin-solidity": "^1.0.0-rc.1" } }, - "@pythnetwork/pyth-solana-receiver": { - "version": "file:target_chains/solana/sdk/js/pyth_solana_receiver", - "requires": { - "@coral-xyz/anchor": "^0.29.0", - "@pythnetwork/price-service-sdk": "*", - "@pythnetwork/solana-utils": "*", - "@solana/web3.js": "^1.90.0", - "@types/jest": "^29.4.0", - "@typescript-eslint/eslint-plugin": "^5.20.0", - "@typescript-eslint/parser": "^5.20.0", - "eslint": "^8.13.0", - "jest": "^29.4.0", - "prettier": "^2.6.2", - "quicktype": "^23.0.76", - "ts-jest": "^29.0.5", - "typescript": "^4.6.3" - } - }, "@pythnetwork/pyth-solana-receiver": { "version": "file:target_chains/solana/sdk/js/pyth_solana_receiver", "requires": { @@ -71369,7 +71311,7 @@ "@pythnetwork/solana-utils": { "version": "file:target_chains/solana/sdk/js/solana_utils", "requires": { - "@coral-xyz/anchor": "*", + "@coral-xyz/anchor": "^0.29.0", "@solana/web3.js": "^1.90.0", "@types/jest": "^29.4.0", "@typescript-eslint/eslint-plugin": "^5.20.0", From 9ac6a524a1da4a263f9e58515e442f08b43411bb Mon Sep 17 00:00:00 2001 From: Amin Moghaddam Date: Thu, 14 Mar 2024 19:46:43 +0100 Subject: [PATCH 2/2] Address comment --- express_relay/sdk/solidity/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/express_relay/sdk/solidity/package.json b/express_relay/sdk/solidity/package.json index 07dbd1cad8..4e44e00401 100644 --- a/express_relay/sdk/solidity/package.json +++ b/express_relay/sdk/solidity/package.json @@ -1,7 +1,7 @@ { "name": "@pythnetwork/express-relay-sdk-solidity", "version": "0.2.0", - "description": "Solidity SDK for interacting with express relay contracts", + "description": "Solidity SDK for interacting with Express Relay contracts", "repository": { "type": "git", "url": "https://github.com/pyth-network/pyth-crosschain",