Reading Assignment: Truffle Migrations

What are migrations?

  • they are Javascript files that help you deploy contracts to the Ethereum network.

What does the function artifacts.require() do?

  • Tells Truffle which contracts we would like to interact with by giving the name of the contract definition.

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

  • Helps manage the migration feature. As your deployment needs evolves change over time, you will create new migration scripts to further this evolution - the Migrations.sol facilitates these needs.

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 javascript files that help deploy smart contracts
  2. What does the function artifacts.require() do?
    Artifacts.require() helps us specify what contract we are trying to interact with
  3. Take a look at the Migrations.sol contract, what does it do?
    The Migrations contract helps manage all migrations
  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?
    => JavaScript files that help you deploy contracts to the Ethereum network, simplest: a set of managed deployment scripts.
    Run: truffle migrate (with --reset all past migrations are rerun)
  2. What does the function artifacts.require() do?
    => tell Truffle which contracts weā€™d like to interact with, like Nodeā€™s ā€˜requireā€™, specifying the contract name, not the file name of the contract(s), per contract.
  3. Take a look at the Migrations.sol contract, what does it do?
    => upgrades the owner to the msg.sender address, nothing is done with the given new_address, only allowed to the contract owner (address),
    returns an uint as last_completed_migration = value is unclear (in SetCompleted it is set to the value it already has.
  4. What function should we run when we want to deploy a contract from inside the migrations file?
    => deployer.deploy(Migrations); With Migrations is the contract to deploy set via var Migrations=artifacts.require(ā€œMigrationsā€);
1 Like

1.) JS Files that help deploy contracts
basically a set of managed deployment scripts
2.) Tells truffle which contracts we want to interact with
returns contract abstraction which we can use
3.) Helps us use migrations feature, allows migrations to be set and upgraded
4.) deployer.deploy()

1 Like

Reading Assignment: Truffle Migrations (Answer);

  1. Jscript file that helps you deploy contracts to the Ethereum network.

  2. Returns a contract abstraction we can use within the rest of deploy.

  3. Initial migrations file , containing specific interface.

  4. deployer.deploy()

1 Like
  1. What are migrations?
    Migrations are JavaScript files which let you deploy your smart contracts with truffle

  2. What does the function artifacts.require() do?
    It returns an abstraction of the contract which can be used within the context of the migration files

  3. Take a look at the Migrations.sol contract, what does it do?
    Keeps track of which contracts have already been migrated

  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? script that deploy the contracts to the blockchain.
  2. What does the function artifacts.require() do?ell Truffle which contracts weā€™d like to interact with
  3. Take a look at the Migrations.sol contract, what does it do? Setup and is required for truffle to migrate scripts to work.
  4. What function should we run when we want to deploy a contract from inside the migrations file?

deployer.deploy(contract, argsā€¦, options)

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

  2. What does the function artifacts.require() do?
    It defines with which contract we will interact in the migration file.

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

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

2 Likes
  1. What are migrations?

    • in truffle environment is a file that help we write contract in chain
  2. What does the function artifacts.require() do?

    • a method that return information of contract for deployed
  3. Take a look at the Migrations.sol contract, what does it do?

    • help with deploy and give utils information for track contract
  4. What function should we run when we want to deploy a contract from inside the migrations file?

    • deployer.deploy(name variable contain a contract information);
1 Like
1

Migrations are JavaScript files that help us deploy contracts to the Ethereum network

2

artifacts.require() returns a contract abstraction that we can use within the rest of our deployment script.

3

It sets last completed migration.

4

deployer.deploy(contractName)

1 Like
  1. the Javascript files which help you deploy to ethereum network

  2. Returns a contract abstraction which we can use in our deployment script

  3. It keeps track of the latest version of the deployment

  4. function setCompleted(uint completed)

2 Likes

1. What are migrations?
JS files which deploy contratcs to the specified network.
2. What does the function artifacts.require() do?
There we specifie which contract we want to deploy and it returns an abstraction of this contract
3. Take a look at the Migrations.sol contract, what does it do?
It 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?
After specifying which contract we want to deploy we run the following function
module.exports = function (deployer) { deployer.deploy(Contract); };

2 Likes

1.What are migrations?
Migrations are JavaScript files that deploy contract to the Ethereum network.

2.What does the function artifacts.require() do?
Tells Truffle which contract we want to interact with, returns a contract abstraction that can be used within th rest of the deployment script.

3.Take a look at the Migrations.sol contract, what does it do?
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?
deployer.deploy()

1 Like