github.com/neatlab/neatio@v1.7.3-0.20220425043230-d903e92fcc75/chain/core/vm/stack_table.go (about)

     1  package vm
     2  
     3  import (
     4  	"github.com/neatlab/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  }