//Authorize for a node by depositing ONT in this governance contract, used by contracts
Authorize for a node by depositing ONT in this governance contract, used by contracts
Authorize for a node by depositing ONT in this governance contract used by contracts
pub fn authorize_for_peer_transfer_from(addr: &Address, amt: U128, peer_pub_key: &str) -> bool {
        let mut sink = Sink::new(64);
        let pos_list = &[amt.raw() as u32];
        let peer_pub_key = &[peer_pub_key];
        let a = AuthorizeForPeerParam::new(addr, pos_list, peer_pub_key);
        sink.write(a);
        let mut sink_param = Sink::new(64);
        sink_param.write(VERSION);
        sink_param.write("authorizeForPeerTransferFrom");
        sink_param.write(sink.bytes());
        let output = call_contract(&GOV_CONTRACT_ADDRESS, sink_param.bytes());
        let mut source = Source::new(output.as_slice());
        source.read_bool().unwrap_or_default()
    }
pub fn authorize_for_peer_transfer_from ( addr : & Address , amt : U128 , peer_pub_key : & str ) -> bool { let mut sink = Sink :: new ( 64 ) ; let pos_list = & [ amt . raw ( ) as u32 ] ; let peer_pub_key = & [ peer_pub_key ] ; let a = AuthorizeForPeerParam :: new ( addr , pos_list , peer_pub_key ) ; sink . write ( a ) ; let mut sink_param = Sink :: new ( 64 ) ; sink_param . write ( VERSION ) ; sink_param . write ( " " ) ; sink_param . write ( sink . bytes ( ) ) ; let output = call_contract ( & GOV_CONTRACT_ADDRESS , sink_param . bytes ( ) ) ; let mut source = Source :: new ( output . as_slice ( ) ) ; source . read_bool ( ) . unwrap_or_default ( ) }
Authorize for a node by depositing ONT in this governance contract, used by contracts
Authorize for a node by depositing ONT in this governance contract used by contracts
addr
&Address
amt
U128
peer_pub_key
&str