Skip to content

Commit

Permalink
web: Make gasToken variable hardcoded, closes #114
Browse files Browse the repository at this point in the history
Signed-off-by: Mikhail Petrov <[email protected]>
  • Loading branch information
mike-petrov committed Jan 11, 2024
1 parent acc7977 commit 260c07c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
5 changes: 2 additions & 3 deletions src/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 },
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit 260c07c

Please sign in to comment.