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

asch builtin contract fee and type name mapping #224

Open
sqfasd opened this issue Jul 30, 2018 · 2 comments
Open

asch builtin contract fee and type name mapping #224

sqfasd opened this issue Jul 30, 2018 · 2 comments

Comments

@sqfasd
Copy link
Member

sqfasd commented Jul 30, 2018

fee calculator:

  1: () => 0.1,
  2: (trs) => {
    const len = trs.args[0].length
    if (len === 2) {
      return 200
    } else if (len === 3) {
      return 100
    } else if (len === 4) {
      return 80
    } else if (len === 5) {
      return 40
    } else if (len <= 10) {
      return 10
    }
    return 1
  },
  3: () => 5,
  4: () => 0.1,
  5: () => 0,
  6: () => 5,
  7: () => 100,
  8: () => 0.1,
  9: () => 0,
  10: () => 100,
  11: () => 0.1,
  12: () => 0.1,
  100: () => 100,
  101: () => 500,
  102: () => 0.1,
  103: () => 0.1,
  200: () => 100,
  201: () => 1,
  202: () => 1,
  203: () => 1,
  204: () => 0.1,
  205: () => 0.1,
  300: () => 10,
  301: () => 0.1,
  302: () => 0,
  400: () => 0.1,
  401: () => 100,
  402: () => 0.01,
  403: () => 0,
  404: () => 0.01,
  405: () => 0.01,
  406: () => 0.01,
  500: () => 0,
  501: () => 0,
  502: () => 1,
  503: () => 1,
  504: () => 1,

type name mapping

app.contractTypeMapping[1] = 'basic.transfer'
  app.contractTypeMapping[2] = 'basic.setName'
  app.contractTypeMapping[3] = 'basic.setPassword'
  app.contractTypeMapping[4] = 'basic.lock'
  app.contractTypeMapping[5] = 'basic.unlock'
  app.contractTypeMapping[6] = 'basic.registerGroup'
  app.contractTypeMapping[7] = 'basic.registerAgent'
  app.contractTypeMapping[8] = 'basic.setAgent'
  app.contractTypeMapping[9] = 'basic.cancelAgent'
  app.contractTypeMapping[10] = 'basic.registerDelegate'
  app.contractTypeMapping[11] = 'basic.vote'
  app.contractTypeMapping[12] = 'basic.unvote'

  app.contractTypeMapping[100] = 'uia.registerIssuer'
  app.contractTypeMapping[101] = 'uia.registerAsset'
  app.contractTypeMapping[102] = 'uia.issue'
  app.contractTypeMapping[103] = 'uia.transfer'

  app.contractTypeMapping[200] = 'chain.register'
  app.contractTypeMapping[201] = 'chain.replaceDelegate'
  app.contractTypeMapping[202] = 'chain.addDelegate'
  app.contractTypeMapping[203] = 'chain.removeDelegate'
  app.contractTypeMapping[204] = 'chain.deposit'
  app.contractTypeMapping[205] = 'chain.withdrawal'

  app.contractTypeMapping[300] = 'proposal.propose'
  app.contractTypeMapping[301] = 'proposal.vote'
  app.contractTypeMapping[302] = 'proposal.activate'

  app.contractTypeMapping[400] = 'gateway.openAccount'
  app.contractTypeMapping[401] = 'gateway.registerMember'
  app.contractTypeMapping[402] = 'gateway.deposit'
  app.contractTypeMapping[403] = 'gateway.withdrawal'
  app.contractTypeMapping[404] = 'gateway.submitWithdrawalTransaction'
  app.contractTypeMapping[405] = 'gateway.submitWithdrawalSignature'
  app.contractTypeMapping[406] = 'gateway.submitOutTransactionId'

  app.contractTypeMapping[500] = 'group.vote'
  app.contractTypeMapping[501] = 'group.activate'
  app.contractTypeMapping[502] = 'group.addMember'
  app.contractTypeMapping[503] = 'group.removeMember'
  app.contractTypeMapping[504] = 'group.replaceMember'
@bassjobsen
Copy link
Contributor

bassjobsen commented Aug 27, 2018

@sqfasd both 'proposal.unvote' and 'group.unvote' seems to missing.
Ans maybe also group.revoke group.remove and proposal.revoke, if not please explain.

@sayobile
Copy link

sayobile commented Oct 5, 2019

#287

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants