Publish utils, core, apps, sdk, and deploy packages (#329)

pull/340/head
Asa Oines 3 years ago committed by GitHub
parent e364d4d741
commit 9592b28489
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 64
      package-lock.json
  2. 8
      solidity/apps/package.json
  3. 4
      solidity/core/package.json
  4. 3
      solidity/core/test/inbox.test.ts
  5. 1
      solidity/core/test/index.ts
  6. 4
      solidity/core/test/lib/AbacusDeployment.ts
  7. 4
      solidity/core/test/validatorManager.test.ts
  8. 2
      typescript/contract-metrics/package.json
  9. 6
      typescript/deploy/package.json
  10. 6
      typescript/hardhat/package.json
  11. 3
      typescript/hardhat/src/TestAbacusDeploy.ts
  12. 2
      typescript/infra/package.json
  13. 8
      typescript/sdk/package.json
  14. 5
      typescript/utils/.prettierrc
  15. 1
      typescript/utils/index.ts
  16. 2
      typescript/utils/package.json
  17. 4
      typescript/utils/src/types.ts
  18. 26
      typescript/utils/src/utils.ts
  19. 0
      typescript/utils/src/validator.ts

64
package-lock.json generated

@ -24855,12 +24855,12 @@
},
"solidity/apps": {
"name": "@abacus-network/apps",
"version": "0.0.0",
"version": "0.0.1",
"license": "MIT OR Apache-2.0",
"dependencies": {
"@abacus-network/core": "file:../core",
"@abacus-network/hardhat": "^0.0.5",
"@abacus-network/utils": "^0.0.5",
"@abacus-network/core": "^0.0.3",
"@abacus-network/hardhat": "^0.0.8",
"@abacus-network/utils": "^0.0.7",
"@openzeppelin/contracts": "~3.4.2",
"@openzeppelin/contracts-upgradeable": "~3.4.2",
"@summa-tx/memview-sol": "^2.0.0"
@ -24889,10 +24889,10 @@
},
"solidity/core": {
"name": "@abacus-network/core",
"version": "0.0.1",
"version": "0.0.3",
"license": "MIT OR Apache-2.0",
"dependencies": {
"@abacus-network/utils": "^0.0.5",
"@abacus-network/utils": "^0.0.7",
"@openzeppelin/contracts": "^3.4.2",
"@openzeppelin/contracts-upgradeable": "~3.4.2",
"@summa-tx/memview-sol": "^2.0.0",
@ -24984,7 +24984,7 @@
"version": "0.0.0",
"dependencies": {
"@abacus-network/apps": "file:../../solidity/apps",
"@abacus-network/sdk": "^0.0.1",
"@abacus-network/sdk": "file:../sdk",
"@types/bunyan": "^1.8.7",
"@types/express": "^4.17.13",
"@types/google-spreadsheet": "^3.1.5",
@ -25017,11 +25017,11 @@
},
"typescript/deploy": {
"name": "@abacus-network/deploy",
"version": "0.0.5",
"version": "0.0.6",
"license": "MIT OR Apache-2.0",
"dependencies": {
"@abacus-network/core": "file:../../solidity/core",
"@abacus-network/sdk": "^0.0.1",
"@abacus-network/core": "^0.0.3",
"@abacus-network/sdk": "^0.0.3",
"@types/node": "^16.9.1",
"axios": "^0.21.3"
},
@ -25040,11 +25040,11 @@
},
"typescript/hardhat": {
"name": "@abacus-network/hardhat",
"version": "0.0.5",
"version": "0.0.8",
"license": "MIT OR Apache-2.0",
"dependencies": {
"@abacus-network/core": "file:../../solidity/core",
"@abacus-network/utils": "^0.0.5",
"@abacus-network/core": "^0.0.3",
"@abacus-network/utils": "^0.0.7",
"@nomiclabs/hardhat-ethers": "^2.0.5",
"@nomiclabs/hardhat-waffle": "^2.0.2",
"@typechain/hardhat": "^2.0.1",
@ -25063,7 +25063,7 @@
"@abacus-network/apps": "file:../../solidity/apps",
"@abacus-network/core": "file:../../solidity/core",
"@abacus-network/deploy": "file:../deploy",
"@abacus-network/sdk": "^0.0.1",
"@abacus-network/sdk": "file:../sdk",
"@aws-sdk/client-kms": "3.48.0",
"@ethersproject/experimental": "^5.3.0",
"@nomiclabs/hardhat-etherscan": "^3.0.3",
@ -25097,12 +25097,12 @@
},
"typescript/sdk": {
"name": "@abacus-network/sdk",
"version": "0.0.1",
"version": "0.0.3",
"license": "MIT OR Apache-2.0",
"dependencies": {
"@abacus-network/apps": "file:../../solidity/apps",
"@abacus-network/core": "file:../../solidity/core",
"@abacus-network/utils": "file:../utils",
"@abacus-network/apps": "^0.0.1",
"@abacus-network/core": "^0.0.3",
"@abacus-network/utils": "^0.0.7",
"@ethersproject/bignumber": "^5.5.0",
"@ethersproject/bytes": "^5.5.0",
"celo-ethers-provider": "0.0.0",
@ -25128,7 +25128,7 @@
},
"typescript/utils": {
"name": "@abacus-network/utils",
"version": "0.0.5",
"version": "0.0.7",
"license": "MIT OR Apache-2.0",
"dependencies": {
"chai": "^4.3.0",
@ -25140,9 +25140,9 @@
"@abacus-network/apps": {
"version": "file:solidity/apps",
"requires": {
"@abacus-network/core": "file:../core",
"@abacus-network/hardhat": "^0.0.5",
"@abacus-network/utils": "^0.0.5",
"@abacus-network/core": "^0.0.3",
"@abacus-network/hardhat": "^0.0.8",
"@abacus-network/utils": "^0.0.7",
"@nomiclabs/hardhat-ethers": "^2.0.1",
"@nomiclabs/hardhat-waffle": "^2.0.1",
"@openzeppelin/contracts": "~3.4.2",
@ -25171,7 +25171,7 @@
"version": "file:typescript/contract-metrics",
"requires": {
"@abacus-network/apps": "file:../../solidity/apps",
"@abacus-network/sdk": "^0.0.1",
"@abacus-network/sdk": "file:../sdk",
"@types/bunyan": "^1.8.7",
"@types/express": "^4.17.13",
"@types/google-spreadsheet": "^3.1.5",
@ -25204,7 +25204,7 @@
"@abacus-network/core": {
"version": "file:solidity/core",
"requires": {
"@abacus-network/utils": "^0.0.5",
"@abacus-network/utils": "^0.0.7",
"@nomiclabs/hardhat-ethers": "^2.0.1",
"@nomiclabs/hardhat-waffle": "^2.0.1",
"@openzeppelin/contracts": "^3.4.2",
@ -25231,8 +25231,8 @@
"@abacus-network/deploy": {
"version": "file:typescript/deploy",
"requires": {
"@abacus-network/core": "file:../../solidity/core",
"@abacus-network/sdk": "^0.0.1",
"@abacus-network/core": "^0.0.3",
"@abacus-network/sdk": "^0.0.3",
"@typechain/ethers-v5": "~7.0.0",
"@types/node": "^16.9.1",
"axios": "^0.21.3",
@ -25252,8 +25252,8 @@
"@abacus-network/hardhat": {
"version": "file:typescript/hardhat",
"requires": {
"@abacus-network/core": "file:../../solidity/core",
"@abacus-network/utils": "^0.0.5",
"@abacus-network/core": "^0.0.3",
"@abacus-network/utils": "^0.0.7",
"@nomiclabs/hardhat-ethers": "^2.0.5",
"@nomiclabs/hardhat-waffle": "^2.0.2",
"@typechain/hardhat": "^2.0.1",
@ -25269,9 +25269,9 @@
"@abacus-network/sdk": {
"version": "file:typescript/sdk",
"requires": {
"@abacus-network/apps": "file:../../solidity/apps",
"@abacus-network/core": "file:../../solidity/core",
"@abacus-network/utils": "file:../utils",
"@abacus-network/apps": "^0.0.1",
"@abacus-network/core": "^0.0.3",
"@abacus-network/utils": "^0.0.7",
"@ethersproject/bignumber": "^5.5.0",
"@ethersproject/bytes": "^5.5.0",
"@types/node": "^16.9.1",
@ -38219,7 +38219,7 @@
"@abacus-network/apps": "file:../../solidity/apps",
"@abacus-network/core": "file:../../solidity/core",
"@abacus-network/deploy": "file:../deploy",
"@abacus-network/sdk": "^0.0.1",
"@abacus-network/sdk": "file:../sdk",
"@aws-sdk/client-kms": "3.48.0",
"@ethersproject/experimental": "^5.3.0",
"@nomiclabs/hardhat-ethers": "^2.0.5",

@ -21,7 +21,7 @@
"typechain": "^5.0.0",
"typescript": "^4.3.5"
},
"version": "0.0.0",
"version": "0.0.1",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"directories": {
@ -36,9 +36,9 @@
},
"license": "MIT OR Apache-2.0",
"dependencies": {
"@abacus-network/core": "file:../core",
"@abacus-network/hardhat": "^0.0.5",
"@abacus-network/utils": "^0.0.5",
"@abacus-network/core": "^0.0.3",
"@abacus-network/hardhat": "^0.0.8",
"@abacus-network/utils": "^0.0.7",
"@openzeppelin/contracts": "~3.4.2",
"@openzeppelin/contracts-upgradeable": "~3.4.2",
"@summa-tx/memview-sol": "^2.0.0"

@ -19,7 +19,7 @@
"ts-node": "^10.1.0",
"typechain": "^5.0.0"
},
"version": "0.0.1",
"version": "0.0.3",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"directories": {
@ -34,7 +34,7 @@
},
"license": "MIT OR Apache-2.0",
"dependencies": {
"@abacus-network/utils": "^0.0.5",
"@abacus-network/utils": "^0.0.7",
"@openzeppelin/contracts": "^3.4.2",
"@openzeppelin/contracts-upgradeable": "~3.4.2",
"@summa-tx/memview-sol": "^2.0.0",

@ -1,8 +1,7 @@
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers';
import { ethers } from 'hardhat';
import { expect } from 'chai';
import { types, utils } from '@abacus-network/utils';
import { Validator } from './lib/core';
import { types, utils, Validator } from '@abacus-network/utils';
import {
BadRecipient1__factory,
BadRecipient3__factory,

@ -1,2 +1 @@
export * as core from './lib/core';
export { AbacusDeployment } from './lib/AbacusDeployment';

@ -1,8 +1,6 @@
import { assert } from 'chai';
import * as ethers from 'ethers';
import { types } from '@abacus-network/utils';
import { Validator } from './core';
import { types, Validator } from '@abacus-network/utils';
import {
TestOutbox,

@ -1,10 +1,8 @@
import { ethers } from 'hardhat';
import { expect } from 'chai';
import { types, utils } from '@abacus-network/utils';
import { types, utils, Validator } from '@abacus-network/utils';
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers';
import { Validator } from './lib/core';
import {
Outbox__factory,
Outbox,

@ -13,7 +13,7 @@
},
"dependencies": {
"@abacus-network/apps": "file:../../solidity/apps",
"@abacus-network/sdk": "^0.0.1",
"@abacus-network/sdk": "file:../sdk",
"@types/bunyan": "^1.8.7",
"@types/express": "^4.17.13",
"@types/google-spreadsheet": "^3.1.5",

@ -8,7 +8,7 @@
},
"prepublish": "npm run build",
"name": "@abacus-network/deploy",
"version": "0.0.5",
"version": "0.0.6",
"description": "Abacus deploy tools",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
@ -19,8 +19,8 @@
},
"license": "MIT OR Apache-2.0",
"dependencies": {
"@abacus-network/core": "file:../../solidity/core",
"@abacus-network/sdk": "^0.0.1",
"@abacus-network/core": "^0.0.3",
"@abacus-network/sdk": "^0.0.3",
"@types/node": "^16.9.1",
"axios": "^0.21.3"
}

@ -1,7 +1,7 @@
{
"prepublish": "npm run build",
"name": "@abacus-network/hardhat",
"version": "0.0.5",
"version": "0.0.8",
"description": "Abacus hardhat tools",
"main": "dist/index.js",
"types": "dist/index.d.ts",
@ -12,8 +12,8 @@
},
"license": "MIT OR Apache-2.0",
"dependencies": {
"@abacus-network/core": "file:../../solidity/core",
"@abacus-network/utils": "^0.0.5",
"@abacus-network/core": "^0.0.3",
"@abacus-network/utils": "^0.0.7",
"@nomiclabs/hardhat-ethers": "^2.0.5",
"@nomiclabs/hardhat-waffle": "^2.0.2",
"@typechain/hardhat": "^2.0.1",

@ -1,5 +1,5 @@
import { ethers } from "ethers";
import { types } from "@abacus-network/utils";
import { types, Validator } from "@abacus-network/utils";
import {
Outbox,
Outbox__factory,
@ -14,7 +14,6 @@ import {
TestInbox,
TestInbox__factory,
} from "@abacus-network/core";
import { Validator } from "@abacus-network/core/test/lib/core";
import { TestDeploy } from "./TestDeploy";
export type TestAbacusConfig = {

@ -28,7 +28,7 @@
"@abacus-network/apps": "file:../../solidity/apps",
"@abacus-network/core": "file:../../solidity/core",
"@abacus-network/deploy": "file:../deploy",
"@abacus-network/sdk": "^0.0.1",
"@abacus-network/sdk": "file:../sdk",
"@aws-sdk/client-kms": "3.48.0",
"@ethersproject/experimental": "^5.3.0",
"@nomiclabs/hardhat-etherscan": "^3.0.3",

@ -1,6 +1,6 @@
{
"name": "@abacus-network/sdk",
"version": "0.0.1",
"version": "0.0.3",
"description": "Abacus Network SDK",
"main": "dist/index.js",
"types": "dist/index.d.ts",
@ -23,9 +23,9 @@
"typescript": "^4.4.3"
},
"dependencies": {
"@abacus-network/apps": "file:../../solidity/apps",
"@abacus-network/core": "file:../../solidity/core",
"@abacus-network/utils": "file:../utils",
"@abacus-network/apps": "^0.0.1",
"@abacus-network/core": "^0.0.3",
"@abacus-network/utils": "^0.0.7",
"@ethersproject/bignumber": "^5.5.0",
"@ethersproject/bytes": "^5.5.0",
"celo-ethers-provider": "0.0.0",

@ -0,0 +1,5 @@
{
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "all"
}

@ -1,2 +1,3 @@
export * as types from './src/types'
export * as utils from './src/utils'
export { Validator } from './src/validator'

@ -1,7 +1,7 @@
{
"prepublish": "npm run build",
"name": "@abacus-network/utils",
"version": "0.0.5",
"version": "0.0.7",
"description": "Abacus utilities",
"main": "dist/index.js",
"types": "dist/index.d.ts",

@ -1,4 +1,4 @@
import { BytesLike } from "ethers";
import { BytesLike } from 'ethers';
/********* BASIC TYPES *********/
export type Domain = number;
@ -37,7 +37,7 @@ export type BytesArray = [
BytesLike,
BytesLike,
BytesLike,
BytesLike
BytesLike,
];
/********* ABACUS CORE *********/

@ -1,6 +1,6 @@
import { assert } from "chai";
import { ethers } from "ethers";
import { Domain, Address, HexString } from "./types";
import { assert } from 'chai';
import { ethers } from 'ethers';
import { Domain, Address, HexString } from './types';
/*
* Gets the byte length of a hex string
@ -12,7 +12,7 @@ export function getHexStringByteLength(hexStr: string) {
let len = hexStr.length;
// check for prefix, remove if necessary
if (hexStr.slice(0, 2) == "0x") {
if (hexStr.slice(0, 2) == '0x') {
len -= 2;
}
@ -21,11 +21,11 @@ export function getHexStringByteLength(hexStr: string) {
}
export const stringToBytes32 = (s: string): string => {
const str = Buffer.from(s.slice(0, 32), "utf-8");
const str = Buffer.from(s.slice(0, 32), 'utf-8');
const result = Buffer.alloc(32);
str.copy(result);
return "0x" + result.toString("hex");
return '0x' + result.toString('hex');
};
export function addressToBytes32(address: Address): string {
@ -40,24 +40,24 @@ export const formatMessage = (
sequence: number,
destinationDomain: Domain,
recipientAddr: Address,
body: HexString
body: HexString,
): string => {
senderAddr = addressToBytes32(senderAddr);
recipientAddr = addressToBytes32(recipientAddr);
return ethers.utils.solidityPack(
["uint32", "bytes32", "uint32", "uint32", "bytes32", "bytes"],
[localDomain, senderAddr, sequence, destinationDomain, recipientAddr, body]
['uint32', 'bytes32', 'uint32', 'uint32', 'bytes32', 'bytes'],
[localDomain, senderAddr, sequence, destinationDomain, recipientAddr, body],
);
};
export function messageHash(message: HexString): string {
return ethers.utils.solidityKeccak256(["bytes"], [message]);
return ethers.utils.solidityKeccak256(['bytes'], [message]);
}
export function destinationAndNonce(
destination: Domain,
sequence: number
sequence: number,
): ethers.BigNumber {
assert(destination < Math.pow(2, 32) - 1);
assert(sequence < Math.pow(2, 32) - 1);
@ -69,7 +69,7 @@ export function destinationAndNonce(
export function domainHash(domain: Number): string {
return ethers.utils.solidityKeccak256(
["uint32", "string"],
[domain, "ABACUS"]
['uint32', 'string'],
[domain, 'ABACUS'],
);
}

Loading…
Cancel
Save