code: func (s *stack) DupN(n int32) error {
  	if n < 1 {
  		str := fmt.Sprintf("attempt to dup %d stack items", n)
  		return scriptError(ErrInvalidStackOperation, str)
  	}
  
  	// Iteratively duplicate the value n-1 down the stack n times.
  	// This leaves an in-order duplicate of the top n items on the stack.
  	for i := n; i > 0; i-- {
  		so, err := s.PeekByteArray(n - 1)
  		if err != nil {
  			return err
  		}
  		s.PushByteArray(so)
  	}
  	return nil
  }
docs: // DupN duplicates the top N items on the stack.
  //
  // Stack transformation:
  // DupN(1): [... x1 x2] -> [... x1 x2 x2]
  // DupN(2): [... x1 x2] -> [... x1 x2 x1 x2]