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

Add denom prefix #182

Merged
merged 9 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/factory/forms/ConfirmationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function ConfirmationForm({
value: MsgCreateDenom.encode(
createDenom({
sender: formData.groupPolicyAddress || '',
subdenom: formData.subdenom,
subdenom: 'u' + formData.subdenom,
chalabi2 marked this conversation as resolved.
Show resolved Hide resolved
}).value
).finish(),
}),
Expand Down Expand Up @@ -99,7 +99,7 @@ export default function ConfirmationForm({
// First, create the denom
const createDenomMsg = createDenom({
sender: address,
subdenom: formData.subdenom,
subdenom: 'u' + formData.subdenom,
chalabi2 marked this conversation as resolved.
Show resolved Hide resolved
});

const createDenomFee = await estimateFee(address, [createDenomMsg]);
Expand Down
5 changes: 2 additions & 3 deletions components/factory/forms/CreateDenom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export default function CreateDenom({
const DenomSchema = Yup.object().shape({
subdenom: Yup.string()
.required('Subdenom is required')
.matches(/^[u][a-zA-Z0-9]+$/, 'Subdenom must start with the letter u')
.min(4, 'Subdenom must be at least 4 characters')
.max(44, 'Subdenom must not exceed 44 characters')
.noProfanity('Profanity is not allowed')
Expand Down Expand Up @@ -57,8 +56,7 @@ export default function CreateDenom({
<TextInput
label="Token Sub Denom"
name="subdenom"
placeholder="utoken"
helperText="Use a subdenom starting with a prefix (e.g., 'utoken')"
placeholder="token"
value={formData.subdenom}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
dispatch({
Expand Down Expand Up @@ -126,6 +124,7 @@ export default function CreateDenom({
<button
className="w-[calc(50%-12px)] btn px-5 py-2.5 sm:py-3.5 btn-gradient text-white disabled:text-black"
onClick={() => handleSubmit()}
type="submit"
disabled={!isValid || isSubmitting || isValidating}
>
Next: Token Metadata
Expand Down
Loading