diff --git a/examples/everything/src/lib.rs b/examples/everything/src/lib.rs index 3d6491aa72e..3c0864c1d46 100644 --- a/examples/everything/src/lib.rs +++ b/examples/everything/src/lib.rs @@ -37,7 +37,7 @@ mod everything { Faucet as FiFi { fn new( address_reservation: GlobalAddressReservation, - bucket: Bucket + bucket: FungibleBucket ) -> Global; fn lock_fee(&self, amount: Decimal); @@ -96,7 +96,7 @@ mod everything { faucet.lock_fee(amount); } - pub fn public_method(&self) -> ResourceManager { + pub fn public_method(&self) -> NonFungibleResourceManager { ResourceBuilder::new_ruid_non_fungible::(OwnerRole::None) .mint_roles(mint_roles! { minter => rule!(allow_all); diff --git a/examples/hello-world/README.md b/examples/hello-world/README.md index ec093a087bd..5357b457805 100644 --- a/examples/hello-world/README.md +++ b/examples/hello-world/README.md @@ -26,7 +26,7 @@ use scrypto::prelude::*; #[blueprint] mod hello { struct Hello { - sample_vault: Vault, + sample_vault: FungibleVault, } impl Hello { @@ -34,7 +34,7 @@ mod hello { // stripped } - pub fn free_token(&mut self) -> Bucket { + pub fn free_token(&mut self) -> FungibleBucket { // stripped } } @@ -47,7 +47,7 @@ The way to instantiate a component is through the `instantiate()` method on the ```rust Self { - sample_vault: Vault::with_bucket(my_bucket), + sample_vault: FungibleVault::with_bucket(my_bucket), } .instantiate() ``` @@ -59,16 +59,16 @@ In Scrypto, assets like tokens, NFTs, and more are not implemented as blueprints To define a new resource, we use the `ResourceBuilder`, specifying the metadata and initial supply. We can use the `ResourceBuilder` to create a simple fungible-supply token called `HelloToken` like this: ```rust -let my_bucket: Bucket = ResourceBuilder::new_fungible(OwnerRole::None) +let my_bucket: FungibleBucket = ResourceBuilder::new_fungible(OwnerRole::None) .metadata("name", "HelloToken") .metadata("symbol", "HT") .mint_initial_supply(1000); ``` -Once created, the 1000 resource-based `HelloToken` tokens are held in transient container `my_bucket`. To permanently store the created resources, we need to put them into a `Vault` like this: +Once created, the 1000 resource-based `HelloToken` tokens are held in transient container `my_bucket`. To permanently store the created resources, we need to put them into a `FungibleVault` like this: ```rust -let vault: Vault = Vault::with_bucket(my_bucket); +let vault = FungibleVault::with_bucket(my_bucket); ``` ## How to Play? diff --git a/examples/hello-world/src/lib.rs b/examples/hello-world/src/lib.rs index fa1ea400e26..b6a9b6987e9 100644 --- a/examples/hello-world/src/lib.rs +++ b/examples/hello-world/src/lib.rs @@ -4,7 +4,7 @@ use scrypto::prelude::*; mod hello { struct Hello { // Define what resources and data will be managed by Hello components - sample_vault: Vault, + sample_vault: FungibleVault, } impl Hello { @@ -13,7 +13,7 @@ mod hello { // This is a function, and can be called directly on the blueprint once deployed pub fn instantiate_hello() -> Global { // Create a new token called "HelloToken," with a fixed supply of 1000, and put that supply into a bucket - let my_bucket: Bucket = ResourceBuilder::new_fungible(OwnerRole::None) + let my_bucket: FungibleBucket = ResourceBuilder::new_fungible(OwnerRole::None) .divisibility(DIVISIBILITY_MAXIMUM) .metadata(metadata! { init { @@ -26,7 +26,7 @@ mod hello { // Instantiate a Hello component, populating its vault with our supply of 1000 HelloToken Self { - sample_vault: Vault::with_bucket(my_bucket), + sample_vault: FungibleVault::with_bucket(my_bucket), } .instantiate() .prepare_to_globalize(OwnerRole::None) @@ -34,7 +34,7 @@ mod hello { } // This is a method, because it needs a reference to self. Methods can only be called on components - pub fn free_token(&mut self) -> Bucket { + pub fn free_token(&mut self) -> FungibleBucket { info!( "My balance is: {} HelloToken. Now giving away a token!", self.sample_vault.amount() diff --git a/radix-clis/assets/template/src/lib.rs b/radix-clis/assets/template/src/lib.rs index fa1ea400e26..b6a9b6987e9 100644 --- a/radix-clis/assets/template/src/lib.rs +++ b/radix-clis/assets/template/src/lib.rs @@ -4,7 +4,7 @@ use scrypto::prelude::*; mod hello { struct Hello { // Define what resources and data will be managed by Hello components - sample_vault: Vault, + sample_vault: FungibleVault, } impl Hello { @@ -13,7 +13,7 @@ mod hello { // This is a function, and can be called directly on the blueprint once deployed pub fn instantiate_hello() -> Global { // Create a new token called "HelloToken," with a fixed supply of 1000, and put that supply into a bucket - let my_bucket: Bucket = ResourceBuilder::new_fungible(OwnerRole::None) + let my_bucket: FungibleBucket = ResourceBuilder::new_fungible(OwnerRole::None) .divisibility(DIVISIBILITY_MAXIMUM) .metadata(metadata! { init { @@ -26,7 +26,7 @@ mod hello { // Instantiate a Hello component, populating its vault with our supply of 1000 HelloToken Self { - sample_vault: Vault::with_bucket(my_bucket), + sample_vault: FungibleVault::with_bucket(my_bucket), } .instantiate() .prepare_to_globalize(OwnerRole::None) @@ -34,7 +34,7 @@ mod hello { } // This is a method, because it needs a reference to self. Methods can only be called on components - pub fn free_token(&mut self) -> Bucket { + pub fn free_token(&mut self) -> FungibleBucket { info!( "My balance is: {} HelloToken. Now giving away a token!", self.sample_vault.amount() diff --git a/radix-engine-interface/src/blueprints/access_controller/data.rs b/radix-engine-interface/src/blueprints/access_controller/data.rs index cc3fc901884..76b7489fab0 100644 --- a/radix-engine-interface/src/blueprints/access_controller/data.rs +++ b/radix-engine-interface/src/blueprints/access_controller/data.rs @@ -38,7 +38,7 @@ pub struct RuleSet { pub confirmation_role: AccessRule, } -#[derive(Debug, Clone, PartialEq, Eq, ScryptoSbor)] +#[derive(Debug, Clone, PartialEq, Eq, ScryptoSbor, ManifestSbor)] pub struct RecoveryProposal { /// The set of rules being proposed for the different roles. pub rule_set: RuleSet, diff --git a/scrypto-install-scripts/install-scrypto-macos.sh b/scrypto-install-scripts/install-scrypto-macos.sh index e5d103c96de..95876cfa619 100755 --- a/scrypto-install-scripts/install-scrypto-macos.sh +++ b/scrypto-install-scripts/install-scrypto-macos.sh @@ -31,11 +31,6 @@ echo -e "\n${BLUE}Installing Xcode Command Line Tools...${NC}" xcode-select --install 2>/dev/null || true check_status "Xcode Command Line Tools installation" -# Install cmake and LLVM -echo -e "\n${BLUE}Installing cmake and LLVM...${NC}" -brew install cmake llvm@$LLVM_VERSION -check_status "cmake and LLVM installation" - # Detect shell and configure appropriate rc file SHELL_CONFIG="" if [[ "$SHELL" == */bin/zsh ]]; then @@ -47,10 +42,37 @@ else exit 1 fi +# Check if Homebrew is installed, install if it's not +echo -e "\n${BLUE}Checking for Homebrew...${NC}" +if ! command -v brew &>/dev/null; then + echo -e "${BLUE}Homebrew not found. Installing Homebrew...${NC}" + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + check_status "Homebrew installation" + + # Add Homebrew to PATH + echo -e "\n${BLUE}Configuring Homebrew in $SHELL_CONFIG...${NC}" + if [[ "$(uname -m)" == "arm64" ]]; then + echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> "$SHELL_CONFIG" + eval "$(/opt/homebrew/bin/brew shellenv)" + else + echo 'eval "$(/usr/local/bin/brew shellenv)"' >> "$SHELL_CONFIG" + eval "$(/usr/local/bin/brew shellenv)" + fi + check_status "Homebrew path configuration" +else + echo -e "${GREEN}Homebrew is already installed.${NC}" +fi + +# Install cmake and LLVM +echo -e "\n${BLUE}Installing cmake and LLVM...${NC}" +brew install cmake --formula llvm@$LLVM_VERSION +check_status "cmake and LLVM installation" + # Add LLVM to PATH echo -e "\n${BLUE}Configuring LLVM in $SHELL_CONFIG...${NC}" -if ! grep -q "$(brew --prefix llvm@${LLVM_VERSION})/bin" "$SHELL_CONFIG"; then - echo 'PATH="$(brew --prefix llvm@'$LLVM_VERSION')/bin:$PATH"' >> "$SHELL_CONFIG" +LLVM_PATH_LINE='export PATH="$(brew --prefix llvm@'"$LLVM_VERSION"')/bin:$PATH"' +if ! grep -Fxq "$LLVM_PATH_LINE" "$SHELL_CONFIG"; then + echo "$LLVM_PATH_LINE" >> "$SHELL_CONFIG" fi check_status "LLVM path configuration" @@ -74,5 +96,14 @@ echo -e "\n${BLUE}Installing Radix Engine Simulator and CLI tools...${NC}" cargo install --force radix-clis@$RADIX_CLI_VERSION check_status "Radix tools installation" +# Verify installations +echo -e "\n${BLUE}Verifying installations...${NC}" +echo -e "Versions installed:" +echo -e "LLVM: $(llvm-config --version)" +echo -e "Clang: $(clang --version | head -n 1)" +echo -e "Rust: $(rustc --version)" +echo -e "Cargo: $(cargo --version)" +echo -e "Radix CLI: $(scrypto --version)" + echo -e "\n${GREEN}Installation complete! Please restart your terminal or run:${NC}" echo -e "source $SHELL_CONFIG"