diff --git a/assets/icons/keyboard-icon.svg b/assets/icons/keyboard-icon.svg
new file mode 100644
index 0000000..6bcf10f
--- /dev/null
+++ b/assets/icons/keyboard-icon.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/styles/_global.scss b/assets/styles/_global.scss
index c4eaa60..103f0ec 100644
--- a/assets/styles/_global.scss
+++ b/assets/styles/_global.scss
@@ -87,11 +87,6 @@ textarea {
@include field-text;
}
-button,
-a {
- cursor: pointer;
-}
-
body,
span,
p,
@@ -101,6 +96,15 @@ a {
@include p-16-regular;
}
+button,
+a {
+ cursor: pointer;
+
+ &:disabled {
+ cursor: not-allowed;
+ }
+}
+
main {
margin-top: var(--app-height-header);
padding: var(--app-padding);
diff --git a/enums/icon-names.enum.ts b/enums/icon-names.enum.ts
index c84606b..d6f3916 100644
--- a/enums/icon-names.enum.ts
+++ b/enums/icon-names.enum.ts
@@ -14,6 +14,7 @@ export enum ICON_NAMES {
exclamationCircle = 'exclamation-circle',
exclamationTriangle = 'exclamation-triangle',
hashtag = 'hashtag',
+ keyboard = 'keyboard',
locationMarker = 'location-marker',
plus = 'plus',
refresh = 'refresh',
diff --git a/forms/AbiEncodeForm.vue b/forms/AbiEncodeForm.vue
index 3fb3681..51db338 100644
--- a/forms/AbiEncodeForm.vue
+++ b/forms/AbiEncodeForm.vue
@@ -38,7 +38,6 @@
+ >
+
+
+
+
+
-
+
@@ -141,6 +167,7 @@ import {
ethereumBaseType,
ethereumBaseTypeValue,
formatArgSubtype,
+ getDefaultSubtypeOfType,
getDefaultValueOfType,
json,
parseFuncArgToValueOfEncode,
@@ -366,10 +393,10 @@ abiEncoding.value = encodeAbi([], [])
.abi-encode-form .abi-encode-form__field-btn-icon {
height: toRem(24);
width: toRem(24);
+ margin-right: toRem(-1);
- &--refresh {
- height: toRem(18);
- width: toRem(18);
+ &--x-mark {
+ margin-right: toRem(-5);
}
}
diff --git a/helpers/abi-form.helpers.ts b/helpers/abi-form.helpers.ts
index 707c706..d884acf 100644
--- a/helpers/abi-form.helpers.ts
+++ b/helpers/abi-form.helpers.ts
@@ -195,32 +195,37 @@ export const formatArgSubtype = (subtype: AbiForm.FuncArg['subtype']) => {
return subtype.replaceAll('tuple(', '(').replaceAll('(', 'tuple(')
}
+export const getDefaultSubtypeOfType = (
+ type: AbiForm.FuncArg['type'],
+): string => {
+ if (type === ETHEREUM_TYPES.tuple) {
+ return 'tuple()'
+ }
+
+ return ''
+}
+
export const getDefaultValueOfType = (
type: AbiForm.FuncArg['type'],
): string => {
const baseType = type.replace(/\d+/, '')
const matchArray = type.match(/\d+/)
const sizeOfType = matchArray?.length ? Number(matchArray[0]) : 0
+ const isArrayBaseType = ParamType.from(type).baseType === 'array'
+
+ if (isArrayBaseType) return '[]'
switch (baseType) {
case ETHEREUM_TYPES.address:
return '0x0000000000000000000000000000000000000000'
- case ETHEREUM_TYPES.addressArray:
- return '["0x0000000000000000000000000000000000000000"]'
case ETHEREUM_TYPES.bool:
return 'false'
- case ETHEREUM_TYPES.boolArray:
- return '[false]'
case ETHEREUM_TYPES.bytes:
- return sizeOfType ? '0x'.concat('00'.repeat(sizeOfType)) : '0x00'
- case ETHEREUM_TYPES.bytesArray:
- return sizeOfType ? `["0x${'00'.repeat(sizeOfType)}"]` : '["0x00"]'
- case ETHEREUM_TYPES.stringArray:
- return '[""]'
+ return sizeOfType ? '0x'.concat('00'.repeat(sizeOfType)) : '0x'
+ case ETHEREUM_TYPES.tuple:
+ return '[]'
case ETHEREUM_TYPES.uint:
- return sizeOfType.toString()
- case ETHEREUM_TYPES.uintArray:
- return `["${sizeOfType}"]`
+ return '0'
default:
return ''
}