Stop sharing code and just make copies of contract addresses json
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 27s Details

This commit is contained in:
Ladd Hoffman 2024-03-17 13:35:51 -05:00
parent 14d80bf1d5
commit 4674a184ce
8 changed files with 20 additions and 21 deletions

View File

@ -10,7 +10,6 @@
"preview": "vite preview"
},
"dependencies": {
"contract-config": "file://../contract-config",
"@metamask/sdk-react": "^0.16.0",
"@tanstack/react-table": "^8.13.2",
"axios": "^1.6.7",

View File

@ -1,7 +1,7 @@
{
"localhost": {
"DAO": "0xfc7E3bdF321821fF045Dde1586909AbBCC8D5d44",
"Work1": "0x89D456aF8A192B3D305007E1e94bFC2153Ead86B"
"DAO": "0x74DD88A13804003bDD1EBB41ebEE47EA145B8E46",
"Work1": "0x0bB2b52F9E4068E99038E0A9B86D337461926F17"
},
"sepolia": {
"DAO": "0xA4Cb4d99be0Fef3e59dCaE909D6E8ef46EF07257",

View File

@ -1,4 +1,4 @@
import contractAddresses from 'contract-config/addresses.json';
import contractAddresses from './contract-addresses.json';
const networks = {
localhost: '0x539',

View File

@ -1,11 +0,0 @@
{
"name": "contract-config",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}

View File

@ -0,0 +1,10 @@
{
"localhost": {
"DAO": "0x74DD88A13804003bDD1EBB41ebEE47EA145B8E46",
"Work1": "0x0bB2b52F9E4068E99038E0A9B86D337461926F17"
},
"sepolia": {
"DAO": "0xA4Cb4d99be0Fef3e59dCaE909D6E8ef46EF07257",
"Work1": "0xdB3b37B555c980617140C8d8687a19B8381F374d"
}
}

View File

@ -13,7 +13,6 @@
"author": "",
"license": "ISC",
"devDependencies": {
"contract-config": "file://../contract-config",
"@nomicfoundation/hardhat-chai-matchers": "^2.0.6",
"@nomicfoundation/hardhat-toolbox": "^4.0.0",
"@nomicfoundation/hardhat-verify": "^2.0.5",

View File

@ -1,4 +1,4 @@
const contractAddresses = require('contract-config/addresses.json');
const contractAddresses = require('../contract-addresses.json');
const networks = {
localhost: '0x539',

View File

@ -1,9 +1,8 @@
const { ethers } = require('hardhat');
const fs = require('fs');
const contractAddresses = require('contract-config/addresses.json');
const contractAddresses = require('../contract-addresses.json');
const contractAddressesWritePath = '../contract-config/addresses.json';
const network = process.env.HARDHAT_NETWORK;
async function main() {
@ -20,8 +19,11 @@ async function main() {
console.log(`Work1 deployed to ${work1.target}`);
contractAddresses[network].Work1 = work1.target;
fs.writeFileSync(contractAddressesWritePath, JSON.stringify(contractAddresses, null, 2));
console.log('Wrote file', fs.realpathSync(contractAddressesWritePath));
fs.writeFileSync('../client/src/contract-addresses.json', JSON.stringify(contractAddresses, null, 2));
console.log('Wrote file', fs.realpathSync('../client/src/contract-addresses.json'));
fs.writeFileSync('./contract-addresses.json', JSON.stringify(contractAddresses, null, 2));
console.log('Wrote file', fs.realpathSync('./contract-addresses.json'));
fs.copyFileSync('./artifacts/contracts/DAO.sol/DAO.json', '../client/src/assets/DAO.json');
fs.copyFileSync('./artifacts/contracts/Work1.sol/Work1.json', '../client/src/assets/Work1.json');