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

merge develop into echo_version #2

Open
wants to merge 31 commits into
base: echo_version
Choose a base branch
from
Open

merge develop into echo_version #2

wants to merge 31 commits into from

Conversation

toffick
Copy link

@toffick toffick commented Nov 21, 2019

No description provided.

tsconfig.json Outdated
{ "path": "./packages/migrations" },
{ "path": "./packages/echo-migrations" },
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added the new echo-migrations package for building with yarn build

@@ -663,6 +663,17 @@ export class Web3Wrapper {
assert.isNumber('blockNumber', blockNumber);
await this.sendRawPayloadAsync<void>({ method: 'debug_setHead', params: [utils.numberToHex(blockNumber)] });
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the method for receiving echo account's public keys was added . it is used while check a ED25519 signature

@@ -253,7 +253,7 @@ export enum RevertReason {
LengthGreaterThan3Required = 'LENGTH_GREATER_THAN_3_REQUIRED',
LengthGreaterThan131Required = 'LENGTH_GREATER_THAN_131_REQUIRED',
Length0Required = 'LENGTH_0_REQUIRED',
Length65Required = 'LENGTH_65_REQUIRED',
Length65Required = 'LENGTH_64_REQUIRED',
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the LENGTH_65_REQUIRED constraint was changed cause a message signature's length had been changed from 65 to 64 symbols (v parameter had been cutted)

@@ -0,0 +1,43 @@
import { JSONRPCRequestPayload } from 'ethereum-types';
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the ProviderSubprovider (according with https://github.com/MetaMask/web3-provider-engine/blob/master/subproviders/provider.js) was added for compatibility with 0x-launck-kit-backend requests + echo-web3 requests

const prefixedMsgBuff = ethUtil.hashPersonalMessage(msgBuff);
const prefixedMsgHex = ethUtil.bufferToHex(prefixedMsgBuff);
const signature = await this._web3Wrapper.signMessageAsync(address, prefixedMsgHex);
const signature = await this._web3Wrapper.sendRawPayloadAsync<string>({
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bridge provider hashes message by itself

s
);
bytes32 signedData = keccak256("\x19Ethereum Signed Message:\n32", hash);
return edverify(signer, abi.encodePacked(signedData), abi.encodePacked(v, r, s));
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the verifying of ECDSA message signature had been replced by edverify


const publicKeyBuffer = Buffer.from(publicKey, 'hex');
const msgHashBuff = Buffer.from(data.slice(2), 'hex');
const signatureHashBuff = Buffer.from(signature.slice(2), 'hex');
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the encoding all strings to buffer for compatibility with ed25519.js methods

@@ -184,23 +184,26 @@ export const signatureUtils = {
* @param signerAddress The hex encoded address that signed the data, producing the supplied signature.
* @return Whether the ECSignature is valid.
*/
isValidECSignature(data: string, signature: ECSignature, signerAddress: string): boolean {
async isValidECSignature(provider: ZeroExProvider, data: string, signature: string, signerAddress: string): Promise<boolean> {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to call ECHO network by provider

import * as ethUtil from 'ethereumjs-util';
import * as _ from 'lodash';
import * as ed25519 from 'ed25519.js';
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the import ed25519.js for verifying ed25519 messages

},
"required": ["v", "r", "s"],
"type": "object"
"type": "string"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the structure of ecSignatureSchema had been changed from (v,r,s) object to string

@@ -135,6 +135,9 @@ const generateConfig = (dischargeTarget, heapConfigOptions, rollbarConfigOptions
resolve: {
extensions: ['.js', '.json', '.ts', '.tsx'],
},
node: {
fs: 'empty'
},
Copy link
Author

@toffick toffick Nov 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the building of @0x/instant throw an error on ed25519.js package and this line helps to ignore this package while building

Nickolai Borsuk and others added 3 commits December 24, 2019 15:02
* upd

* upd

* upd

* Fix "supported_asset_id"-problem

* temp: eth_call's asset_id

* add asset require to tokens contracts

* upd ebtc withdraw

Co-authored-by: NickLatkovich <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants