Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimism kovan is deprecated, changed to goerli and fixed issues with transactions with eip 1559 updates. #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

<img width="1536" alt="Screenshot 2022-04-17 at 1 33 02 AM" src="https://user-images.githubusercontent.com/6984346/163969365-8130ed50-a6e5-4d9e-8b49-fbd7747b82b2.png">


εxgrasia is a procedurally generated on-chain backdrop where every tile is a player-made contract. Imagine an infinitely extensible minecraft or DayZ, where modding is **the** way to play the game. εxgrasia is an exploration in this sandbox direction.

# [✨ Watch the intro to εxgrasia here ✨](https://youtu.be/vifPHd7B4T0)
Expand All @@ -11,12 +10,11 @@ I highly recommend watching the video linked above before diving into this guide

<img width="1536" alt="image" src="https://user-images.githubusercontent.com/6984346/160905991-cb23280a-6610-4661-aefa-bb46814b4dd7.png">


## Getting Started

Get started by setting up [Optimism Kovan](https://www.optimism.io) for your wallet.
Get started by setting up [Optimism Goerli](https://www.optimism.io) for your wallet.

1. You can add Optimism Kovan to your wallet by visiting [this link](https://chainid.link/?network=optimism-kovan).
1. You can add Optimism Goerli to your wallet by visiting [this link](https://chainid.link/?network=optimism-goerli).
2. Next, fund your wallet with some test ETH using a [Faucet](https://faucet.paradigm.xyz). Fund the wallet that's whitelisted to play εxgrasia, we'll fund your proxy address during the new user flow later.
3. Next, follow through the new user flow on https://0xpark.exgrasia.xyz.

Expand Down
6 changes: 3 additions & 3 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@mui/material": "^5.4.4",
"@nextui-org/react": "^1.0.2-beta.4",
"@types/tinycolor2": "^1.4.3",
"@usedapp/core": "^0.11.0",
"@usedapp/core": "^1.2.2",
"@walletconnect/web3-provider": "^1.7.7",
"autoprefixer": "^10.4.4",
"big-integer": "^1.6.48",
Expand All @@ -39,9 +39,9 @@
"lint": "eslint .",
"format": "prettier --write .",
"start:dev": "webpack-dev-server --mode development --open --hot",
"start:prod": "NODE_ENV=production DEFAULT_RPC=wss://opt-kovan.g.alchemy.com/v2/Q7kdBHUHBBPNGjT2RkmXsYOzRBzxeC2g webpack-dev-server --mode development --open --hot",
"start:prod": "NODE_ENV=production DEFAULT_RPC=wss://opt-goerli.g.alchemy.com/v2/kyBsnVYwrSrjmp27kAcXsnGM4Q9meiHb webpack-dev-server --mode development --open --hot",
"start:prodXdai": "NODE_ENV=production DEFAULT_RPC=https://optimism.gnosischain.com webpack-dev-server --mode development --open --hot",
"build": "NODE_ENV=production DEFAULT_RPC=wss://opt-kovan.g.alchemy.com/v2/Q7kdBHUHBBPNGjT2RkmXsYOzRBzxeC2g webpack --mode production"
"build": "NODE_ENV=production DEFAULT_RPC=wss://opt-goerli.g.alchemy.com/v2/kyBsnVYwrSrjmp27kAcXsnGM4Q9meiHb webpack --mode production"
},
"browserslist": {
"production": [
Expand Down
2 changes: 1 addition & 1 deletion client/src/frontend/Pane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ function Plugins(props: { coords: WorldCoords; gm: GameManager; pm: PluginManage
);
}

const EXPLORER_BASE_URL = 'https://kovan-optimistic.etherscan.io/address/';
const EXPLORER_BASE_URL = 'https://goerli-optimistic.etherscan.io/address/';

function shortenAddress(addr: EthAddress) {
return addr.slice(0, 6) + '...' + addr.slice(-4);
Expand Down
28 changes: 15 additions & 13 deletions client/src/frontend/Splash.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { makeContractsAPI } from '../backend/ContractsAPI';
import { TinyWorldRegistry, TinyWorldRegistryFactory } from 'common-contracts/typechain';
import registryContractAbi from 'common-contracts/abis/TinyWorldRegistry.json';
import { Contract } from '@ethersproject/contracts';
import { Web3Provider } from '@ethersproject/providers';
import { BigNumber, ethers } from 'ethers';
import { Tooltip, useTheme, Text, Button, Link } from '@nextui-org/react';
import { SubTitle, Title } from './StyledComps';
Expand Down Expand Up @@ -92,16 +93,16 @@ export default function Splash() {

useEffect(() => {
console.log('account', account);
if (account && chainId == 69) setWhitelist(true);
if (account && chainId === 420) setWhitelist(true);
}, [account]);

useEffect(() => {
if (registryState.status != 'Success') return;
if (registryState.status !== 'Success') return;
transferSend({ to: proxyPubKey, value: ethers.utils.parseEther('0.2') });
}, [registryState.status]);

useEffect(() => {
if (transferState.status != 'Success') return;
if (transferState.status !== 'Success') return;
setNuxStepOneDone(true);
}, [transferState.status]);

Expand All @@ -121,10 +122,10 @@ export default function Splash() {
};

const getHumanisedStatus = (status: string) => {
if (status == 'PendingSignature') return '⏳ Waiting';
if (status == 'Mining') return '⛏️ Mining';
if (status == 'Success') return '✅ Successful';
if (status == 'Fail') return '❌ Failed';
if (status === 'PendingSignature') return '⏳ Waiting';
if (status === 'Mining') return '⛏️ Mining';
if (status === 'Success') return '✅ Successful';
if (status === 'Fail') return '❌ Failed';
else return '🤨 Unknown';
};

Expand Down Expand Up @@ -159,7 +160,7 @@ export default function Splash() {
};

useEffect(() => {
if (!library || !account) return;
if (!library || !account || !(library instanceof Web3Provider)) return;
const signer = library.getSigner();
signer.signMessage(entropyMessage).then((sig) => {
console.log('sig', sig);
Expand All @@ -174,9 +175,9 @@ export default function Splash() {
console.log('account', account);
const proxyAddress = await contractsApi.getProxyAddress(account);
console.log('proxyAddress', proxyAddress);
if (proxyAddress == nullAddress) {
if (proxyAddress === nullAddress) {
submitRegistry(pubKey);
} else if (proxyAddress.toLowerCase() != pubKey.toLowerCase()) {
} else if (proxyAddress.toLowerCase() !== pubKey.toLowerCase()) {
console.log('fucked up', pubKey, proxyAddress);
} else {
ethConnection.setAccount(privKey);
Expand Down Expand Up @@ -281,10 +282,10 @@ export default function Splash() {
<Link
color='text'
icon
href={'https://chainid.link/?network=optimism-kovan'}
href={'https://chainid.link/?network=optimism-goerli'}
target='_blank'
>
use optimism kovan
use optimism goerli
</Link>
</Text>
))}
Expand All @@ -293,7 +294,7 @@ export default function Splash() {
registryState.status
)}`}</Text>
)}
{whitelist && registryState.status == 'Success' && transferState && (
{whitelist && registryState.status === 'Success' && transferState && (
<Text h3 color='primary' size={42}>{`Funding: ${getHumanisedStatus(
transferState.status
)}`}</Text>
Expand All @@ -306,6 +307,7 @@ export default function Splash() {
href='https://twitter.com/exgrasia'
target='_blank'
style={{ textDecoration: 'none' }}
rel='noreferrer'
>
<span role='img' aria-label='bird'>
🐦
Expand Down
4 changes: 2 additions & 2 deletions client/src/frontend/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ const darkTheme = createTheme({
});

const config: Config = {
readOnlyChainId: 69,
readOnlyChainId: 420,
readOnlyUrls: {
[69]: 'https://kovan.optimism.io',
[420]: 'https://goerli.optimism.io',
},
};

Expand Down
8 changes: 4 additions & 4 deletions eth/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ const mainnet = {
chainId: 1,
};

const optimismKovan = {
url: 'https://kovan.optimism.io',
const optimismGoerli = {
url: 'https://goerli.optimism.io',
accounts: [DEPLOYER_PK!],
chainId: 69,
chainId: 420,
};

const optimismXdai = {
Expand All @@ -81,7 +81,7 @@ const config: HardhatUserConfig = {
// > Error HH100: Network xdai doesn't exist
...(DEPLOYER_MNEMONIC ? { xdai } : undefined),
...(DEPLOYER_MNEMONIC ? { mainnet } : undefined),
...(DEPLOYER_PK ? { optimismKovan } : undefined),
...(DEPLOYER_PK ? { optimismGoerli } : undefined),
...(DEPLOYER_PK ? { optimismXdai } : undefined),
localhost: {
url: 'http://localhost:8545/',
Expand Down
2 changes: 1 addition & 1 deletion eth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"format": "prettier --write .",
"hardhat:node": "hardhat node --hostname 0.0.0.0",
"hardhat:dev": "hardhat --network localhost",
"hardhat:optimism": "hardhat --network optimismKovan",
"hardhat:optimism": "hardhat --network optimismGoerli",
"hardhat:optimismXdai": "hardhat --network optimismXdai",
"hardhat:xdai": "hardhat --network xdai",
"hardhat:mainnet": "hardhat --network mainnet"
Expand Down
44 changes: 22 additions & 22 deletions packages/contracts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,43 +21,43 @@
/**
* The name of the network where these contracts are deployed.
*/
export const NETWORK = 'optimismKovan';
export const NETWORK = 'localhost';
/**
* The id of the network where these contracts are deployed.
*/
export const NETWORK_ID = 69;
export const NETWORK_ID = 31337;
/**
* The block in which the TinyWorld contract was deployed.
*/
export const START_BLOCK = 2113499;
export const START_BLOCK = 0;
/**
* The address for the TinyWorld contract.
*/
export const CORE_CONTRACT_ADDRESS = '0x0583f380BDa6C1b97029BF1a95C757329b5Ba3B3';
export const CORE_CONTRACT_ADDRESS = '0x627a72bbE16416Ae722BA05876C5cB2dcb0Dc6BB';
/**
* The address for the TinyWorldGetters contract.
*/
export const GETTERS_CONTRACT_ADDRESS = '0xDE53bEAC1A2e825F3F1c1A775Be837b48e874617';
export const GETTERS_CONTRACT_ADDRESS = '0x6c452936A27F5Afc41bCC9Dd49a5bdedBdfA9b7A';
/**
* The address for the TinyWorldRegistry contract.
*/
export const REGISTRY_CONTRACT_ADDRESS = '0x2510b00a0c9E66e711b435903EbF4aa2f5271768';
export const REGISTRY_CONTRACT_ADDRESS = '0xA1cf9870677Bb213991DDdE342a5CE412c0f676D';
/**
* The addresses for the Tile contracts.
*/
export const TESTING_CONTRACT_ADDRESS = '0x20Cd2d6922376441124C364DCD952fEc1b397e2e';
export const FISHING_CONTRACT_ADDRESS = '0x4d9CB454F98a503a0AC8a1d7Fa4370BE2c6BD8D9';
export const OPENSEA_MARKET_CONTRACT_ADDRESS = '0x2fcBC3805cb83cA5C9EFC482970F85eaa8378CFB';
export const FARM_CONTRACT_ADDRESS = '0x4e73612996AEB2901c3Bca2F17e7c3Ae05673b9c';
export const WHEAT_CONTRACT_ADDRESS = '0xe454394D204e0F1fd43055eE5148CE5DB787528B';
export const CORN_CONTRACT_ADDRESS = '0x66E2Ff0147F8548529f6D347C7cCEcBEd84f8278';
export const CACTUS_CONTRACT_ADDRESS = '0x28B78e4B8A9C9E67013eF8002194e0e450C0b6Aa';
export const RANCH_CONTRACT_ADDRESS = '0x9dCFae1be36E626263E5849F8a9Cbb7f5cfAac83';
export const MILK_CONTRACT_ADDRESS = '0xC5acB3A46431c4D40C08b40B5e515C53694A9129';
export const EGG_CONTRACT_ADDRESS = '0xA646DBA2f6547dbbB1F6eb9710Ef32B5F9885172';
export const MINE_CONTRACT_ADDRESS = '0xbf4Eee8Ac3D8043d6c9265f712f401294679e2aE';
export const IRON_CONTRACT_ADDRESS = '0x18d13d255733FbDef2C6476ff26d649eA8Efb9d5';
export const GOLD_CONTRACT_ADDRESS = '0xFCbe4a15bcF11895912b4Db7430157b249Dd2c1d';
export const DIAMOND_CONTRACT_ADDRESS = '0x8679B849D8eB1BFe1D7221BC136e81AE21065a69';
export const QUEST_MASTER_CONTRACT_ADDRESS = '0xbcc720EA89EB5e98a5aa2952D6587c199b834529';
export const CAMPFIRE_CONTRACT_ADDRESS = '0x7a0A41d987d4a09E86665Ebf990A6F876d3c1eC6';
export const TESTING_CONTRACT_ADDRESS = '0x8950bab77f29E8f81e6F78AEA0a79bADD88Eeb13';
export const FISHING_CONTRACT_ADDRESS = '0x500cf53555c09948f4345594F9523E7B444cD67E';
export const OPENSEA_MARKET_CONTRACT_ADDRESS = '0xc2EEd1AdAAe36B640f64c06FeF8Cd32F7473afAA';
export const FARM_CONTRACT_ADDRESS = '0xBa82512922EDF35F6Fba9E652D822C8D02949888';
export const WHEAT_CONTRACT_ADDRESS = '0x9CB0512B187572e2f37E27b61AD5a094D052547b';
export const CORN_CONTRACT_ADDRESS = '0x6203D5f56880b20B70edF9111013d9f9c232acca';
export const CACTUS_CONTRACT_ADDRESS = '0xF416b79370DfE754911923b2ceCdf387B3Fc35a5';
export const RANCH_CONTRACT_ADDRESS = '0x9696B08d71d3cBE15Fea4Da48B34a3b6576cCA16';
export const MILK_CONTRACT_ADDRESS = '0x2dbaC998318f8F8Cc6Ce1Bd5b533b8bea7C46Aed';
export const EGG_CONTRACT_ADDRESS = '0x70aA633cD6eC4236EeC52FeA8f97006093B401BD';
export const MINE_CONTRACT_ADDRESS = '0x6A88Da94d58973C8e69F533cb0CeDb6425551387';
export const IRON_CONTRACT_ADDRESS = '0x04064F99884045C74B263c341620458b7431631d';
export const GOLD_CONTRACT_ADDRESS = '0x75Feae7dD8c3D3cE471Bc09f32805641b0e8A6C4';
export const DIAMOND_CONTRACT_ADDRESS = '0x66ceEA07bcd0b7Cf9299EA7AD5814186530f293A';
export const QUEST_MASTER_CONTRACT_ADDRESS = '0x036df361724a9FFE7409FbAF1be983fAeE0a0a2d';
export const CAMPFIRE_CONTRACT_ADDRESS = '0x8bFe976461F9D6a3A34be5025EAC343A5a2e124D';
7 changes: 1 addition & 6 deletions packages/network/src/TxExecutor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ export class TxExecutor {
overrides: providers.TransactionRequest = {
gasPrice: undefined,
gasLimit: 15000000,
maxPriorityFeePerGas: 100_000_000,
}
): PendingTransaction {
this.diagnosticsUpdater?.updateDiagnostics((d) => {
Expand Down Expand Up @@ -222,12 +223,6 @@ export class TxExecutor {
onTransactionReceipt: txReceipt,
};

if (overrides.gasPrice === undefined) {
txRequest.overrides.gasPrice = gweiToWei(
this.ethConnection.getAutoGasPriceGwei(this.ethConnection.getAutoGasPrices())
);
}

this.queue.add(() => {
this.diagnosticsUpdater?.updateDiagnostics((d) => {
d.transactionsInQueue--;
Expand Down
4 changes: 2 additions & 2 deletions scripts/post-deploy-tasks.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
npx hardhat --network optimismKovan whitelist:questMaster 0x8bFe976461F9D6a3A34be5025EAC343A5a2e124D
npx hardhat --network optimismKovan whitelist:contracts
npx hardhat --network optimismGoerli whitelist:questMaster 0x8bFe976461F9D6a3A34be5025EAC343A5a2e124D
npx hardhat --network optimismGoerli whitelist:contracts
Loading