Source β Alkane 4:65522 β SUBFROST Explorer
Verified Source 4:65522β β Verified Commit a6fd8b3
Match 99.4%
Files 4
The exact source a sandboxed build reproduced the on-chain wasm from β served from SUBFROST's verified-build database, since the origin repository is private.
Build & verification details Reproduction recipe structural match
Every fixture below was reversed from the on-chain bytecode, then pinned in a sandboxed rebuild. Reproduced deterministically β the source genuinely compiles to this bytecode.
Build environment
HOME
/home/hude
β embedded registry/git-checkout paths
CARGO_HOME
/home/hude/.cargo
env
CC_wasm32_unknown_unknown=clang-18
env
AR_wasm32_unknown_unknown=llvm-ar-18
env
build dir = /home/hude/alkanes-rs
Git dependency
repo
sandshrewmetaprotocols/metashrew
rev
26d968c
β fingerprint git_deps
source-id
bare (matches -C metadata β mono ordering)
crates/alkanes-std-upgradeable/src/lib.rs 2,730 B
use alkanes_runtime : : auth : : AuthenticatedResponder ; use alkanes_runtime : : declare_alkane ; use alkanes_runtime : : message : : MessageDispatch ; #[allow(unused_imports)] use alkanes_runtime : : { println , stdio : : { stdout , Write } , } ; use
alkanes_runtime
:
:
{
runtime
:
:
AlkaneResponder
,
storage
:
:
StoragePointer
}
;
use alkanes_support : : { cellpack : : Cellpack , id : : AlkaneId , response : : CallResponse } ;
use anyhow : : { anyhow , Result } ;
use metashrew_support : : compat : : { to_arraybuffer_layout , to_passback_ptr } ;
use metashrew_support : : index_pointer : : KeyValuePointer ;
use std : : sync : : Arc ;
#[derive(Default)]
pub struct Upgradeable ( ( ) ) ;
#[derive(MessageDispatch)]
enum UpgradeableMessage {
#[opcode(0x7fff)]
Initialize {
implementation : AlkaneId ,
auth_token_units : u128 ,
} ,
#[opcode(0x7ffe)]
Upgrade { implementation : AlkaneId } ,
#[opcode(0x8fff)]
Forward { } ,
}
impl Upgradeable {
fn forward ( & self ) - > Result < CallResponse > {
let context = self . context ( ) ? ;
let response = CallResponse : : forward ( & context . incoming_alkanes ) ;
Ok ( response )
}
pub fn alkane_pointer ( ) - > StoragePointer {
StoragePointer : : from_keyword ( "/implementation" )
}
pub fn alkane ( ) - > Result < AlkaneId > {
Ok ( Self : : alkane_pointer ( ) . get ( ) . as_ref ( ) . clone ( ) . try_into ( ) ? )
}
pub fn set_alkane ( v : AlkaneId ) {
Self : : alkane_pointer ( ) . set ( Arc : : new ( < AlkaneId as Into < Vec < u8 > > > : : into ( v ) ) ) ;
}
fn initialize ( & self , implementation : AlkaneId , auth_token_units : u128 ) - > Result < CallResponse > {
self . observe_proxy_initialization ( ) ? ;
let context = self . context ( ) ? ;
Self : : set_alkane ( implementation ) ;
let mut response : CallResponse = CallResponse : : forward ( & context . incoming_alkanes ) ;
response
. alkanes
. 0
. push ( self . deploy_auth_token ( auth_token_units ) ? ) ;
Ok ( response )
}
fn upgrade ( & self , implementation : AlkaneId ) - > Result < CallResponse > {
let context = self . context ( ) ? ;
self . only_owner ( ) ? ;
Self : : set_alkane ( implementation ) ;
Ok ( CallResponse : : forward ( & context . incoming_alkanes ) )
}
}
impl AuthenticatedResponder for Upgradeable { }
impl AlkaneResponder for Upgradeable {
fn fallback ( & self ) - > Result < CallResponse > {
let context = self . context ( ) ? ;
let inputs : Vec < u128 > = context . inputs . clone ( ) ;
let cellpack = Cellpack {
target : Self : : alkane ( ) ? ,
inputs : inputs ,
} ;
self . delegatecall ( & cellpack , & context . incoming_alkanes , self . fuel ( ) )
}
}
// Use the new macro format
declare_alkane! {
impl AlkaneResponder for Upgradeable {
type Message = UpgradeableMessage ;
}
}