Reading Assignment: Truffle Migrations

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
  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

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
  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
  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
  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
  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

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.

1 Like

1.) Migrations are JS Files that will deploy (smart) contracts to the ETH blockchain.
2.) artifacts.require defines which smart contracts (contract names not filenames as “require” in nodejs, etc.) are used for deployment and interact with
3.) Mirgation.sol is generated by using “truffle init” - it’s a contract, that will/should be deployed first in order to use the migration and upgrade feature of truffle and keeps the last completed migration. Functions inside are restricted to the owner(address)
4.) By using the deployer.deploy(ContractName function

1 Like

js files which enable you to deploy your contracts, also with presettings you want it to have

You can choose with it with which contract you wanna interact with

Set and upgrade migrations

Deployer function

  1. Migrations are JavaScript files that help you deploy contracts to the Ethereum network.
  2. tells truffle which contract to deploy.
  3. 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. deployer.deploy(contract_name)
  1. Migrations are files which are written in Javascript and are a little helper tool for deploying smart contracts. In the migration contract a number is stored which belongs to the last applied migration script (located in migration folder). The first step is to deploy the migration contract. Truffle knows which is the latest applied deployment script and will not run this script again. For a new contract (when an upate is needed) a new script with an increase number is needed.

  2. The function tells truffle which contracts are important and with whom we interact with.

  3. It sets the latest migration (only by the owner) and stores also the information which was the last applied deployment script

  4. deployer.deploy(contract, args…, options) --> For example: deployer.deploy(MySmartContract);

1. What are migrations?
	a. Migrations are JavaScript files that help you deploy contracts to the Ethereum network.
	
2. What does the function artifacts.require() do?
	a. we tell Truffle which contracts we'd like to interact with
	
3. Take a look at the Migrations.sol contract, what does it do?
	a. Stores the owner and last completed migration 
	
	
4. What function should we run when we want to deploy a contract from inside the migrations file?
	a. deployer.deploy()