github.com/neatio-net/neatio@v1.7.3-0.20231114194659-f4d7a2226baa/chain/core/vm/stack_table.go (about)

     1  package vm
     2  
     3  import (
     4  	"github.com/neatio-net/neatio/params"
     5  )
     6  
     7  func minSwapStack(n int) int {
     8  	return minStack(n, n)
     9  }
    10  func maxSwapStack(n int) int {
    11  	return maxStack(n, n)
    12  }
    13  
    14  func minDupStack(n int) int {
    15  	return minStack(n, n+1)
    16  }
    17  func maxDupStack(n int) int {
    18  	return maxStack(n, n+1)
    19  }
    20  
    21  func maxStack(pop, push int) int {
    22  	return int(params.StackLimit) + pop - push
    23  }
    24  func minStack(pops, push int) int {
    25  	return pops
    26  }