Reading Assignment: Truffle Migrations

#1

Welcome to this assignment. Please answer the following questions from the lecture. Feel free to ask questions here as well if you need the help.

  1. What are migrations?
  2. What does the function artifacts.require() do?
  3. Take a look at the Migrations.sol contract, what does it do?
  4. What function should we run when we want to deploy a contract from inside the migrations file?
1 Like

#2
  1. Migrations are javascript file that helps in deploying the contracts.
  2. It helps us in interacting with the contracts. We spcify the name of the contract in artifacts.require()
  3. It helps in using the migrations feature of the truffle. This contract is deployed initially as first migration and is not updated again.
  4. deployer.deploy()
2 Likes

#3

1. What are migrations?
Migrations are JavaScript files that help you deploy contracts to the Ethereum network.

2. What does the function artifacts.require() do?
This function requires the name of the contract in order to interact with it.

3. Take a look at the Migrations.sol contract, what does it do?
It allows migrations to be set and upgraded by the owner of the contract while keeping record of the last completed migration.

4. What function should we run when we want to deploy a contract from inside the migrations file?
We should run a deployer function.

deployer.deploy(A);

2 Likes

#4
  1. Migrations are js files used to configure parameters to deploy contracts to the Ethereum network.

  2. The function artifacts.require() tells truffle which contract to deploy.

  3. The Migrations.sol contract sets the owner of the contracts being migrated, sets restrictions so only the owner can upgrade, sets the signature of the last completed migration

  4. We use the deployer function to deploy the configured artifacts and optional parameters

2 Likes

#5
  1. What are migrations?
    JavaScript files that indicate which contracts should be deployed to a target Ethereum network.

  2. What does the function artifacts.require() do?
    Loads the target contract and (assuming in is the right hand operand in an assignment operation) assigns the result in the variable on the left side of the assignment operator.

  3. Take a look at the Migrations.sol contract, what does it do?
    Stores the owner and last completed migration (version) and provides methods used by truffle to upgrade a previously deployed contract and capturing the information about a completed contract.

  4. What function should we run when we want to deploy a contract from inside the migrations file?
    deployer.deploy

2 Likes

#6
  1. Migrations are JavaScript files that help you deploy contracts to the Ethereum network.
  2. tell Truffle which contracts we’d like to interact with
  3. take advantage of the Migrations feature.
  4. deployer.deploy(contract_name)
2 Likes

#7
  1. What are migrations?
    After making changes to a contract locally we can use migrate to push the changes to the onchain contract. Migrations are the scripts that are used to deploy the changes.

  2. What does the function artifacts.require() do?
    it let’s us specify the contract(s) that we want to interact with.

  3. Take a look at the Migrations.sol contract, what does it do?
    Every time a migration step is successfully this contract will update the last_completed_migration nr.

  4. What function should we run when we want to deploy a contract from inside the migrations file?
    deployer.deploy()

1 Like

#8

1. What are migrations?
Migrations are a set of managed deployment scripts.

2. What does the function artifacts.require() do?
It selects the name of the contract that you want to deploy.

3. Take a look at the Migrations.sol contract, what does it do?
It sets the contract owner, only allows the owner to modify the contract, and keeps track of the last completed migration.

4. What function should we run when we want to deploy a contract from inside the migrations file?
We should run the deployer function, deployer.deploy.

0 Likes