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?
2 Likes
  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()
4 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);

4 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

3 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

2 Likes
  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 Like
  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);

2 Likes
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()
1 Like
  1. What are migrations?
    They are JS files that help deploy contracts to the ETH network. They’re responsible for staging our deployment tasks, and they’re written under the assumption that our deployment needs will change over time.

  2. What does the function artifacts.require() do?
    It’s to tell Truffle which contracts we’d like to interact with via the artifacts.require() method.

  3. Take a look at the Migrations.sol contract, what does it do?
    It contains an interface needed in order to use the migration feature. It also sets the owner of the contracts being migrated, sets restrictions and sets the signature of the last completed migration.

  4. What function should we run when we want to deploy a contract from inside the migrations file?
    We user the deployer function to deploy the configured artifacts and its parameters.

1 Like
  1. Migrations are JavaScript files that let you deploy contracts to the ETH network
  2. With this function we tell Truffle which contracts we’d like to interact with
  3. It allows migrations to be set and upgraded by the owner of the contract while keeping record of the last completed migration.
  4. We run a deployer function: deployer.deploy()

What are migrations?
Javascript files that help deploy contracts to the Ethereum network
What does the function artifacts.require() do?
The function tells Truffle which contract to interact with
Take a look at the Migrations.sol contract, what does it do?
The contract sets the owner address, adds a restricted modifier for the owner and tracks the last completed migration
What function should we run when we want to deploy a contract from inside the migrations file?
deployer.deploy(…)

  1. A series of files in a certain order that tell truffle how to deploy various smart contracts and various modifications to these contracts. They are idempotent in that they can be re-ran without any adverse effects. They can however be totally reset

  2. it tells Truffle which contracts we’d like to interact with

  3. Truffle requires you to have a Migrations contract in order to use the Migrations feature. This contract must contain a specific interface. You must deploy this contract inside your first migration in order to take advantage of the migrations feature.

  4. deployer.deploy(..)

  1. “Migrations are JavaScript files that help you deploy contracts to the Ethereum network.”

  2. The function artifacts.require works in a similar way to Node.js’ require function. artifacts.require tells Truffle which contracts we would like to interact with.
    The name specified in the brackets should be the name of the contract, not the contract file name, as files may contain multiple contracts.
    The function then returns a contract abstraction which we can use through the rest of the deployed script e.g. passing it through other functions, conditional deployment of contracts.

  3. The Migrations.sol file keeps a record of the last_completed_migration and upgrades previously deployed contracts, if they are deployed again.

  4. To deploy a contract from inside Migrations.sol, we should use deployer.deploy(insert_contract_name_here)`

  • What are migrations?
    Migrations are JavaScript files that help you deploy contracts to the Ethereum network.
  • What does the function artifacts.require() do?
    It specifically returns a contract abstraction that we can use within the rest of deployment script
  • Take a look at the Migrations.sol contract, what does it do?
    It allows migrations to be updated and keep the completed record.
  • What function should we run when we want to deploy a contract from inside the migrations file?
    deployer function

1. What are migrations?

JavaScript files that enable one to deploy contracts to the Ethereum network. The files are responsible for staging deployment tasks and written with the assumption that deployment requirements will change overtime.

2. What does the function artifacts.require() do?

It returns a contract abstraction which can be used throughout a deployment script. It is similar to importing files using require in Node.

3. Take a look at the Migrations.sol contract, what does it do?

It assigns the owner of the contract to the person who deployed it and allows accessing details regarding when the last migration (deployment) was done. Also, it restricts access to only the owner of the contract to keep note of when the last migration was completed.

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

.deploy()

2 Likes