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

feat: add tokenfactory #3491

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

feat: add tokenfactory #3491

wants to merge 8 commits into from

Conversation

wllmshao
Copy link
Contributor

Please go the Preview tab and select the appropriate sub-template:

  • Production code - for types fix, feat, and refactor.
  • Docs - for documentation changes.
  • Others - for changes that do not affect production code.

tokenfactory/app/app.go Fixed Show fixed Hide fixed
tokenfactory/app/app.go Fixed Show fixed Hide fixed
tokenfactory/app/app.go Fixed Show fixed Hide fixed
tokenfactory/app/app.go Fixed Show fixed Hide fixed
tokenfactory/app/app.go Fixed Show fixed Hide fixed
tokenfactory/app/params/config.go Fixed Show fixed Hide fixed
tokenfactory/app/params/config.go Fixed Show fixed Hide fixed
tokenfactory/app/params/config.go Fixed Show fixed Hide fixed
tokenfactory/app/params/config.go Fixed Show fixed Hide fixed
tokenfactory/x/tokenfactory/keeper/keeper.go Fixed Show fixed Hide fixed
Comment on lines +1036 to +1043
for _, m := range app.ModuleManager.Modules {
if moduleWithName, ok := m.(module.HasName); ok {
moduleName := moduleWithName.Name()
if appModule, ok := moduleWithName.(appmodule.AppModule); ok {
modules[moduleName] = appModule
}
}
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
Comment on lines +1069 to +1071
for _, key := range app.keys {
keys = append(keys, key)
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
Comment on lines +1152 to +1154
for k, v := range maccPerms {
dupMaccPerms[k] = v
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
Comment on lines +1162 to +1164
for acc := range GetMaccPerms() {
modAccAddrs[authtypes.NewModuleAddress(acc).String()] = true
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
return paramsKeeper
}

var seededRand *rand.Rand = rand.New(rand.NewSource(time.Now().UnixNano()))

Check warning

Code scanning / CodeQL

Calling the system time Warning

Calling the system time may be a possible source of non-determinism
// Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address.
Bech32PrefixValAddr = Bech32PrefixAccAddr + "valoper"
// Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key.
Bech32PrefixValPub = Bech32PrefixAccAddr + "valoperpub"

Check warning

Code scanning / CodeQL

Directly using the bech32 constants Warning

Directly using the bech32 constants instead of the configuration values
// Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key.
Bech32PrefixValPub = Bech32PrefixAccAddr + "valoperpub"
// Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address.
Bech32PrefixConsAddr = Bech32PrefixAccAddr + "valcons"

Check warning

Code scanning / CodeQL

Directly using the bech32 constants Warning

Directly using the bech32 constants instead of the configuration values
// Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address.
Bech32PrefixConsAddr = Bech32PrefixAccAddr + "valcons"
// Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key.
Bech32PrefixConsPub = Bech32PrefixAccAddr + "valconspub"

Check warning

Code scanning / CodeQL

Directly using the bech32 constants Warning

Directly using the bech32 constants instead of the configuration values

func SetAddressPrefixes() {
config := sdk.GetConfig()
config.SetBech32PrefixForAccount(Bech32PrefixAccAddr, Bech32PrefixAccPub)

Check warning

Code scanning / CodeQL

Directly using the bech32 constants Warning

Directly using the bech32 constants instead of the configuration values
Comment on lines +55 to +57
for name, perms := range maccPerms {
permAddrs[name] = authtypes.NewPermissionsForAddress(name, perms)
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
@faddat
Copy link
Contributor

faddat commented Jan 30, 2025

Thank you for this. CW should never be added to a chain without token factory.

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.

2 participants