Skip to content

Commit

Permalink
Merge pull request #459 from ourzora/fix-custom-tx-issue
Browse files Browse the repository at this point in the history
Fix issue where array data is not properly validated
  • Loading branch information
neokry committed May 22, 2024
2 parents 5d80d0d + bddfcc4 commit e99aa69
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,17 @@ export const Arguments = () => {
return {
[cv.name]: Yup.string()
.required('*')
.test('is valid abi type', 'valid abi type', (value) => {
.test('is valid abi type', 'invalid abi type', (value) => {
const list = value?.replace(/\s/g, '').split(',')
try {
encodeAbiParameters([type], [list])
encodeAbiParameters(
[
{
type,
},
],
[list]
)
return true
} catch (e) {
return false
Expand Down

0 comments on commit e99aa69

Please sign in to comment.