Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Validation errors: instance.from does not match pattern "^0x[0-9a-f]{40}$" #1490

Closed
BlinkyStitt opened this issue Jan 8, 2019 · 1 comment · Fixed by #1533
Closed

Validation errors: instance.from does not match pattern "^0x[0-9a-f]{40}$" #1490

BlinkyStitt opened this issue Jan 8, 2019 · 1 comment · Fixed by #1533
Assignees

Comments

@BlinkyStitt
Copy link
Contributor

BlinkyStitt commented Jan 8, 2019

Expected Behavior

I just installed the latest @0x/migrate, and running 0x-migrate --from 0x29dDcE133121b9B829324AC899c1C9aBEcB372C2should create a bunch of contracts and then complete without error.

Current Behavior

Running 0x-migrate with a check-summed address created 6 transactions in ganache, but then it gave an error.

Error: Expected txData to conform to schema /txDataSchema
Encountered: {
	"from": "0x29dDcE133121b9B829324AC899c1C9aBEcB372C2",
	"data": "0x608060405260008054600160a060020a03191633179055610f4a806100256000396000f3006080604052600436106100985763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166342f1181e8114610248578063494503d41461027857806370712939146102b95780638da5cb5b146102e75780639ad26744146102fc578063ae25532e1461032d578063b918161114610377578063d39de6e9146103b9578063f2fde38b1461041e575b3480156100a457600080fd5b507fffffffff00000000000000000000000000000000000000000000000000000000600035167fa85e59e40000000000000000000000000000000000000000000000000000000081141561024357604080513381526001602082015290812054151561017b577f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c1553454e4445525f4e4f545f415554484f52495a454400000000000000604052600060605260646000fd5b602860043501357f23b872dd0000000000000000000000000000000000000000000000000000000060005260606024600437602060006064600080855af1600080511160203d14163d15178116905080156101d257005b7f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c0f5452414e534645525f4641494c454400000000000000000000000000604052600060605260646000fd5b600080fd5b34801561025457600080fd5b5061027673ffffffffffffffffffffffffffffffffffffffff6004351661044c565b005b34801561028457600080fd5b50610290600435610638565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156102c557600080fd5b5061027673ffffffffffffffffffffffffffffffffffffffff6004351661066d565b3480156102f357600080fd5b50610290610966565b34801561030857600080fd5b5061027673ffffffffffffffffffffffffffffffffffffffff60043516602435610982565b34801561033957600080fd5b50610342610d37565b604080517fffffffff000000000000000000000000000000000000000000000000000000009092168252519081900360200190f35b34801561038357600080fd5b506103a573ffffffffffffffffffffffffffffffffffffffff60043516610d6d565b604080519115158252519081900360200190f35b3480156103c557600080fd5b506103ce610d82565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561040a5781810151838201526020016103f2565b505050509050019250505060405180910390f35b34801561042a57600080fd5b5061027673ffffffffffffffffffffffffffffffffffffffff60043516610df1565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104d257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811660009081526001602052604090205460ff161561056757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f5441524745545f414c52454144595f415554484f52495a454400000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116600081815260016020819052604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168317905560028054928301815583527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace90910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001684179055513392917f3147867c59d17e8fa9d522465651d44aae0a9e38f902f3475b97e58072f0ed4c91a350565b600280548290811061064657fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b6000805473ffffffffffffffffffffffffffffffffffffffff1633146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604090205460ff16151561078a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f5441524745545f4e4f545f415554484f52495a45440000000000000000000000604482015290519081900360640190fd5b5073ffffffffffffffffffffffffffffffffffffffff8116600090815260016020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555b60025481101561091f578173ffffffffffffffffffffffffffffffffffffffff1660028281548110151561080757fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16141561091757600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810190811061085f57fe5b6000918252602090912001546002805473ffffffffffffffffffffffffffffffffffffffff909216918390811061089257fe5b600091825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01906109119082610ed7565b5061091f565b6001016107d7565b604051339073ffffffffffffffffffffffffffffffffffffffff8416907f1f32c1b084e2de0713b8fb16bd46bb9df710a3dbeae2f3ca93af46e016dcc6b090600090a35050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a0857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604090205460ff161515610a9e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f5441524745545f4e4f545f415554484f52495a45440000000000000000000000604482015290519081900360640190fd5b6002548110610b0e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f494e4445585f4f55545f4f465f424f554e445300000000000000000000000000604482015290519081900360640190fd5b8173ffffffffffffffffffffffffffffffffffffffff16600282815481101515610b3457fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1614610bc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f415554484f52495a45445f414444524553535f4d49534d415443480000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101908110610c3d57fe5b6000918252602090912001546002805473ffffffffffffffffffffffffffffffffffffffff9092169183908110610c7057fe5b600091825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190610cef9082610ed7565b50604051339073ffffffffffffffffffffffffffffffffffffffff8416907f1f32c1b084e2de0713b8fb16bd46bb9df710a3dbeae2f3ca93af46e016dcc6b090600090a35050565b604080517f4552433230546f6b656e28616464726573732900000000000000000000000000815290519081900360130190205b90565b60016020526000908152604090205460ff1681565b60606002805480602002602001604051908101604052809291908181526020018280548015610de757602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610dbc575b5050505050905090565b60005473ffffffffffffffffffffffffffffffffffffffff163314610e7757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811615610ed457600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b50565b815481835581811115610efb57600083815260209020610efb918101908301610f00565b505050565b610d6a91905b80821115610f1a5760008155600101610f06565b50905600a165627a7a72305820f6b2cadda0be9b47f37ed4a850b096e49b5e2e8bb7446d65481adecf980824a00029"
}
Validation errors: instance.from does not match pattern "^0x[0-9a-f]{40}$"
    at Object.assert (/usr/src/app/external/0x-migrations/node_modules/@0x/assert/src/index.ts:91:19)
    at Object.doesConformToSchema (/usr/src/app/external/0x-migrations/node_modules/@0x/assert/src/index.ts:79:16)
    at Web3Wrapper.<anonymous> (/usr/src/app/external/0x-migrations/node_modules/@0x/web3-wrapper/src/web3_wrapper.ts:512:16)
    at step (/usr/src/app/external/0x-migrations/node_modules/@0x/web3-wrapper/lib/src/web3_wrapper.js:43:23)
    at Object.next (/usr/src/app/external/0x-migrations/node_modules/@0x/web3-wrapper/lib/src/web3_wrapper.js:24:53)
    at /usr/src/app/external/0x-migrations/node_modules/@0x/web3-wrapper/lib/src/web3_wrapper.js:18:71
    at new Promise (<anonymous>)
    at __awaiter (/usr/src/app/external/0x-migrations/node_modules/@0x/web3-wrapper/lib/src/web3_wrapper.js:14:12)
    at Web3Wrapper.estimateGasAsync (/usr/src/app/external/0x-migrations/node_modules/@0x/web3-wrapper/lib/src/web3_wrapper.js:726:16)
    at Function.<anonymous> (/usr/src/app/external/0x-migrations/node_modules/@0x/base-contract/src/index.ts:86:44)
    at step (/usr/src/app/external/0x-migrations/node_modules/@0x/base-contract/lib/src/index.js:43:23)
    at Object.next (/usr/src/app/external/0x-migrations/node_modules/@0x/base-contract/lib/src/index.js:24:53)
    at /usr/src/app/external/0x-migrations/node_modules/@0x/base-contract/lib/src/index.js:18:71
    at new Promise (<anonymous>)
    at __awaiter (/usr/src/app/external/0x-migrations/node_modules/@0x/base-contract/lib/src/index.js:14:12)
    at Function.BaseContract._applyDefaultsToTxDataAsync (/usr/src/app/external/0x-migrations/node_modules/@0x/base-contract/lib/src/index.js:104:16)
    at Function.<anonymous> (/usr/src/app/external/0x-migrations/node_modules/@0x/abi-gen-wrappers/src/generated-wrappers/erc20_proxy.ts:632:55)
    at step (/usr/src/app/external/0x-migrations/node_modules/@0x/abi-gen-wrappers/lib/src/generated-wrappers/erc20_proxy.js:56:23)
    at Object.next (/usr/src/app/external/0x-migrations/node_modules/@0x/abi-gen-wrappers/lib/src/generated-wrappers/erc20_proxy.js:37:53)
    at /usr/src/app/external/0x-migrations/node_modules/@0x/abi-gen-wrappers/lib/src/generated-wrappers/erc20_proxy.js:31:71
    at new Promise (<anonymous>)
    at __awaiter (/usr/src/app/external/0x-migrations/node_modules/@0x/abi-gen-wrappers/lib/src/generated-wrappers/erc20_proxy.js:27:12)

It appears that --from expects the address to be lowercased.

Possible Solution

  1. Allow checksum encoding be changing the regex to ^0x[0-9a-fA-F]{40}
  2. The migration script could lowercase the address before passing it on
@BlinkyStitt BlinkyStitt changed the title [migrations] Validation errors: instance.from does not match pattern "^0x[0-9a-f]{40}$" Validation errors: instance.from does not match pattern "^0x[0-9a-f]{40}$" Jan 8, 2019
@LogvinovLeon
Copy link
Contributor

Overall - I think most 0x tools have that problem. we prefer to only operate on non-checksummed addresses internally and handle conversions client-side (UI), but because that's a CLI - we should convert it while parsing parameters.

dekz added a commit that referenced this issue Jan 21, 2019
@dekz dekz mentioned this issue Jan 21, 2019
4 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants