From 260c07c8a212778d5efbe49fad779f3c2bedafb6 Mon Sep 17 00:00:00 2001 From: Mikhail Petrov Date: Thu, 11 Jan 2024 13:05:43 +0300 Subject: [PATCH] web: Make gasToken variable hardcoded, closes #114 Signed-off-by: Mikhail Petrov --- .env | 1 - README.md | 1 - src/Profile.js | 5 ++--- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.env b/.env index 7ebe472..2b1bf82 100644 --- a/.env +++ b/.env @@ -8,4 +8,3 @@ REACT_APP_HTTPGW=https://http.fs.neo.org # Mainnet NeoFS contract REACT_APP_NEOFS_ACCOUNT=NNxVrKjLsRkWsmGgmuNXLcMswtxTGaNQLk REACT_APP_NEOFS_SCRIPT_HASH=0x2cafa46838e8b564468ebd868dcafdd99dce6221 -REACT_APP_NEOFS_GAS_TOKEN=0xd2a4cff31913016155e38e474a2c06d08be276cf diff --git a/README.md b/README.md index 92203d8..da9da8d 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,6 @@ Set variables in `.env` file data path) - `REACT_APP_NEOFS_ACCOUNT` - Neo3 address of the NeoFS contract - `REACT_APP_NEOFS_SCRIPT_HASH` - Script hash of the NeoFS contract -- `REACT_APP_NEOFS_GAS_TOKEN` - Script hash of the Gas token contract Run next commands from project's root: diff --git a/src/Profile.js b/src/Profile.js index 099f11c..1434d16 100644 --- a/src/Profile.js +++ b/src/Profile.js @@ -34,7 +34,6 @@ const Profile = ({ const [NeoFSContract] = useState({ scriptHash: process.env.REACT_APP_NEOFS_SCRIPT_HASH ? process.env.REACT_APP_NEOFS_SCRIPT_HASH : '0x3c3f4b84773ef0141576e48c3ff60e5078235891', account: process.env.REACT_APP_NEOFS_ACCOUNT ? process.env.REACT_APP_NEOFS_ACCOUNT : 'NZAUkYbJ1Cb2HrNmwZ1pg9xYHBhm2FgtKV', - gasToken: process.env.REACT_APP_NEOFS_GAS_TOKEN ? process.env.REACT_APP_NEOFS_GAS_TOKEN : '0xd2a4cff31913016155e38e474a2c06d08be276cf', }); const [containers, setContainers] = useState([]); const [isLoadingContainers, setIsLoadingContainers] = useState(false); @@ -165,7 +164,7 @@ const Profile = ({ onModal('approveRequest'); const senderAddress = wcSdk.getAccountAddress(0); const invocations = [{ - scriptHash: NeoFSContract.gasToken, + scriptHash: '0xd2a4cff31913016155e38e474a2c06d08be276cf', operation: 'transfer', args: [ { type: 'Address', value: senderAddress }, @@ -211,7 +210,7 @@ const Profile = ({ const signers = [{ scopes: 16, // WitnessScope.CustomContracts - allowedContracts: [NeoFSContract.gasToken, NeoFSContract.scriptHash] + allowedContracts: ['0xd2a4cff31913016155e38e474a2c06d08be276cf', NeoFSContract.scriptHash] }]; const response = await wcSdk.invokeFunction({ invocations, signers }).catch((error) => {