@@ -124,6 +124,11 @@ namespace Nethermind.Core2.Types
         {
             return slot.Number;
         }
+        
+        public static implicit operator int(Slot slot)
+                {
+                    return (int)slot.Number;
+                }
 
         public static uint Seconds { get; set; } = 12;
         
//  Copyright (c) 2018 Demerzel Solutions Limited
//  This file is part of the Nethermind library.
// 
//  The Nethermind library is free software: you can redistribute it and/or modify
//  it under the terms of the GNU Lesser General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
// 
//  The Nethermind library is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//  GNU Lesser General Public License for more details.
// 
//  You should have received a copy of the GNU Lesser General Public License
//  along with the Nethermind. If not, see <http://www.gnu.org/licenses/>.

using System;
using System.Diagnostics;

namespace Nethermind.Core2.Types
{
    [DebuggerDisplay("{Number}")]
    public struct Slot : IEquatable<Slot>, IComparable<Slot>
    {
        public const int SszLength = sizeof(ulong);
        
        public Slot(ulong number)
        {
            Number = number;
        }
        
        public static Slot None => new Slot(ulong.MaxValue);

        public static Slot Zero => new Slot(0);
        
        public ulong Number { get; }

        public static bool operator <(Slot a, Slot b)
        {
            return a.Number < b.Number;
        }

        public static bool operator >(Slot a, Slot b)
        {
            return a.Number > b.Number;
        }
        
        public static bool operator <=(Slot a, Slot b)
        {
            return a.Number <= b.Number;
        }

        public static bool operator >=(Slot a, Slot b)
        {
            return a.Number >= b.Number;
        }
        
        public static bool operator ==(Slot a, Slot b)
        {
            return a.Number == b.Number;
        }

        public static bool operator !=(Slot a, Slot b)
        {
            return !(a == b);
        }
        
        public static Slot operator -(Slot left, Slot right)
        {
            return new Slot(left.Number - right.Number);
        }
        
        public static Slot operator %(Slot left, Slot right)
        {
            return new Slot(left.Number % right.Number);
        }

        public static Slot operator *(Slot left, ulong right)
        {
            return new Slot(left.Number * right);
        }

        public static ulong operator /(Slot left, Slot right)
        {
            return left.Number / right.Number;
        }

        public static Slot operator +(Slot left, Slot right)
        {
            return new Slot(left.Number + right.Number);
        }

        public bool Equals(Slot other)
        {
            return Number == other.Number;
        }

        public override bool Equals(object? obj)
        {
            return obj is Slot other && Equals(other);
        }

        public override int GetHashCode()
        {
            return Number.GetHashCode();
        }
        
        public static implicit operator Slot(ulong value)
        {
            return new Slot(value);
        }
        
        public static implicit operator Slot(int value)
        {
            if (value < 0)
            {
                throw new ArgumentException("Slot number must be > 0", nameof(value));
            }
            
            return new Slot((ulong)value);
        }
        
        public static implicit operator ulong(Slot slot)
        {
            return slot.Number;
        }

        public static uint Seconds { get; set; } = 12;
        
        public override string ToString()
        {
            return Number.ToString();
        }

        public int CompareTo(Slot other)
        {
            return Number.CompareTo(other.Number);
        }
    }
}
I worry about direct conversion to int, either implicit or explicit, as the Eth2 spec is that these values are uint64. I know that .NET arrays are constrained to int32 indexes, and maybe we will never reach slot numbers that big, but a better approach may be explicit accessors (GetXxx) that check values.