Skip to content
This repository has been archived by the owner on Jan 29, 2025. It is now read-only.

Commit

Permalink
Merge pull request #27 from layerswap/main-dev
Browse files Browse the repository at this point in the history
Main dev
  • Loading branch information
arkoc authored Dec 3, 2024
2 parents cc092be + 54fa373 commit 0200c44
Show file tree
Hide file tree
Showing 11 changed files with 8,626 additions and 709 deletions.
818 changes: 442 additions & 376 deletions chains/evm/solidity/contracts/HashedTimeLockERC20.sol

Large diffs are not rendered by default.

710 changes: 408 additions & 302 deletions chains/evm/solidity/contracts/HashedTimeLockEther.sol

Large diffs are not rendered by default.

73 changes: 49 additions & 24 deletions chains/evm/solidity/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,63 +13,88 @@ module.exports = {
},
},
networks: {
kakarotSepolia: {
mantleSepolia: {
url: 'https://endpoints.omniatech.io/v1/mantle/sepolia/public',
accounts: [process.env.PRIV_KEY],
},
berachain: {
url: 'https://bartio.rpc.berachain.com/',
accounts: [process.env.PRIV_KEY],
},
kakarot_sepolia: {
url: 'https://sepolia-rpc.kakarot.org',
accounts: ['e9ac8d073f52df4c776f16915460806dc5c28c9bc9b510ad074c275c8cff89e9'],
accounts: [process.env.PRIV_KEY],
},
unichainSepolia: {
url: 'https://sepolia.unichain.org',
accounts: ['e9ac8d073f52df4c776f16915460806dc5c28c9bc9b510ad074c275c8cff89e9'],
accounts: [process.env.PRIV_KEY],
},
arbitrumSepolia: {
url: 'https://arbitrum-sepolia.drpc.org',
accounts: ['e9ac8d073f52df4c776f16915460806dc5c28c9bc9b510ad074c275c8cff89e9'],
url: 'https://arbitrum-sepolia.infura.io/v3/2d3e18b5f66f40df8d5df3d990d6d941',
accounts: [process.env.PRIV_KEY],
},
sepolia: {
url: `https://sepolia.infura.io/v3/775081a490784e709d3457ed0e413b21`,
accounts: ['e9ac8d073f52df4c776f16915460806dc5c28c9bc9b510ad074c275c8cff89e9'],
accounts: [process.env.PRIV_KEY],
},
lineaSepolia: {
url: "https://rpc.sepolia.linea.build",
accounts: ['e9ac8d073f52df4c776f16915460806dc5c28c9bc9b510ad074c275c8cff89e9'],
accounts: [process.env.PRIV_KEY],
chainId: 59141,
},
optimismSepolia: {
url: "https://sepolia.optimism.io",
accounts: ['e9ac8d073f52df4c776f16915460806dc5c28c9bc9b510ad074c275c8cff89e9'],
accounts: [process.env.PRIV_KEY],
chainId: 11155420,
},
taikoHekla: {
url: "https://rpc.hekla.taiko.xyz.",
accounts: ['e9ac8d073f52df4c776f16915460806dc5c28c9bc9b510ad074c275c8cff89e9'],
accounts: [process.env.PRIV_KEY],
chainId: 167009,
},
immutableTestnet: {
url: "https://rpc.testnet.immutable.com",
accounts: ['e9ac8d073f52df4c776f16915460806dc5c28c9bc9b510ad074c275c8cff89e9'],
accounts: [process.env.PRIV_KEY],
chainId: 13473,
},
minato: {
url: 'https://rpc.minato.soneium.org/',
accounts: ['e9ac8d073f52df4c776f16915460806dc5c28c9bc9b510ad074c275c8cff89e9'],
accounts: [process.env.PRIV_KEY],
},
},
etherscan: {
apiKey: {
unichainSepolia: "Q7JD6R5A6S8B3KXIZFS5NBP13MJI9C74YH",
immutableTestnet: "pk_imapik-test-$JSr2xVyP--QDkeRDm@t",
optimismSepolia: "UM3DM9U5BE55IYGI656ET7VWI5PZJEHIS3",
lineaSepolia: "KRPGHKNVEKJVSA3NG8XGMAAS3ZQIZYFKNV",
taikoHekla: "XTMX6XTKPD8VCWD58AEPEKYTQB6QW5W1T8",
arbitrumSepolia: "J3J5B7TVWIDGV5236BHRGAUD9YJV5T33AH",
sepolia: "Q7JD6R5A6S8B3KXIZFS5NBP13MJI9C74YH",
kakarotSepolia: "kakarot_sepolia",
minato: "empty",
sepolia: "Q7JD6R5A6S8B3KXIZFS5NBP13MJI9C74YH"
berachain: process.env.berachain,
unichainSepolia: process.env.unichainSepolia,
immutableTestnet: process.env.immutableTestnet,
optimismSepolia: process.env.optimismSepolia,
lineaSepolia: process.env.lineaSepolia,
taikoHekla: process.env.taikoHekla,
arbitrumSepolia: process.env.arbitrumSepolia,
minato: process.env.minato,
sepolia: process.env.sepolia,
kakarot_sepolia: process.env.kakarotSepolia,
mantleSepolia: process.env.mantleSepolia,
},
customChains: [
{
network: "unicahinSepolia",
network: "mantleSepolia",
chainId: 5003,
urls: {
apiURL: "https://api-sepolia.mantlescan.xyz/api",
browserURL: "https://sepolia.mantlescan.xyz/",
},
},
{
network: "berachain",
chainId: 80084,
urls: {
apiURL: "https://api.routescan.io/v2/network/testnet/evm/80084/etherscan/api/",
browserURL: "https://bartio.beratrail.io/",
},
},
{
network: "unichainSepolia",
chainId: 1301,
urls: {
apiURL: "https://sepolia.uniscan.xyz/api",
Expand Down Expand Up @@ -118,9 +143,9 @@ module.exports = {
},
{
network: "kakarot_sepolia",
chainId: 1802203764_2,
chainId: 920637907288165,
urls: {
apiURL: "https://api.routescan.io/v2/network/testnet/evm/1802203764_2/etherscan",
apiURL: "https://api.routescan.io/v2/network/testnet/evm/920637907288165/etherscan",
browserURL: "https://sepolia.kakarotscan.org"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ async function signHTLC() {
name: "LayerswapV8",
version: "1",
chainId: 11155111,
verifyingContract: "0x4a403b55fe7348df85182abbd00402d7442e0af2",
verifyingContract: "0x89a21B772dD0Ec4a118d0823C5dD0C87dDbC5749",
salt: "0x2e4ff7169d640efc0d28f2e302a56f1cf54aff7e127eededda94b3df0946f5c0"
};

// Use ethers.js to encode the domain and compute the domain separator
const domainSeparator = ethers.keccak256(
ethers.AbiCoder.defaultAbiCoder().encode(
['bytes32', 'bytes32', 'bytes32', 'uint256', 'address', 'bytes32'],
Expand All @@ -31,17 +30,17 @@ async function signHTLC() {
addLockMsg: [
{ name: "Id", type: "bytes32" },
{ name: "hashlock", type: "bytes32" },
{ name: "timelock", type: "uint256" },
{ name: "timelock", type: "uint48" },
],
};

const message = {
Id: "0x0072c2bb6f8417f7d8b7cfbeb95db2feb17d2d22f0c2801fec1684025d1059af",
hashlock: "0xddfafe7925d46e633decb4cb3c933b4c2f7d56679487f4b88ea3e6422eb2b81c",
timelock: 1729861884,
Id: "0x3e958a2cdd5d2a505c622a0b16149cfc44e5526c7b89fd8d14850b3cb2366e56",
hashlock: "0x3b7674662e6569056cef73dab8b7809085a32beda0e8eb9e9b580cfc2af22a55",
timelock: 1733139766,
};

const privateKey = 'e9ac8d073f52df4c776f16915460806dc5c28c9bc9b510ad074c275c8cff89e9';
const privateKey = process.env.PRIV_KEY;
const wallet = new ethers.Wallet(privateKey);

const signature = await wallet.signTypedData(domain, types, message);
Expand Down
21 changes: 21 additions & 0 deletions discovery/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
node_modules
.env

# Hardhat files
/cache
/artifacts

# TypeChain files
/typechain
/typechain-types

# solidity-coverage files
/coverage
/coverage.json

# Hardhat Ignition default folder for deployments against a local node
ignition/deployments/chain-31337


test
ignition
13 changes: 13 additions & 0 deletions discovery/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Sample Hardhat Project

This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, and a Hardhat Ignition module that deploys that contract.

Try running some of the following tasks:

```shell
npx hardhat help
npx hardhat test
REPORT_GAS=true npx hardhat test
npx hardhat node
npx hardhat ignition deploy ./ignition/modules/Lock.js
```
Loading

0 comments on commit 0200c44

Please sign in to comment.